Ravikiran G Thirumalai <[EMAIL PROTECTED]> wrote: > > --- linux-2.6.16-rc5mm3.orig/include/net/sock.h 2006-03-07 > 15:09:22.000000000 -0800 > +++ linux-2.6.16-rc5mm3/include/net/sock.h 2006-03-07 15:09:52.000000000 > -0800 > @@ -543,7 +543,7 @@ struct proto { > /* Memory pressure */ > void (*enter_memory_pressure)(void); > struct percpu_counter *memory_allocated; /* Current allocated > memory. */ > - atomic_t *sockets_allocated; /* Current number of > sockets. */ > + int *sockets_allocated; /* Current number of > sockets (percpu counter). */ > > /* > * Pressure flag: try to collapse. > @@ -579,6 +579,24 @@ struct proto { > } stats[NR_CPUS]; > }; > > +static inline int read_sockets_allocated(struct proto *prot) > +{ > + int total = 0; > + int cpu; > + for_each_cpu(cpu) > + total += *per_cpu_ptr(prot->sockets_allocated, cpu); > + return total; > +}
This is likely too big to be inlined, plus sock.h doesn't include enough headers to reliably compile this code. > +static inline void mod_sockets_allocated(int *sockets_allocated, int count) > +{ > + (*per_cpu_ptr(sockets_allocated, get_cpu())) += count; > + put_cpu(); > +} > + Ditto. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html