Re: [PATCH 2/5] accounting unit and variable

2007-11-15 Thread Hideo AOKI
Herbert Xu wrote: > On Wed, Nov 14, 2007 at 06:30:51PM -0500, Hideo AOKI wrote: >> +#define SK_DATAGRAM_MEM_QUANTUM ((unsigned int)PAGE_SIZE) >> + >> +static inline int sk_datagram_pages(int amt) >> +{ >> +/* Cast to unsigned as an optimization, since amt is always >> positive. */ >> +retu

Re: [PATCH 2/5] accounting unit and variable

2007-11-14 Thread Herbert Xu
On Wed, Nov 14, 2007 at 06:30:51PM -0500, Hideo AOKI wrote: > > +#define SK_DATAGRAM_MEM_QUANTUM ((unsigned int)PAGE_SIZE) > + > +static inline int sk_datagram_pages(int amt) > +{ > + /* Cast to unsigned as an optimization, since amt is always > positive. */ > + return DIV_ROUND_UP((unsign

Re: [PATCH 2/5] accounting unit and variable

2007-11-14 Thread Hideo AOKI
Hideo AOKI wrote: David Miller wrote: From: Hideo AOKI <[EMAIL PROTECTED]> Date: Tue, 13 Nov 2007 22:27:13 -0500 Herbert Xu wrote: On Mon, Oct 29, 2007 at 05:23:10PM -0400, Hideo AOKI wrote: +#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) + +static inline int sk_datagram_pages(int amt) +

Re: [PATCH 2/5] accounting unit and variable

2007-11-14 Thread Hideo AOKI
David Miller wrote: From: Hideo AOKI <[EMAIL PROTECTED]> Date: Tue, 13 Nov 2007 22:27:13 -0500 Herbert Xu wrote: On Mon, Oct 29, 2007 at 05:23:10PM -0400, Hideo AOKI wrote: +#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) + +static inline int sk_datagram_pages(int amt) +{ + return DI

Re: [PATCH 2/5] accounting unit and variable

2007-11-13 Thread David Miller
From: Hideo AOKI <[EMAIL PROTECTED]> Date: Tue, 13 Nov 2007 22:27:13 -0500 > Herbert Xu wrote: > > On Mon, Oct 29, 2007 at 05:23:10PM -0400, Hideo AOKI wrote: > >> > >> +#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) > >> + > >> +static inline int sk_datagram_pages(int amt) > >> +{ > >> + ret

Re: [PATCH 2/5] accounting unit and variable

2007-11-13 Thread Herbert Xu
On Tue, Nov 13, 2007 at 10:27:13PM -0500, Hideo AOKI wrote: > > Herbert Xu wrote: > >> > >>+#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) > >>+ > >>+static inline int sk_datagram_pages(int amt) > >>+{ > >>+ return DIV_ROUND_UP(amt, SK_DATAGRAM_MEM_QUANTUM); > >>+} > > > >Does this really hav

Re: [PATCH 2/5] accounting unit and variable

2007-11-13 Thread Hideo AOKI
Hello, Herbert Xu wrote: On Mon, Oct 29, 2007 at 05:23:10PM -0400, Hideo AOKI wrote: +#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) + +static inline int sk_datagram_pages(int amt) +{ + return DIV_ROUND_UP(amt, SK_DATAGRAM_MEM_QUANTUM); +} Does this really have to be int? Unsigned w

[PATCH 2/5] accounting unit and variable

2007-11-13 Thread Hideo AOKI
This patch introduces global variable for UDP memory accounting. The unit is page. signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]> signed-off-by: Hideo Aoki <[EMAIL PROTECTED]> --- include/net/sock.h |7 +++ include/net/udp.h |2 ++ net/ipv4/proc.c|3 ++- net/ipv4/udp.c

Re: [PATCH 2/5] accounting unit and variable

2007-11-09 Thread Herbert Xu
On Mon, Oct 29, 2007 at 05:23:10PM -0400, Hideo AOKI wrote: > > +#define SK_DATAGRAM_MEM_QUANTUM ((int)PAGE_SIZE) > + > +static inline int sk_datagram_pages(int amt) > +{ > + return DIV_ROUND_UP(amt, SK_DATAGRAM_MEM_QUANTUM); > +} Does this really have to be int? Unsigned would let the compi

[PATCH 2/5] accounting unit and variable

2007-10-29 Thread Hideo AOKI
This patch introduces global variable for UDP memory accounting. The unit is page. -- Hideo Aoki Hitachi Computer Products (America) Inc. Signed-off-by: Satoshi Oshima <[EMAIL PROTECTED]> Signed-off-by: Hideo Aoki <[EMAIL PROTECTED]> include/net/sock.h |7 +++ include/net/udp.h |2