On Mon, Sep 20, 2004 at 12:00:33PM -0700, Ray Bryant wrote:Background ---------- Last month, Jesse Barnes proposed a patch to do round robin allocation of page cache pages on NUMA machines. This got shot down for a number of reasons (see http://marc.theaimsgroup.com/?l=linux-kernel&m=109235420329360&w=2 and the related thread), but it seemed to me that one of the most significant issues was that this was a workload dependent optimization. That is, for an Altix running an HPC workload, it was a good thing, but for web servers or file servers it was not such a good idea. So the idea of this patch is the following: it creates a new memory policy structure (default_pagecache_policy) that is used to control how storage for page cache pages is allocated. So, for a large Altix running HPC workloads, we can specify a policy that does round robin allocations, and for other workloads you can specify the default policy (which results in page cache pages being allocated locally). The default_pagecache_policy is overrideable on a per process basis, so that if your application prefers to allocate page cache pages locally, it can.I'm not sure this really makes sense. Do you have some clear use case where having so much flexibility is needed? I would prefer to have a global setting somewhere for the page cache (sysctl or sysfs or what you prefer) and some special handling for text pages. This would keep the per thread bloat low. Also I must say I got a patch submitted to do policy per file from Steve Longerbeam. It so far only supports this for ELF executables, but it has most of the infrastructure to do individual policy per file. Maybe it would be better to go into this direction, only thing missing is a nice way to declare policy for arbitary files. Even in this case a global default would be useful. I haven't done anything with this patch yet due to missing time and there were a few small issues to resolve, but i hope it can be eventually integrated. [Steve, perhaps you can repost the patch to lse-tech for more wider review?]