From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.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 E980919DF81 for ; Fri, 17 Jan 2025 16:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737132471; cv=none; b=MD5a0IQKGwvKRBa7l5gy/2W5TfcG2s56HOhvFfkECo0bELwzplFfm4Bg6P7GOyMjkkGmE/LqgAncwzuT02T6r6xWPsFcWc2GQNqGVhZE/gsqhVEdsjqGdNHcTx+lM86GaMBEYXUgUF+Vb6DxvLrsiYv47BRG1/mK5LxozpSyefE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737132471; c=relaxed/simple; bh=LekiLxjmEZu6e0m+oSb8Ke+0BjTVtML2AjG7Ue6w1C0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RAh5fSldTCwU3mg0gscTiQb2GApho4bnNLGxWP51bq2nqUBu25LV8g/LZTvy4Y+cuFfnAOCzbcVjdHA2nguNcN7okoaHVmxpxzlFLLLDG2TEg0Kl7FXlVmvwgPbqSNmjRajCGEfSarRAMH87rPDCFUhP8qAQEsuENvXKbl5GuVE= 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.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=mbwWs8y7; arc=none smtp.client-ip=209.85.219.47 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.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="mbwWs8y7" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6dcdf23b4edso21447176d6.0 for ; Fri, 17 Jan 2025 08:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1737132469; x=1737737269; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ALV5l/odctAX4u/DDnncfiVwNjPi9uf3gn37R/WtIws=; b=mbwWs8y7BeGELb1nmXASH2VN+KxgwimwV6+VqlEe+rb0khrJ7d8bKOFB8yu4vi1otP j9H7ydlsbHhZCscrI3gV/fSN2p5kfK2RkSU9kcH85EI6FpQ1vjcMh7KSDQgLrSCiAzYa /yFhvcMXkvNVzqASwerAVecv0Rn/Kbp/1Pz9aQQD7vM3aRuJ27tSZ7oX1YrtjvaErxZB fKXCBrAqb30Ykzdhdj2ZGmn0uFdYL7qPRILhPsCvq7ZIs2tkaBMeX+u7pkmQ8miqZejO aFtmVtSRrFpxXsPVkmNVPeg8eY4R77Q3pzOv/DKkGlsO8yymOfZHnYk8+49NtskwYz1M avEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737132469; x=1737737269; h=in-reply-to:content-transfer-encoding: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=ALV5l/odctAX4u/DDnncfiVwNjPi9uf3gn37R/WtIws=; b=Y+Xy4CoRY46e1Ka2q6j9fWFfKMd2VkUAmgjKrH0gUlkHequENWyQbxeFL/B0gwHgQg J+KvMJjFZjRvUvOdrcoQZpyAZBfVTxcVVtDmm1T4QSptX9iQX38Y7k15S1CG5nXRbm99 WQWL/JRX9VeFbaxADnKEyKjA0AtCYbapp4YhytmdH92IbDvAtVgqDYj58sa5kv7QGBAh qZLuFjFckrypOb5MxnzadgjzZMLS21HrjU2WsfmzkYtLIu0vQGrSmgQb0XhD2R16E/L2 W+orNEa3He3tou2FbwSdfdTK7GqMu+9EZQbDMi9jKcDNNVlufqOMuTo/djxShJX5rISd DXOQ== X-Forwarded-Encrypted: i=1; AJvYcCXMZQOSfQl3ySBNAd0B/pkD7DvkeiNVmkg/00K1N8cUZprnMN8VZaETDo3CpS24+2pVr/zak6TY/p31/60=@vger.kernel.org X-Gm-Message-State: AOJu0YxBMHvC6MJ8dCSUZqLYy2WUDGc/HJ9lFreSt5668bdS/npBY7o0 cqeeM6w9dEfDqWCywNArvY6+I0VfK86vtr41J7PI9FU/X8X9KPXPXW3pNBmLC3g= X-Gm-Gg: ASbGnctUow0y3uWAelgluTWobBclrswx+/cXJ0fFUC2fVFhJmCh8BnyxwzVINPOR7/a vOvwrHHyqcM7wnrIH2pzDmy4yrT7IIKUlaaTIyyMJ/Ki66Qcm2V0I85JW7jO2aLtsQ3WlLR8++j xETrNDHA/aqRfSTUMy8gZgpa614Ji1UA1xTIGdga5zNwLfPvD30OWzHhJA63cofvFY7gqKVFkUb 0tCXia6Io+IiBnfg4MLpc5Jw7gge5I6xu+XCgNHxbakFB5FknuXY4Q= X-Google-Smtp-Source: AGHT+IGJD22IumK4sgXeQYpyReO0k61FPPlVycvnYk8ngibV4lTzbMH3JRKUWQsEY2VfnGaf5KWdIw== X-Received: by 2002:a05:6214:400f:b0:6df:97ed:54d6 with SMTP id 6a1803df08f44-6e1b2180604mr62615746d6.21.1737132468860; Fri, 17 Jan 2025 08:47:48 -0800 (PST) Received: from localhost ([2603:7000:c01:2716:f0c4:bf28:3737:7c34]) by smtp.gmail.com with UTF8SMTPSA id 6a1803df08f44-6e1afc117a2sm12960046d6.40.2025.01.17.08.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 08:47:48 -0800 (PST) Date: Fri, 17 Jan 2025 11:47:48 -0500 From: Johannes Weiner To: Chen Ridong Cc: akpm@linux-foundation.org, mhocko@kernel.org, yosryahmed@google.com, roman.gushchin@linux.dev, 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 v3 next 2/5] memcg: call the free function when allocation of pn fails Message-ID: <20250117164748.GD182896@cmpxchg.org> References: <20250117014645.1673127-1-chenridong@huaweicloud.com> <20250117014645.1673127-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: <20250117014645.1673127-3-chenridong@huaweicloud.com> On Fri, Jan 17, 2025 at 01:46:42AM +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 Acked-by: Johannes Weiner