From: Andi Kleen on 24 Jun 2010 06:10 npiggin(a)suse.de writes: > Allow the shrinker to do per-zone shrinking. This means it is called for > each zone scanned. The shrinker is now completely responsible for calculating > and batching (given helpers), which provides better flexibility. Beyond the scope of this patch, but at some point this probably needs to be even more fine grained. With large number of cores/threads in each socket a "zone" is actually shared by quite a large number of CPUs now and this can cause problems. > +void shrinker_add_scan(unsigned long *dst, > + unsigned long scanned, unsigned long total, > + unsigned long objects, unsigned int ratio) > +{ > + unsigned long long delta; > + > + delta = (unsigned long long)scanned * objects * ratio; > + do_div(delta, total + 1); > + delta /= (128ULL / 4ULL); Again I object to the magic numbers ... > + nr += shrink_slab(zone, 1, 1, 1, GFP_KERNEL); > + if (nr >= 10) > + goto again; And here. Overall it seems good, but I have not read all the shrinker callback changes in all subsystems. -Andi -- ak(a)linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Nick Piggin on 24 Jun 2010 12:10 On Thu, Jun 24, 2010 at 12:06:50PM +0200, Andi Kleen wrote: > npiggin(a)suse.de writes: > > > Allow the shrinker to do per-zone shrinking. This means it is called for > > each zone scanned. The shrinker is now completely responsible for calculating > > and batching (given helpers), which provides better flexibility. > > Beyond the scope of this patch, but at some point this probably needs > to be even more fine grained. With large number of cores/threads in > each socket a "zone" is actually shared by quite a large number > of CPUs now and this can cause problems. Yes, possibly. At least it is a much better step than the big dumb global list. > > +void shrinker_add_scan(unsigned long *dst, > > + unsigned long scanned, unsigned long total, > > + unsigned long objects, unsigned int ratio) > > +{ > > + unsigned long long delta; > > + > > + delta = (unsigned long long)scanned * objects * ratio; > > + do_div(delta, total + 1); > > + delta /= (128ULL / 4ULL); > > Again I object to the magic numbers ... > > > + nr += shrink_slab(zone, 1, 1, 1, GFP_KERNEL); > > + if (nr >= 10) > > + goto again; > > And here. I don't like them either -- problem is they were inherited from the old code (actually 128 is the fixed point scale, I do have a define for it just forgot to use it). I don't know where 4 came from. And 10 is just a random number someone picked out of a hat :P > Overall it seems good, but I have not read all the shrinker callback > changes in all subsystems. Thanks for looking over it Andi. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on 24 Jun 2010 12:30 > > Overall it seems good, but I have not read all the shrinker callback > > changes in all subsystems. > > Thanks for looking over it Andi. FWIW i skimmed over most of the patches and nothing stood out that I really disliked. But I have gone over the code in very deep detail. -Andi -- ak(a)linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on 24 Jun 2010 12:40 On Thu, Jun 24, 2010 at 06:27:02PM +0200, Andi Kleen wrote: > > > Overall it seems good, but I have not read all the shrinker callback > > > changes in all subsystems. > > > > Thanks for looking over it Andi. > > FWIW i skimmed over most of the patches and nothing stood out that > I really disliked. But I have gone over the code in very deep detail. haven't -Andi -- ak(a)linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on 24 Jun 2010 12:40 On Thu, Jun 24, 2010 at 06:27:02PM +0200, Andi Kleen wrote: > > > Overall it seems good, but I have not read all the shrinker callback > > > changes in all subsystems. > > > > Thanks for looking over it Andi. > > FWIW i skimmed over most of the patches and nothing stood out that > I really disliked. But I have gone over the code in very deep detail. s/have/haven't/ -Andi -- ak(a)linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Next
|
Last
Pages: 1 2 Prev: fs: icache lazy lru Next: mm: iommu: An API to unify IOMMU, CPU and device memory management |