From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 7A22A44D6A9 for ; Thu, 26 Feb 2026 21:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772142222; cv=none; b=eaKUnkd6gbEGCt4Zo5RBQKq4SecqdcnKrMFVu5gywhr/9fqLgWp4u8Zl4T3PVq8pWMJPhik8DHs8M+Pl97h0ExUWJZe1Kmv4AAWy9oqYZXRmu5Qra+FoOczngO/Ipzyg/iNaf6YVaov8ZF8TVCCYSeXyNGQKqjU7aZwuVBSpsFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772142222; c=relaxed/simple; bh=PUQtaq9IAwaTopqfCjSiC2emBydBs9LXv6eT5EQWHYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mgm8fnI072IGIsm529XaSJERcTsmOQ/69n9fy4+ZXJVpK/d9Esbi3SRyxfoG16BfcmIPEAU3NbOXMqBxgnMD9N9H14dpl6LJT1+Lnr4VSzyV+YYxUO5cy2F+A5OmsAv9MFZNWfcNkc2EIwXJ0TUoIpkvMd64XX1IEc6FY6lPJCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=beH5+mfx; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="beH5+mfx" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-7d18a9d2b1aso1539862a34.2 for ; Thu, 26 Feb 2026 13:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772142220; x=1772747020; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YemIJbaT8kVRnq52OlqB85TuhHJUc8NZS4+MR2RkKxw=; b=beH5+mfxtZKa5bBDMLl4/u0aSUY5JwWKCQfu/C+2MThiEuMDWJ+kCJQzDPJwEKMbGx fMkjr3jJemST9bznnwd58m2+yex4kpDYnEgZWVNR0fVWf7G8dk2WPJYm5sLHEX/HABiL GIWJ0hg/xjPJILNonkaKCtarNw5ltShhuBm5khhfwNEcJkwWNW4PCkH+MMyopVJ1/+xO TcBL8jyViahD4eVvM/my97MZuipSRrHPYyqZvMakHWMDxxL3ZfPeUaIwa2VYRhXz8Xho /A2FlV1MFsuJVlZi8/ikXzA/NM2ZP8JS3BJvZmVgEWwXwclWTcoQThyJutHk4RWKkVDY 3Y/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772142220; x=1772747020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YemIJbaT8kVRnq52OlqB85TuhHJUc8NZS4+MR2RkKxw=; b=cHnveEFHIQLwpBFNICwymIvB14KsBD3pEJ1X1vjJyHjvPYepID53H49NYQXwv0IQzV hEH2fCaj51LlSZXdswMN7Ev9HrUe1lV+D+3Mnx3jz96QfCehShAJeuXAVcs0Pq2b9F8g IxkFd4leRL4WDF1CHHQ7MuEJRM1cBDHqgOk5486fdH0NagHCopNKsp7bXiFCn1h2X5w/ 366SpC7r8o2JftKvwMYzBaFeUf20DR/D5K1Zl7AeocHjm1Xt7iOmCbhXgZBhBOiKAx+R 1NWtCJTwLCTnH9j3tK//F2Zo5CmW7ugS1T7kpsQKIa1xQEe4EZlhfOSZGcpD4yMRQfTf gNHg== X-Forwarded-Encrypted: i=1; AJvYcCUJAzD9hvDoXpXEk+11rpklLCVZpgINbqF8EeMLCm88qpQj4xk2XbCQMr8eNKvrrHlLEVu8Gg4s8IpZeV0=@vger.kernel.org X-Gm-Message-State: AOJu0YxARo5Rkan9NlV8EB21DOLfDb16bBolZBEndhSnCgiogmxYcIuX VVoszQllr6o61BaIEJiF4B7ChUFsBrmJYlNhQaFi2g1S2T0zLXSipMxg X-Gm-Gg: ATEYQzyXPyds0JlmKOtphMVrldiJCncbeJnW1VUHW/NpKp12QgRErKUAVo1Q24yaWpf 10FPXtUYoAZB1Hk8QVnX2gketfT7UIcLPEwCOkO+DfdgfQe0VS6+UV9BX9kZtUffF5/DaiYkqPI CfXbbp/h3X7XkODjZ1hZEUEW+vuzfHip4TlzNGLwmUXL8qHWU93NfLu/t0E/uApucZwqRkIUu/F XAKI0ALrOhi7fY26Z2C6TDzGHDI9nMQo+CgNPhU6GOu1Bv3QXWEP4QmCBIMgrmc3XRaZV3bBzFn FnZIvYnVv+CKiJk/Iz18of/I2P1noOGyTviLw4IY+iKAMTTnX3wNSqJcvrbPd7wgPD1UKzDEWtC vBziKoISVVCkt220ENkGehqI+Iw++dufg+DYJ4pvOtP/eKxKeaZpTzVmN7/xgZr6t8HUZmIruHo 1fUVwbzOd4tPGE17ZpoWuJxA== X-Received: by 2002:a05:6871:8908:b0:415:e487:7f29 with SMTP id 586e51a60fabf-41626ef1464mr483310fac.20.1772142220184; Thu, 26 Feb 2026 13:43:40 -0800 (PST) Received: from localhost ([2a03:2880:10ff:74::]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4160d211b82sm2755448fac.13.2026.02.26.13.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 13:43:39 -0800 (PST) From: Joshua Hahn To: Shakeel Butt Cc: Minchan Kim , Sergey Senozhatsky , Johannes Weiner , Jens Axboe , Yosry Ahmed , Nhat Pham , Nhat Pham , Chengming Zhou , Andrew Morton , linux-mm@kvack.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 3/8] mm/zsmalloc: Introduce objcgs pointer in struct zpdesc Date: Thu, 26 Feb 2026 13:43:37 -0800 Message-ID: <20260226214338.1062367-1-joshua.hahnjy@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, 26 Feb 2026 13:37:42 -0800 Shakeel Butt wrote: > On Thu, Feb 26, 2026 at 11:29:26AM -0800, Joshua Hahn wrote: > > --- a/mm/zpdesc.h > > +++ b/mm/zpdesc.h > > @@ -20,10 +20,12 @@ > > * @zspage: Points to the zspage this zpdesc is a part of. > > * @first_obj_offset: First object offset in zsmalloc pool. > > * @_refcount: The number of references to this zpdesc. > > + * @objcgs: Array of objcgs pointers that the stored objs > > + * belong to. Overlayed on top of page->memcg_data, and > > + * will always have first bit set if it is a valid pointer. > > * > > * This struct overlays struct page for now. Do not modify without a good > > - * understanding of the issues. In particular, do not expand into the overlap > > - * with memcg_data. > > + * understanding of the issues. > > * > > * Page flags used: > > * * PG_private identifies the first component page. > > @@ -47,6 +49,9 @@ struct zpdesc { > > */ > > unsigned int first_obj_offset; > > atomic_t _refcount; > > +#ifdef CONFIG_MEMCG > > + unsigned long objcgs; Hello Shakeel, I hope you're doing well! > Why not just strore struct obj_cgroup ** instead of unsigned long? You will not > need to do conversions when storing or accessing. Yeah, that makes sense to me : -) I guess if we're going to be accessing it with the zpdesc_objcgs and zpdesc_set_objcgs helpers anyways, we can abstract away the casting to unsigned long and re-casting to obj_cgroup pointer away from the user. I was just trying to skip one cast, but I think it won't matter too much anyways since it's always hidden away. I'll change it to obj_cgroup ** in the next version!! I hope you have a great day : -) Joshua