From patchwork Fri Feb 25 15:15:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12760449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC40C433EF for ; Fri, 25 Feb 2022 15:15:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DBE2C8D0002; Fri, 25 Feb 2022 10:15:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D6D898D0001; Fri, 25 Feb 2022 10:15:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5BA68D0002; Fri, 25 Feb 2022 10:15:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id B6D498D0001 for ; Fri, 25 Feb 2022 10:15:11 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 8872F616B9 for ; Fri, 25 Feb 2022 15:15:11 +0000 (UTC) X-FDA: 79181650422.02.D103FD7 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf20.hostedemail.com (Postfix) with ESMTP id DFD7D1C0026 for ; Fri, 25 Feb 2022 15:15:10 +0000 (UTC) Date: Fri, 25 Feb 2022 16:15:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1645802108; 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: in-reply-to:in-reply-to:references:references; bh=XQcCIB/BgIE3sYYr7FuCBw/IBoiYy9McFWIhbMjd23A=; b=TPyOgGka+Lps9k5E+/jHWNhaZZwxy03gDgZXCKFuV7nhaovdqsmi07aQaWn0w96W6tRYfF 1ode+DMVEUaS37UAHb+4ZjmZjpTF6F/64wjprv2lczIHOEPo4pEBEKNzNUvzgU0RftB1cJ wMyJFfLdi4LiL+/pZNd5aGR6KeFl1eIv/aSLuXP07J2VE6/Vbp5TaJZqkWj/cC+1wgvHys sT3Ud7dyKaTdUEpDdCPWtL5RwudTCXuX4wvgs+TgdN/xf1+2DBUK9D0nmB2FgsbmA7z8jc +k12ARhogh/cJHr/eSPPYzcBdUlqOKQ3dKP85asV0d7PHzknSkUtmTxFWTtoIA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1645802108; 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: in-reply-to:in-reply-to:references:references; bh=XQcCIB/BgIE3sYYr7FuCBw/IBoiYy9McFWIhbMjd23A=; b=bcZAp0a9QQrLodeqKB/SipBFgBZK9tos1qlPjD8FH6TcYEFaip5a0lOPCQqezBwlZ39WdE 4y/SYKbqCjt0J3CQ== From: Sebastian Andrzej Siewior To: Michal Hocko Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Michal =?utf-8?q?Koutn=C3=BD?= , Peter Zijlstra , Thomas Gleixner , Vladimir Davydov , Waiman Long , kernel test robot Subject: [PATCH] mm/memcg: Add a comment regarding the release `obj'. Message-ID: References: <20220221182540.380526-1-bigeasy@linutronix.de> <20220221182540.380526-6-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: DFD7D1C0026 X-Stat-Signature: hoybbnh9kojnuysfy6ro97b5zh6iqu3e Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=TPyOgGka; dkim=pass header.d=linutronix.de header.s=2020e header.b=bcZAp0a9; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf20.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1645802110-372853 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Please fold into mm/memcg: Protect memcg_stock with a local_lock_t Signed-off-by: Sebastian Andrzej Siewior --- mm/memcontrol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7883e2f2af3e8..19d4f9297b0c6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3245,6 +3245,10 @@ static struct obj_cgroup *drain_obj_stock(struct memcg_stock_pcp *stock) } stock->cached_objcg = NULL; + /* + * The `old' objects needs to be released by the caller via + * obj_cgroup_put() outside of memcg_stock_pcp::stock_lock. + */ return old; }