Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2803135rdb; Mon, 12 Feb 2024 18:20:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVzEgJYSqJimTHyF/L5DQ3Cm8gPmu/u2A6+n85AzrMW58NJGYPh9W64TW7PW+WI1t+PjxY X-Received: by 2002:a50:ed0e:0:b0:560:4eb3:7e4f with SMTP id j14-20020a50ed0e000000b005604eb37e4fmr5113881eds.20.1707790839134; Mon, 12 Feb 2024 18:20:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707790839; cv=pass; d=google.com; s=arc-20160816; b=xhPvGyu9Mg1f/9P12m6udwJBmtqiEeMjJ2DJZM9EQWbgvVsCgbrR/7ubYylvFQKzm5 O5TbxSWAabeUMPI0x2ODV7hlIsJGUoJThxytHk1A8CRd/Fb6eTBkzM33fHhYvRG+38eP 05oDv+8tCB8EQPQb0FxL0F6UA5+4X85Qwz5ws3/ZSdG6iP04mpoX3ZIo+RpM/h8r9025 Qpkxuoig0zN23d8iut9qSbQjxO7OKDHLymK40wFdetXMauVUWZDiVis1UlZzITRvfPb3 RPY6Dur4wNtrxGsfQnziqzuGUEFPZle3KdgeZPVQcljs5hHxGL/K0s7wU2xZXce+66Ly iLHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=S9sbRuvYiarABejv+1FZRtHjtyC1exllh7yCDkk639Q=; fh=u1NgeJ9CDMALXsnUdIUuoB4UHXk7XLhttWSGPuJy3KM=; b=m1rOx6SK1kgJY+gptSGJr4sCfpFvebB8Upf9FUTk3ouA2HBzgdsV1V0CPCILNhu6jV +Ftl5rzEfBYHDIO61cyPHmko1JMcNXZIWX6jAaoRFVm/Tbl5RZ4Sn1rTgJHrNTIlcRPi VfNsDaoC2wUt13uMaNo2E+ANnJt1hAGRXwIxDn++DiSAEKCynD6LonElrQk3rbgQIMwQ ZcMGuyUJILhgQL0JisOqsG28gRsVrCBsi5iWABS09pmldPxZYonuRMrwUe70zLSMfLv+ 7gT3pUAu2uBYKQJNbyKfnG4MglvhZVPWXX7gYc9FzGtCGrfHgjEVE7z7/jh3cII5zes2 ONKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4Jrb9xtg; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCXy0D1ai+yfGDb+plSVOD0y9+TodaaETrI+FCBs478PKpnE/rSwQ7xjbiOxxJJdYH1gamimydOqXG9sSjcFE5l3Ains3utKqsF+p+8MHw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e4-20020a056402148400b00560b81d8801si3280648edv.407.2024.02.12.18.20.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 18:20:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4Jrb9xtg; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id DA7181F2694F for ; Tue, 13 Feb 2024 02:20:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 351324C64; Tue, 13 Feb 2024 02:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4Jrb9xtg" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 A73BD17CE for ; Tue, 13 Feb 2024 02:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707790828; cv=none; b=kvhPM4r+Q646MzxHl7N7txU+ZXeAs33BCJLqFNna3PbtF6gY6fz4B9Xo9YKzbmkvvGf+tf4UFiAGPpAv5jEr5CfgB0jCsvzlaeTcW+fYeAveYghZYZqMOnDHu2rlwbBKSrtiwEn1tP7V75u3HiDLpUiSJXUvZl928fLHwq9EPKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707790828; c=relaxed/simple; bh=S9sbRuvYiarABejv+1FZRtHjtyC1exllh7yCDkk639Q=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nbqOT6CuUy6KdX5J/p80Lul4CLLLwq0vNF06NGRcQo59hMNgMvzGViFUE+tf0aBIDsUFtHFJyRHAvqWoUuds5Vh/0WujeY310PEioilMKFkO8xn4O1PzTpslZPlcBI/YH1v1SQqxXaJuRAAGptZSWVXsvivBbvx6cI+iqsgMmAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=4Jrb9xtg; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-dbed179f0faso3416147276.1 for ; Mon, 12 Feb 2024 18:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707790825; x=1708395625; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=S9sbRuvYiarABejv+1FZRtHjtyC1exllh7yCDkk639Q=; b=4Jrb9xtgZZd68Cd8qtWKkms3W8lyscetML+GV9VkniajxjX00oCm8vO3er0J1tOJYG KXV6U73T7/ahxivChBXpV+Epa+r+05A2t154aRf14aPl3XbChON6p22PKWX4U7vAzS9o brwAToX8177IfGEf9W+XIqe1YPvjrVvfL9p54qZ1sWP3PGzpzREqC3UGYZKQKBZySG2k Ww0YUiGkRHSadsneVBJVnVGSj/Fif1gMg/8vv70xOYtj2wcjiPng2kr+bKGBZYgVzATG OKxyy6fQiAVrWs5pOrlgKVY84DYPBwXY7IoUnb6KCj+HNchnZ6OPi4x27n09k46FAdxz ByRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707790825; x=1708395625; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S9sbRuvYiarABejv+1FZRtHjtyC1exllh7yCDkk639Q=; b=QmWSRZbyPLZFwJD7Ci0ghkvXdHwvfDHwfMFwQzc9GU8m20vATsT0380x0W4ff69ugo oJNAkUDDl0D/Enfr3GyQOUjfJvlgK6Vo1yO6xsSWFrM7ePQOU9ViEHAyrbPSAG+54559 VgoOzjnVhZ9DcBGjvPtN3Jh0pCXPYireYxApnPVD21m0O5hxJ+4NMgbAMC2W6cIW+1pg tkwnZucZcYSs+4lWstv8v0r/2L7F/z50CWzjad0EYTHHdeTe6ZFbzVn4Ri9z10BPnC0P gb4q2uxrKVjlDIhKjP6YpyVN+AAgDU/U2blBsgd9sc9i6dvcTWAgjiswBn6aGxAlit7J B7qw== X-Gm-Message-State: AOJu0YxJjGPplsy3U8BlMCpB8HLULTgl3ojz+64BPSL1jYR6PxU+q9aA bYBE+NNndJ6YvUeGgZtih7w6QnPwLrWoo2ddeiXc+bQHDCWdyi646jxuHebSN6tNi4a2rIWiqLA dmK76WDS5V2A2/uG7DMN1zRw4RDDZ0U5cp0ax X-Received: by 2002:a25:df91:0:b0:dc6:de93:7929 with SMTP id w139-20020a25df91000000b00dc6de937929mr863370ybg.26.1707790825358; Mon, 12 Feb 2024 18:20:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-6-surenb@google.com> <202402121413.94791C74D5@keescook> In-Reply-To: <202402121413.94791C74D5@keescook> From: Suren Baghdasaryan Date: Mon, 12 Feb 2024 18:20:13 -0800 Message-ID: Subject: Re: [PATCH v3 05/35] mm: introduce slabobj_ext to support slab object extensions To: Kees Cook 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 12, 2024 at 2:14=E2=80=AFPM Kees Cook w= rote: > > On Mon, Feb 12, 2024 at 01:38:51PM -0800, Suren Baghdasaryan wrote: > > Currently slab pages can store only vectors of obj_cgroup pointers in > > page->memcg_data. Introduce slabobj_ext structure to allow more data > > to be stored for each slab object. Wrap obj_cgroup into slabobj_ext > > to support current functionality while allowing to extend slabobj_ext > > in the future. > > > > Signed-off-by: Suren Baghdasaryan > > It looks like this doesn't change which buckets GFP_KERNEL_ACCOUNT comes > out of, is that correct? I'd love it if we didn't have separate buckets > so GFP_KERNEL and GFP_KERNEL_ACCOUNT came from the same pools (so that > the randomized pools would cover GFP_KERNEL_ACCOUNT ...) This should not affect KMEM accounting in any way. We are simply changing the vector of obj_cgroup objects to hold complex objects which can contain more fields in addition to the original obj_cgroup (in our case it's the codetag reference). Unless I misunderstood your question? > > Regardless: > > Reviewed-by: Kees Cook > > -- > Kees Cook