From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCD1E1D5145 for ; Tue, 14 Jan 2025 18:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736879839; cv=none; b=l0L0q8rOwG+LUOl0e3RIw6KmE7Cm0F+3lY0vm0ocJ+VDC3EGSUoD3Zv4VlRvLgvP/hCZzPMQKeEv1tQhEKgIYilqnkrQpAL83PHqkbPPA+OtGWeqrQOPyFwZVOqyH1AA9g3wHnXFMfNYtWp1WbCvyfyH95pxJdH+wXbjxHgUsRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736879839; c=relaxed/simple; bh=89xXIJqIemGMjRBWn5Eue11hzOW5MITJqqjVlG3Rq9s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B0tgQ4ibKmNy35Dec2r/0yznnvGIPmRsdetJWSENGGthsmscNxHuunrPfuFIiupMoNfCyJATOT3ZwL03MzjEBjfC5+XDgTijAK36EjLMcjCbzZYfihi8ilVoXrZQHrmtdlXGdPiERggdlobZKD9mpXAntUDilVGIdWkdi9LLCd0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Hq7CGt64; arc=none smtp.client-ip=91.218.175.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Hq7CGt64" Date: Tue, 14 Jan 2025 18:36:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736879821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uci2CxDdUTcor4Mocplroy6VPU/3I3PJ+VGlYKC6Dl8=; b=Hq7CGt64ZlG4Zrwq3yMhjDi/VU/rIvX+OxVuxjc0cFOU/SHhb3nDqLzoA2d2IpWy/HP6UP U0dBGsFY4I0IJSRQAmvojnWjTjqxK5qi71/kgLNnB7hJPbTYcvS2hKQ6DyJL7nKk4gfDIM 0dQDP+4yS6fk4MC31yJfkaIKWVj6qrs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Chen Ridong Cc: akpm@linux-foundation.org, mhocko@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, shakeel.butt@linux.dev, muchun.song@linux.dev, davidf@vimeo.com, vbabka@suse.cz, mkoutny@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, chenridong@huawei.com, wangweiyang2@huawei.com Subject: Re: [PATCH -v2 next 2/4] memcg: call the free function when allocation of pn fails Message-ID: References: <20250114122519.1404275-1-chenridong@huaweicloud.com> <20250114122519.1404275-3-chenridong@huaweicloud.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250114122519.1404275-3-chenridong@huaweicloud.com> X-Migadu-Flow: FLOW_OUT On Tue, Jan 14, 2025 at 12:25:17PM +0000, Chen Ridong wrote: > From: Chen Ridong > > The 'free_mem_cgroup_per_node_info' function is used to free > the 'mem_cgroup_per_node' struct. Using 'pn' as the input for the > free_mem_cgroup_per_node_info function will be much clearer. > Call 'free_mem_cgroup_per_node_info' when 'alloc_mem_cgroup_per_node_info' > fails, to free 'pn' as a whole, which makes the code more cohesive. > > Signed-off-by: Chen Ridong > Reviewed-by: Michal Koutný > Acked-by: Shakeel Butt Reviewed-by: Roman Gushchin