Re: [PATCH 1/11] maps3: add proportional set size accounting in smaps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 15 Oct 2007, Matt Mackall wrote:

> > The pss is going to need accessor functions, preferably inlined, and the 
> > comment adjusted stating that all accesses should be through those 
> > functions and not directly to the mem_size_stats struct.
> > 
> > 	static inline u64 pss_up(unsigned long pss)
> > 	{
> > 		return pss << PSS_DIV_BITS;
> > 	}
> > 
> > 	static inline unsigned long pss_down(u64 pss)
> > 	{
> > 		return pss >> PSS_DIV_BITS;
> > 	}
> 
> I think that's overkill for something that has exactly one use of each.
> 

There's no overkill at all, the current uses are already accessed with 
these bitshifts so there's no overhead when using an inlined function 
instead.

To correctly access the pss, these bitshifts are required because the 
decision was made to use the lower PSS_DIV_BITS for rounding.  Thus, you 
need to include accessor functions so that they are always accessed 
correctly now and in the future.

		David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux