From patchwork Wed May 16 20:46:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10404839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18281601C8 for ; Wed, 16 May 2018 20:46:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04BF726E96 for ; Wed, 16 May 2018 20:46:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECE2D28733; Wed, 16 May 2018 20:46:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D93226E96 for ; Wed, 16 May 2018 20:46:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 617606B0360; Wed, 16 May 2018 16:46:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5C6066B0361; Wed, 16 May 2018 16:46:50 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48DF66B0362; Wed, 16 May 2018 16:46:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 096D46B0360 for ; Wed, 16 May 2018 16:46:50 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id a6-v6so826538pgt.15 for ; Wed, 16 May 2018 13:46:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Ul3nwk0qxqT3md6+2070JfD4xPK5f2g6g4kmaTKFlR8=; b=kfAoyUTvTkPlnXxflUds0WpgJUuJfozypNzVMpTuaZMs7deSMTLcs4lOZY2hP0e1h2 frrFMtFXu2JI3D3w6xJxvOPWDLZgKl1kVF2paioW81srPPUZF6yhikAh0mhCnWhjqWXh tN3H5VkdJ75Hfz04xn9Rxy2Eo7Xst1YRYdJl+0e2xHy8v70Z/7zQaLQdD0E3gtWgx1Lq XJC+73ec2+NjmPS7NyV1MzDMxshljQ/U6FbC2FtsBTeffx1gGU14lkJ3hdQlTN4vNL/6 GJ+NVujEgA0IKzjwj2Ok26R1bTMJLFHpTu2BxFK01nJ2KTzwXTu37Pph6EMy6oIs/ZVd JWyA== X-Original-Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: ALKqPwe1WPMFNlOgWu7/jjOV35ASeKZMj/Wb3zf6rOR5LfXyRNi2+5Aj 50Y6u1MFx8UFGPY08h/cy20JG9esUad6tGpC6XMi721l051QJgzVA7MNqGOh0qJpy1YJNFR84zc aVgyUAWj1bZ4I0IXt+E0g6cymtmuGx1w/Z7RznCDxJETLmOSGoAOZtCO8aKrS5Rg= X-Received: by 2002:a17:902:323:: with SMTP id 32-v6mr2501248pld.312.1526503609737; Wed, 16 May 2018 13:46:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpW24okDs4rrs431f0dPxVWtniyCNxXiy3PDMSEx97uMx2iKxBB3GDCZ2C/S8YQsW/CpdL2 X-Received: by 2002:a17:902:323:: with SMTP id 32-v6mr2501217pld.312.1526503609145; Wed, 16 May 2018 13:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526503609; cv=none; d=google.com; s=arc-20160816; b=LDMU3w0acE8OLVlktHPyhJD6Una4iUNSQoJJt6P9Ert7edqvvVwqXylToMlCMNhySy 38U4i8Ko3f5Js2Volb6Ahtvhe+ubmZEGiz6vqNcLg/in3tE/AujGqHo0wrM0lMkasfk7 nRHPUxWTAaO97vLXgjqaILHgQ3wdfVSfc4FHGBj6ReiBkmOF4P9Y8I0zhhbRAjHbIrRU 52Ailr8m3WZXSQzskRn+u3UcTRzixocJM1eqn7p60QiZxGU7kRnIREyLnijaIjuV+5s6 mdVAFK2yfH+1KcHFutg16mi0dBzqOPkVhuguKHXuwMjrrn0os3lSMovFfWklHwbS7SxK iWug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=Ul3nwk0qxqT3md6+2070JfD4xPK5f2g6g4kmaTKFlR8=; b=MMU74/Aduu0jE3wkxnshNNt8R4+FKDBmwf6WPrZLDcbYPRG3m0Erbuj4QM+Qgh6ZTH +WJHQpjkox2GBHuSbiH/XmXk3q3tE2qqzFzXyKCzUDCFXJnjDZOoyKGCyINliGfZdFYY 3s77vSIVT9c2fTTz6M4iC6mkBGZd4yo/HrdmLRmqmyveFfTmBmI3K+NosrJ+a0255IiV Q3m/p8mOQfhu4wRGXwI4bgRqQDLsv/XpsfrssRe8DG56Bt6fEURv5XZmnLXNRB53n0Uy iclWlSaJIP8y06OAd+pVjy4RcktxPxZL+lJG2EMJYAjr9ULWSZ/YKxxlo/K/r/7oi+z4 fgSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id b97-v6si3501317plb.135.2018.05.16.13.46.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 13:46:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 62E4AAEBF; Wed, 16 May 2018 20:46:45 +0000 (UTC) Date: Wed, 16 May 2018 22:46:44 +0200 From: Michal Hocko To: Shakeel Butt Cc: Andrew Morton , Greg Thelen , Mel Gorman , Vlastimil Babka , Linux MM , LKML Subject: Re: [PATCH] mm: save two stranding bit in gfp_mask Message-ID: <20180516204644.GO12670@dhcp22.suse.cz> References: <20180516202023.167627-1-shakeelb@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180516202023.167627-1-shakeelb@google.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On Wed 16-05-18 13:20:23, Shakeel Butt wrote: > ___GFP_COLD and ___GFP_OTHER_NODE were removed but their bits were > stranded. Slide existing gfp masks to make those two bits available. Could you make the patch a bit smaller smaller? E.g. > Signed-off-by: Shakeel Butt Other than that I have no real objections. It is good to see how many bits we are using. So Acked-by: Michal Hocko > --- > include/linux/gfp.h | 42 +++++++++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > index 1a4582b44d32..8edf72d32411 100644 > --- a/include/linux/gfp.h > +++ b/include/linux/gfp.h > @@ -16,31 +16,31 @@ struct vm_area_struct; > */ > > /* Plain integer GFP bitmasks. Do not use this directly. */ > -#define ___GFP_DMA 0x01u > -#define ___GFP_HIGHMEM 0x02u > -#define ___GFP_DMA32 0x04u > -#define ___GFP_MOVABLE 0x08u > +#define ___GFP_DMA 0x1u > +#define ___GFP_HIGHMEM 0x2u > +#define ___GFP_DMA32 0x4u > +#define ___GFP_MOVABLE 0x8u > #define ___GFP_RECLAIMABLE 0x10u > #define ___GFP_HIGH 0x20u > #define ___GFP_IO 0x40u > #define ___GFP_FS 0x80u > -#define ___GFP_NOWARN 0x200u > -#define ___GFP_RETRY_MAYFAIL 0x400u > -#define ___GFP_NOFAIL 0x800u > -#define ___GFP_NORETRY 0x1000u > -#define ___GFP_MEMALLOC 0x2000u > -#define ___GFP_COMP 0x4000u > -#define ___GFP_ZERO 0x8000u > -#define ___GFP_NOMEMALLOC 0x10000u > -#define ___GFP_HARDWALL 0x20000u > -#define ___GFP_THISNODE 0x40000u > -#define ___GFP_ATOMIC 0x80000u > -#define ___GFP_ACCOUNT 0x100000u > -#define ___GFP_DIRECT_RECLAIM 0x400000u > -#define ___GFP_WRITE 0x800000u > -#define ___GFP_KSWAPD_RECLAIM 0x1000000u > +#define ___GFP_NOWARN 0x100u > +#define ___GFP_RETRY_MAYFAIL 0x200u > +#define ___GFP_NOFAIL 0x400u > +#define ___GFP_NORETRY 0x800u > +#define ___GFP_MEMALLOC 0x1000u > +#define ___GFP_COMP 0x2000u > +#define ___GFP_ZERO 0x4000u > +#define ___GFP_NOMEMALLOC 0x8000u > +#define ___GFP_HARDWALL 0x10000u > +#define ___GFP_THISNODE 0x20000u > +#define ___GFP_ATOMIC 0x40000u > +#define ___GFP_ACCOUNT 0x80000u > +#define ___GFP_DIRECT_RECLAIM 0x100000u > +#define ___GFP_WRITE 0x200000u > +#define ___GFP_KSWAPD_RECLAIM 0x400000u > #ifdef CONFIG_LOCKDEP > -#define ___GFP_NOLOCKDEP 0x2000000u > +#define ___GFP_NOLOCKDEP 0x800000u > #else > #define ___GFP_NOLOCKDEP 0 > #endif > @@ -205,7 +205,7 @@ struct vm_area_struct; > #define __GFP_NOLOCKDEP ((__force gfp_t)___GFP_NOLOCKDEP) > > /* Room for N __GFP_FOO bits */ > -#define __GFP_BITS_SHIFT (25 + IS_ENABLED(CONFIG_LOCKDEP)) > +#define __GFP_BITS_SHIFT (23 + IS_ENABLED(CONFIG_LOCKDEP)) > #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) > > /* > -- > 2.17.0.441.gb46fe60e1d-goog diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 1a4582b44d32..92c82ac8420f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -24,6 +24,7 @@ struct vm_area_struct; #define ___GFP_HIGH 0x20u #define ___GFP_IO 0x40u #define ___GFP_FS 0x80u +#define ___GFP_WRITE 0x100u #define ___GFP_NOWARN 0x200u #define ___GFP_RETRY_MAYFAIL 0x400u #define ___GFP_NOFAIL 0x800u @@ -36,11 +37,10 @@ struct vm_area_struct; #define ___GFP_THISNODE 0x40000u #define ___GFP_ATOMIC 0x80000u #define ___GFP_ACCOUNT 0x100000u -#define ___GFP_DIRECT_RECLAIM 0x400000u -#define ___GFP_WRITE 0x800000u -#define ___GFP_KSWAPD_RECLAIM 0x1000000u +#define ___GFP_DIRECT_RECLAIM 0x200000u +#define ___GFP_KSWAPD_RECLAIM 0x400000u #ifdef CONFIG_LOCKDEP -#define ___GFP_NOLOCKDEP 0x2000000u +#define ___GFP_NOLOCKDEP 0x800000u #else #define ___GFP_NOLOCKDEP 0 #endif