Move the declaration of sfbufspeak and sfbufsused to mbuf.h,
and use imax instead of max, as sfbufspeak and sfbufsused are signed. Submitted by: bde
This commit is contained in:
parent
735adf63e4
commit
5caf2b00f0
@ -116,7 +116,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
@ -430,7 +429,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
return (sf);
|
||||
|
@ -99,7 +99,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
@ -475,7 +474,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
return (sf);
|
||||
|
@ -112,7 +112,6 @@ static u_long sf_buf_hashmask;
|
||||
|
||||
static TAILQ_HEAD(, sf_buf) sf_buf_freelist;
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
/*
|
||||
* A lock used to synchronize access to the hash table and free list
|
||||
@ -615,7 +614,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
sf->ref_count++;
|
||||
if (sf->ref_count == 1) {
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
@ -639,7 +638,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
sf->ref_count = 1;
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
pmap_qenter(sf->kva, &sf->m, 1);
|
||||
done:
|
||||
mtx_unlock(&sf_buf_lock);
|
||||
|
@ -113,7 +113,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
void
|
||||
cpu_thread_exit(struct thread *td)
|
||||
@ -367,7 +366,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
return (sf);
|
||||
|
@ -116,7 +116,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
@ -284,7 +283,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
pmap_qenter(sf->kva, &sf->m, 1);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
|
@ -116,7 +116,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
@ -284,7 +283,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
pmap_qenter(sf->kva, &sf->m, 1);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
|
@ -100,7 +100,6 @@ static struct {
|
||||
} sf_freelist;
|
||||
|
||||
static u_int sf_buf_alloc_want;
|
||||
extern int nsfbufspeak, nsfbufsused;
|
||||
|
||||
PMAP_STATS_VAR(uma_nsmall_alloc);
|
||||
PMAP_STATS_VAR(uma_nsmall_alloc_oc);
|
||||
@ -411,7 +410,7 @@ sf_buf_alloc(struct vm_page *m)
|
||||
SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
|
||||
sf->m = m;
|
||||
nsfbufsused++;
|
||||
nsfbufspeak = max(nsfbufspeak, nsfbufsused);
|
||||
nsfbufspeak = imax(nsfbufspeak, nsfbufsused);
|
||||
pmap_qenter(sf->kva, &sf->m, 1);
|
||||
}
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
|
@ -431,7 +431,9 @@ extern struct mbstat mbstat; /* General mbuf stats/infos */
|
||||
extern int nmbclusters; /* Maximum number of clusters */
|
||||
extern int nmbcnt; /* Scale kmem_map for counter space */
|
||||
extern int nmbufs; /* Maximum number of mbufs */
|
||||
extern int nsfbufs; /* Number of sendfile(2) bufs */
|
||||
extern int nsfbufs; /* Number of sendfile(2) bufs alloced */
|
||||
extern int nsfbufspeak; /* Peak of nsfbufsused */
|
||||
extern int nsfbufsused; /* Number of sendfile(2) bufs in use */
|
||||
|
||||
void _mext_free(struct mbuf *);
|
||||
void m_adj(struct mbuf *, int);
|
||||
|
Loading…
x
Reference in New Issue
Block a user