On Tue, 12 Feb 2008, Paul Jackson wrote:Again, if you did it this way, the lower MPOL_FLAG_SHIFT bits of the new 'flags' member would always be zero if you are still going to use the MPOL_F_* defines from linux/mempolicy.h to do your bit testing. I do not subscribe to the theory that just because we have a couple extra bytes of space somewhere in struct mempolicy that we have to use it immediately. It makes the kernel code simpler, in a way. Now we only have to pass a single actual among functions that include both the mode and optional flags (there are a lot of them and they span not only the VM but also filesystem code). The catch is that we have to use a mpol_mode() wrapper for mode conditionals or switch statements. But testing the flags is just as easy as if (mode & MPOL_F_STATIC_NODES) { ... } That test would remain unchanged (except for s/mode/flags/) if flags were stored in a separate member. So by storing them both in an 'unsigned short' member of struct mempolicy: - we don't use any additional memory (and we can use those two extra bytes you identified earlier later), and - we only have to pass a single actual to many different functions that require both the mode and optional mode flags. --
| Benjamin Herrenschmidt | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Mariusz Kozlowski | [PATCH 03] drivers/sbus/char/bbc_envctrl.c: kmalloc + memset conversion to kzalloc |
| Yinghai Lu | [PATCH 02/16] x86: introduce nr_irqs for 64bit v3 |
git: | |
| Gerrit Renker | [PATCH 13/37] dccp: Deprecate Ack Ratio sysctl |
| James Morris | Re: [GIT]: Networking |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
