From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 C40B0315D28 for ; Fri, 13 Mar 2026 16:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773420561; cv=none; b=JCF2Fcw/rSC2VDEOKpjJu/IPS4ITvZjyE/DClW3JCHJeNPMkK/Et2BXv+VZKZDoA9Afn/EdbT0zLiA/bTqqkBZtd136h5BcpsvDZJc6TUZ3pNBetTTwVzED6lJWvF7H1uH4ZGD5MhqQ0Wy077wTyB9jjProkpAB+vZoEWX7bOBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773420561; c=relaxed/simple; bh=Fvu4rFLx4/jHcluR8mvL4PiOo3RupiVNDxoPUUpdiNY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EFtWIacE6l/HUO1Z+GssJJgYwfNC9LddRj93EY/d5rLleWLjvZa/eJC8HaqXcov7c7y3ClzqgPdf7Tq29ss3SRvhpn09KKbVagSQaEuRBI+e/96zfFtjpROE0kciYm16/c3lNJWRdPn63+pPC99N9Xr7l0EBNgPXMMny7RTzGXc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=FkSE+ibx; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="FkSE+ibx" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-899fc9853b7so31242366d6.2 for ; Fri, 13 Mar 2026 09:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1773420558; x=1774025358; 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=5OoZ6jFB25D0x8NU02gRfdPPo1/nMY4T6UovZLQVRg8=; b=FkSE+ibx44xTjdz6Klzc/l+h2PnRPwi5Qrxm3vIBXdXu+CHd/vI+fwgnm/QOi6VCoi 6qG+N5JtgDyLwQg8L9UoSXytJig1Q5Y8SfjWLVC58QPVP+piY0AO82l760vtqdOFsHyG tZINB5JPFL9O4ZiVGUiP4RR85OuLKoLkLompk/57Xr+gzMatMxlTqyRI10RiOyWfNJIJ 6rPaeJRz92fkFv9iDKp3m/mXsOJo8u7I6Lr3nvUGQc9kW8kF6PqWLn75lRlfCC/cI3+4 P5ZpDDjjqW1+W3Vii8O455VnNpigcXXoSzI99nRmU8TvObTIOsgtClyOPfPyjuZDvVgC owVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773420558; x=1774025358; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5OoZ6jFB25D0x8NU02gRfdPPo1/nMY4T6UovZLQVRg8=; b=h/xbB09kL1Og/nqOX7eGHIM+NAdj3N8Mh1fhKsmWOkXfsllWCFoFu/O0XjIjmC+Mpg zi/YOy2P3ilLpCCxjJ0O9URDqVSvxQIagh83Gf0v8rswboKUf6mqshIv7p/oZGY6bXZe JeIzaY4lPSbSxaN9rHGQX9JFrIs2+WLQLKHGhM3lfCNOWyWxNptPGRmjzLRyHUxa7kug YiUzu/BVoqdnI/8xRq9AaVdcsjOH4hJNFMrD/lPLg5Ha/a0DcDaDXkBuiE3cCLEWZwyU 9ORWrVX4PfG+rqiojPyrYqnWA1SWF4q7TNpbWIGaDZlIzoftiGS2bIyKo4/V+ZD1RkVo Vngg== X-Forwarded-Encrypted: i=1; AJvYcCU/5mrHH9WO6atNwt61gEro6/M1RU4dWHDu31CWyzAVQj4O2JPyedY0ixm75DfG84CP7vKaeAf831BLCoQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzncX/0MpWq+dzykLpgRxP6gEqRwW2yBfB9kWI15VvO5pUA7hfi wEdkwFTUS1Lmm8HaCz4VPJhkMgr6nPjlNEJa/cE1QyNYVxMrKai2ab7hhS7VnltLX2c= X-Gm-Gg: ATEYQzxVouanJC6E4DLVYxM/ptXmbzdKHDUyYQ0fomVkVH94KkoaoP22jtVf6Yl+VFC ehaNmNtO1SEWI2h0HsTtH4AuJIg6KqJlQMLAZKwDjYWL3Hbm6KQf8yMMWAKVKEOBUJZNaN55HZF vktAN2xcv9Hx4j2l34GtuRMHASK2IaHBuTiklq9iWPAT+TVs3RSsf2Aw8CwNL3GmXxuydody3Xb t0Bpj6DOEvvGmPGmF3t00siql+eV2pNYiqCKRQdDr0mn3Ufh1/KWonz4noY6TQsde9J0DvsxcKD mwLy3mvh38+R4Tkon22E4eUD0AQdz05NbzfBItPiyTjmumn5HYVWPi1ouwEZGI3wnXGWoEWrcSF xfT/ID4BTXjYzjTfGkKJA7Um7uN/uU/WESF0gZhgS2MAhCOQTWvaVuuACcL6bH7GD13UtCsHDYK Fm23iI7FMvWNZWAkNOgJuoFw== X-Received: by 2002:ad4:5c49:0:b0:89a:ff2:b8d3 with SMTP id 6a1803df08f44-89a81f8c6c3mr64520096d6.43.1773420558533; Fri, 13 Mar 2026 09:49:18 -0700 (PDT) Received: from localhost ([2603:7000:c00:3a00:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89a65bd318fsm58816146d6.8.2026.03.13.09.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 09:49:17 -0700 (PDT) Date: Fri, 13 Mar 2026 12:49:16 -0400 From: Johannes Weiner To: Joshua Hahn Cc: Minchan Kim , Sergey Senozhatsky , Yosry Ahmed , Nhat Pham , Nhat Pham , Chengming Zhou , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 07/11] mm/zsmalloc, zswap: Handle objcg charging and lifetime in zsmalloc Message-ID: References: <20260313153434.4074128-1-joshua.hahnjy@gmail.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=us-ascii Content-Disposition: inline In-Reply-To: <20260313153434.4074128-1-joshua.hahnjy@gmail.com> On Fri, Mar 13, 2026 at 08:34:33AM -0700, Joshua Hahn wrote: > > IOW, it's better move that obj_cgroup_get() when you add and store > > zspage->objcgs[]. If zswap stil has a reference at that point in the > > series, then it's fine for there to be two separate obj_cgroup_get() > > as well, with later patches deleting the zswap one when its > > entry->objcg pointer disappears. > > Sounds good with me. Maybe for the code block above I just move it one > line up so that it happens before the zspage->objcgs set and > make it more obvious that it's associated with setting the objcg > pointer and not with the charge? > > And for the freeing section, putting after we set the pointer to > NULL could be more obvious? That makes sense to me! Thanks