Messages in this thread | | | Date | Mon, 15 Oct 2007 19:24:09 -0700 (PDT) | From | David Rientjes <> | Subject | Re: [PATCH 1/11] maps3: add proportional set size accounting in smaps |
| |
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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |