Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5021299rdb; Fri, 15 Sep 2023 22:52:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5EOdXS60VKk3fB60tq55ipoV0r6ZTlT6ROm1XOfZFS6Uzy/CeOsphGynnOmTQueT504XY X-Received: by 2002:a05:6358:71c2:b0:142:f0fd:8daf with SMTP id u2-20020a05635871c200b00142f0fd8dafmr3815806rwu.1.1694843527483; Fri, 15 Sep 2023 22:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694843527; cv=none; d=google.com; s=arc-20160816; b=NUt1GDEj/GxPGHvDy6kvj9/vMcV/aE9hpDsh4AHcQP76s+XLTZ8xJIHyZzKRu5LMkD MGQ3sbmjkBw6CW8QSN0IdaikVQr+SbcWIoLbeRCIZNzbX4NusUudeiO5A6TX6TZvx5y9 6o8AbLHAXpZT/U33Q/IO0kKiuTyWjXdwvmTAv3R+pQYfCYkQjxoeynwUTAWa863sXiZ6 T22CiKbZ3xUfB1aQ1QMyqIGfV4mvWqGm0wCkqQY1CFSZ6dlUKqOHJz3w5auDmTVJ7oL5 x043lptDg8Y4Muusmd0g6jYkx1I/6vvQSvO6GiaE5DorV31QK5f3By8ihuU4plXGdJmP Fwew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+5BeJTKQ+1ikY10aMboTw9qo9cYRheGp8DXKbuRu77g=; fh=jqyVLh6bCUdwF76+d1nSsH9gan5yVpKFn6DRJJLnHtk=; b=brdUA8vKh8UGUuBwmoc6VhqEa7+lGi2pUIovwzJxsHYSVjJkGBZ51nb7YKg60nP+IV MH1gbdox0xo6a2qHZMSp7q6/kWVi+vhzNlm2ATpdBO+YXqogrdHxl31T7bhydtNPAVVY 6KnSQvc57Cfb2T8+EyEoSKc+2lllye5FSc7Y32ufzLn9lPwU916F40LNBqSQnkW8WgXH gyZz7l4F/WSWaAX4bisUBdbZYW4ktel+Mx38IOHw2rpf8dYQxizJ9zTPkr9e5L2RY4gk oK30o3sc83gigDYeK/ZjT4Ak9jBwP8fAx5NKCdkpeit9Qg+lhRJwWaBMQUJr5s6vJOMS 7c6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UdLc2GKF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id az1-20020a056a02004100b0056a1ed17deasi4352076pgb.675.2023.09.15.22.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 22:52:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UdLc2GKF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C2AC3805B9F9; Fri, 15 Sep 2023 13:58:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237841AbjIOU6R (ORCPT + 99 others); Fri, 15 Sep 2023 16:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237848AbjIOU55 (ORCPT ); Fri, 15 Sep 2023 16:57:57 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 120EFA0 for ; Fri, 15 Sep 2023 13:57:00 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68fac16ee5fso2401408b3a.1 for ; Fri, 15 Sep 2023 13:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694811419; x=1695416219; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+5BeJTKQ+1ikY10aMboTw9qo9cYRheGp8DXKbuRu77g=; b=UdLc2GKFGvI+Ek1td0zQybW6j6P5quhJ5s7rdIX2aH+2u5dtS0lXjvRInGTYK0GAqY U64H5IuTz0RbI1cBBe1J6t4XMTM+Rnm7F1+K20a3WUAhV+iGZ/x0qN3sOcY3uWlOIF01 iLuvHtJ/n5JYAPpB8bAmuYWWiE5v3fPoYLfhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694811419; x=1695416219; h=in-reply-to: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=+5BeJTKQ+1ikY10aMboTw9qo9cYRheGp8DXKbuRu77g=; b=Lljn8sccKPAOBFgrMKt1NbYbJz6XMAJ1/FiTY7dc8L5bL4UWpvQOCQulKzmODHIgtl XbCAFOVwpbQcD1rQ7wiyeekW0E29jLgf7yldWz4AaYK6pSAFPyJgwcGs25uKuv3Hhym6 /rMAKBPKhKWlPDRmWOQ9qxR6Qaq1Z+Ho9CzanWOOsBvQ0lixap9vs8da3m8OHBNUzkWL 84WYJJuBxnPskhKzsu3zCADKdMox/YBwZbc+zg0ipINnG8RmRxyLGQG/EgAbxaIynA7x 1u1/o6YlOapISI2iWfm6HvAGPhrcFbQ18h0zNXrtlb+MulWnaIbqo/LPVG1Xud79GZGT VDCw== X-Gm-Message-State: AOJu0YxMcUkUom7qQdzCXHvjlgaARtql+VQX1JA7OEkGbaSuIaMYyygR gcgvo/O5PFPDPHjWMqAIVgYEYw== X-Received: by 2002:a05:6a21:3297:b0:133:e3e3:dc07 with SMTP id yt23-20020a056a21329700b00133e3e3dc07mr3739773pzb.49.1694811419599; Fri, 15 Sep 2023 13:56:59 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id m21-20020aa79015000000b0068a6972ca0esm3336769pfo.106.2023.09.15.13.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 13:56:59 -0700 (PDT) Date: Fri, 15 Sep 2023 13:56:58 -0700 From: Kees Cook To: Matteo Rizzo Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, luto@kernel.org, peterz@infradead.org, jannh@google.com, evn@google.com, poprdi@google.com, jordyzomer@google.com Subject: Re: [RFC PATCH 03/14] mm/slub: move kmem_cache_order_objects to slab.h Message-ID: <202309151356.1A6AC69@keescook> References: <20230915105933.495735-1-matteorizzo@google.com> <20230915105933.495735-4-matteorizzo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230915105933.495735-4-matteorizzo@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 13:58:40 -0700 (PDT) On Fri, Sep 15, 2023 at 10:59:22AM +0000, Matteo Rizzo wrote: > From: Jann Horn > > This is refactoring for SLAB_VIRTUAL. The implementation needs to know > the order of the virtual memory region allocated to each slab to know > how much physical memory to allocate when the slab is reused. We reuse > kmem_cache_order_objects for this, so we have to move it before struct > slab. > > Signed-off-by: Jann Horn Yay mechanical changes. Reviewed-by: Kees Cook -- Kees Cook