Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2713644rdb; Mon, 12 Feb 2024 14:10:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXI+seMUYLMMp6ndtVdfOOd/GtkC0BjY6XG3tHdULjjprUzufA8tpfLV/YAbrns8QL0A9HgcnnoTNhxIrgHlxXgyoxNIjjcepSnKpcXfA== X-Google-Smtp-Source: AGHT+IGpI1GiBtXfQgH/ixFtB7IYSGfeEfo+3fpKPrUmg5E1bxMOOiWWsa1ULaFpYKK5605zk+pH X-Received: by 2002:a17:902:fc8d:b0:1db:299f:5b0e with SMTP id mf13-20020a170902fc8d00b001db299f5b0emr2075225plb.1.1707775834936; Mon, 12 Feb 2024 14:10:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707775834; cv=pass; d=google.com; s=arc-20160816; b=WrGp5FepvESaKEi3LdmKmSjS+e8CFcw/V/XZ9Yq4JrZOfKQYxlzHm4/22cVSHC4kNh EbD+dEYL298pOEaYYJOcxTTMAHqvu6U7oAz89iW5h9Um4dWN3ceCnygSC8X/noJxTniP 1T97lDu72FlvAl4vtm6ZbAdmWtV/fKb2OzIFV+wQPyVwV5QI78tDlDuCB2mmtql1hmg/ 7fBMTwXCnEmkCFGLAy55daobFOITA4hxzSZRftnoWb7EwL23Bolb+OL4PycoEXDBWHjo 5sBuEkgN19zSic0NFIAbAFAaKT7QPOu+r8kzPGCpPbNZfKTCeezgrU26I169sIICq+H0 kh5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SkGi1YlkpzrNgkK7fsGdO+nBxolzeU4HsB6lcpcl19k=; fh=/es+06t7bKZ0k+5A3Uo6K1VQQ8quI4hD/wpkr3JEZVk=; b=dWX2pSKmwdMzUR5g5YNlM+7USEH2CnUA3pv5+bEvagm83tkGU+aObpMp7A1mUHsVjx ruMK1myqJr1QEmempi9pV29Ww1HZgX6rVSPzY/hJ9UH2IJK0AKi85tnnqFQ1xfs3IbpO 8+ZaW4BdCIdUrIKT63xnaH74PnGW55xEZDS82IBzL5siKm2bYBS0jwV3t/3t2lzgrW7S lpTQvHztIiLO1isOOdqtyKQatnorEJteyITlZgMF2chEptAcdoATTlXiVwH5u83pl91X uQO4rX+1VvWuBt1i24T8d/UjSXg1jtYH8THuFhCn7C01/TYiHVg+UJ8jBMilqYq0Wlf7 3VuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="f/hD+jRm"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCUEH1ROtBOspJGDAiHvpywS8z3vQc+2/JkJuiQzqU1MvXv1kvYLnbLEu6peI9SmEhOP/NeL8G87RQPoayafvzCGa2AUeCODP83L/MV8lQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w11-20020a170902d70b00b001d5457db81dsi813017ply.649.2024.02.12.14.10.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 14:10:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="f/hD+jRm"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8FAE7281985 for ; Mon, 12 Feb 2024 22:10:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 088064DA0A; Mon, 12 Feb 2024 22:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="f/hD+jRm" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD3854D5BA for ; Mon, 12 Feb 2024 22:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775818; cv=none; b=WsiVm9OAtf/3vhKszq2b1xUYoe3ijZujztwlhOFFqiTFX2LEsC8nmQsaNmbDsLbNOvSbwNJjXQUFlYnRG5YD1KWtv6N/CgB8Trd4pZDrUGrYURbvBQw0EqBSwuDa10W4i7qZd3qodRbuUrK/U5mtNd0gE9f4hAwN8i1D1L83tJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707775818; c=relaxed/simple; bh=x2dB2HwYcw6FEFcyt88gNSz8C4rxKf1AxqpiQ+NBli4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UrKPn9SE+IFQNkWI2W0ypKQsQq/ouhJQX58uWOM+IZnYFwIbiww1uiAVyUO0B0B1+qXGx2eouAOoIl+JF+eJYcn+GJhn1lHgfbJ+kcFAChqZejRWeh5chhYbthk0com/yLo7fHUumr3n5tez+FK4n8jvR6oMK5ksr5t+z0JRHTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=f/hD+jRm; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e09143c7bdso1848255b3a.3 for ; Mon, 12 Feb 2024 14:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707775815; x=1708380615; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=SkGi1YlkpzrNgkK7fsGdO+nBxolzeU4HsB6lcpcl19k=; b=f/hD+jRmmD/nslR6LOtigo4QXPAJUg77aKa0j8xZ6fJ+CLUWVkHvb1gZf5oN8WqpPg dE6jNHmvvmbX4CPhzwJqU1rqN1Vu1cTaDW4hmAZb8bNPcTMzPNdvxcvcA5FSeqzyt72g KlBKpWvqMHamP/P8cqIPHy2pvlpoEOQcPKstg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707775815; x=1708380615; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SkGi1YlkpzrNgkK7fsGdO+nBxolzeU4HsB6lcpcl19k=; b=GCRomd/HcA/qnCQSbnWkYW3sw+Iy7P08zMPJMfbR/D6TrCsVMi8klszmjMYlT9GJPX Q4du98GJQb3c6zBaIv7xDmSXsOhhrMw782YqvWSrpdkudP1pltrSErcIB3nPI3G4ctSD mgqki3X06TTd2VDQCVDkQqQMWfxi7LzJUym4cs4QBk2pymsIXyrhE2OHNcRtkR1INX2x sZzk394DOqjzedtRpJu6r/9mNcsXgZA6Xh3lEv4FioFYnNRZK8c7Wdn/NVfBoeOZy4Bd QHUnXufncxvAyX1ZSmWZltxZKck87Aap2BvspvErIQWLWN7iVa171IFbTVreymqVsZiN MTzA== X-Forwarded-Encrypted: i=1; AJvYcCUMy5sdzSBUt2GdYwcXZi4y05qLCOCEqyDENd+l7US6HCoM3+eKjsx3vje9OIru27d1/WNKLY8WoKe5NxexKVXdfgXbKN06ZDGTUrIE X-Gm-Message-State: AOJu0YzQyIqVIkugO61kgWI1kccS5aKCD9cleVKfamS/kNkbfAAciYq/ nAGFxnnI1Gans70A83ojzYtbCMmdI53AsVZ7FmdSnGqEweS9Snhoh2sMed2gpg== X-Received: by 2002:aa7:98db:0:b0:6df:dde5:6029 with SMTP id e27-20020aa798db000000b006dfdde56029mr6510317pfm.19.1707775815028; Mon, 12 Feb 2024 14:10:15 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXOM1Q1oyTIbMIm3/8NgYuKUVkfTyBovJtGCm92Dn+6W/OCl9Nrv/9i724olnZ5KO3Fz5WtaYNAxg/AWzfjP4i6FjATD/SDxSr/7MuS07SgqtcyB+KBkjG74OXwCYRnrUCULqm/FS1x+sDsfAtu5s6Kk9iGqitIj4DucCWD8+Hl7h+hD17lQD7sNGOUbVALXnbpIsgXE+6k9TNDm2VZqP1caSvISBQNoE5caPtC23Ze9Rpx+Gy1DKQW6uVG8x/pp95bOikO0VDHbBRFvlHuN1wOhy02IGklmdfe4h55X03v7DqS+SOQ/623AhBZyVQ31lQ4xSd6Qt0Z/YpxMLduBeenZOufyU3HUaY8oQjZb7JQQIODmDHwUbepfiMNs+GFKMo6YmScsmqReF1sHoBGSpV0Sdv/8rYGdPSMZG1XpAooQEr++lm34XyeYmZKniSFeLuTEEq0bYTHwevd/8a3xdOwtmuY+OrRGw4OipMEe1qbiuJDEtXWuFvwQ2gseYYcqX0Mmb5sma7UrIoA78CngK185TpVFMCib6jjPZmKaOU5oWUrMVPwtChDDSkb/8k0l8hdSdJyz+tcq0aiBX6NDtWHVtFZ16gGOHy1doeBfWMHyKWwFsraOU1+xUE6dqPg+aliI9BzB7SiLIDJ3fOw4wmqBnXROPnqBVbHUGPrLJvvvEwsBbfzcKgjdtOHKHfJam1UoC1057u35AfN2U4nwohU6ExKIcdFgnYFlt+7gwEzYI96N9vuVVfFr6cGfdoD5EdsOJ4yxoeWOQ== Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id z10-20020aa79e4a000000b006dae568baedsm6042528pfq.24.2024.02.12.14.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 14:10:14 -0800 (PST) Date: Mon, 12 Feb 2024 14:10:14 -0800 From: Kees Cook To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Petr =?utf-8?B?VGVzYcWZw61r?= Subject: Re: [PATCH v3 04/35] mm: enumerate all gfp flags Message-ID: <202402121410.2AC4CACAE@keescook> References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-5-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240212213922.783301-5-surenb@google.com> On Mon, Feb 12, 2024 at 01:38:50PM -0800, Suren Baghdasaryan wrote: > Introduce GFP bits enumeration to let compiler track the number of used > bits (which depends on the config options) instead of hardcoding them. > That simplifies __GFP_BITS_SHIFT calculation. > > Suggested-by: Petr Tesařík > Signed-off-by: Suren Baghdasaryan Yeah, looks good. Reviewed-by: Kees Cook -- Kees Cook