On Wed, 12 Nov 2014 03:47:03 +0200 "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> wrote: > On Wed, Nov 12, 2014 at 03:22:41AM +0200, Kirill A. Shutemov wrote: > > On Tue, Nov 11, 2014 at 04:49:13PM -0800, Andrew Morton wrote: > > > On Tue, 11 Nov 2014 18:36:28 -0600 (CST) Christoph Lameter <cl@xxxxxxxxx> wrote: > > > > > > > On Tue, 11 Nov 2014, Andrew Morton wrote: > > > > > > > > > There's no point in doing > > > > > > > > > > #define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK) > > > > > > > > > > because __GFP_DMA32|__GFP_HIGHMEM are already part of ~__GFP_BITS_MASK. > > > > > > > > ?? ~__GFP_BITS_MASK means bits 25 to 31 are set. > > > > > > > > __GFP_DMA32 is bit 2 and __GFP_HIGHMEM is bit 1. > > > > > > Ah, yes, OK. > > > > > > I suppose it's possible that __GFP_HIGHMEM was set. > > > > > > do_huge_pmd_anonymous_page > > > ->pte_alloc_one > > > ->alloc_pages(__userpte_alloc_gfp==__GFP_HIGHMEM) > > > > do_huge_pmd_anonymous_page > > alloc_hugepage_vma > > alloc_pages_vma(GFP_TRANSHUGE) > > > > GFP_TRANSHUGE contains GFP_HIGHUSER_MOVABLE, which has __GFP_HIGHMEM. > > Looks like it's reasonable to sanitize flags in shrink_slab() by dropping > flags incompatible with slab expectation. Like this: > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index dcb47074ae03..eb165d29c5e5 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -369,6 +369,8 @@ unsigned long shrink_slab(struct shrink_control *shrinkctl, > if (nr_pages_scanned == 0) > nr_pages_scanned = SWAP_CLUSTER_MAX; > > + shrinkctl->gfp_mask &= ~(__GFP_DMA32 | __GFP_HIGHMEM); > + > if (!down_read_trylock(&shrinker_rwsem)) { > /* > * If we would return 0, our callers would understand that we Well no, because nobody is supposed to be passing this gfp_mask back into a new allocation attempt anyway. It would be better to do shrinkctl->gfp_mask |= __GFP_IMMEDIATELY_GO_BUG; ? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>