From patchwork Tue May 9 22:22:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 13236201 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 83003C7EE22 for ; Tue, 9 May 2023 22:23:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC4026B0071; Tue, 9 May 2023 18:23:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D73C76B0072; Tue, 9 May 2023 18:23:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C62F66B0074; Tue, 9 May 2023 18:23:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B6DF86B0071 for ; Tue, 9 May 2023 18:23:17 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7CD77C0999 for ; Tue, 9 May 2023 22:23:17 +0000 (UTC) X-FDA: 80772143634.01.3B5BF92 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by imf25.hostedemail.com (Postfix) with ESMTP id 1D34BA0006 for ; Tue, 9 May 2023 22:23:13 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=none (imf25.hostedemail.com: domain of penguin-kernel@I-love.SAKURA.ne.jp has no SPF policy when checking 202.181.97.72) smtp.mailfrom=penguin-kernel@I-love.SAKURA.ne.jp; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683670995; h=from:from:sender: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=wt8yOIAnz8UESelFVu95OztmEWYMfRf+ucKeRuwt4u4=; b=IwxWpE540zVUQDNFiCsOLzJplHV6VpDRSmKND2h1i+vvjApoCYCZJF4BoTQWCel+3t8PkT o/xXgceqhJzGbwTL9wcqfluPPQdaBetQfRtpC8rpC1vQ9qroMmur8KEo6h5MlPv9/SAw8E gQk7nvDpZ5JbsROCP08P5B2RANkhz1c= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=none (imf25.hostedemail.com: domain of penguin-kernel@I-love.SAKURA.ne.jp has no SPF policy when checking 202.181.97.72) smtp.mailfrom=penguin-kernel@I-love.SAKURA.ne.jp; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683670995; a=rsa-sha256; cv=none; b=p152dyrwLv87VpAzDaAF4BqEKtbdeEovbsKhSo9tdbaxdxV7vPoOnU6AINQ7iad/UToLE4 2pXVmlEjQbFbpxhckSxCVgLWZr3iFtRPQW3VDqNOTYVkadHdG/HsDxfWXrkfmdhpuyw+Cx pPVqnCGHDhuB2uZaR1pDEzl9v2EmnL4= Received: from fsav119.sakura.ne.jp (fsav119.sakura.ne.jp [27.133.134.246]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 349MMwQI004688; Wed, 10 May 2023 07:22:58 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav119.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp); Wed, 10 May 2023 07:22:58 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 349MMwNn004685 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Wed, 10 May 2023 07:22:58 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <610781bc-cf11-fc89-a46f-87cb8235d439@I-love.SAKURA.ne.jp> Date: Wed, 10 May 2023 07:22:55 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: [PATCH] workingset: add missing rcu_read_unlock() in lru_gen_refault() Content-Language: en-US To: syzbot , syzkaller-bugs@googlegroups.com, Andrew Morton , Johannes Weiner , Nhat Pham References: <0000000000004c3e6b05fb414be2@google.com> Cc: linux-mm From: Tetsuo Handa In-Reply-To: <0000000000004c3e6b05fb414be2@google.com> X-Stat-Signature: 55pn7dib3nfaidr1kqy4yt1t3jr7pfep X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1D34BA0006 X-Rspam-User: X-HE-Tag: 1683670993-407024 X-HE-Meta: U2FsdGVkX1/XTE6gAEVwYDjOUg7BVBtBTV0FzA84LP8r2OUTSGcLWMoole0GvvlOM07+1mcTKKbcJd48vvIQ0mvNXX5w25eOHPIOo4TrQ6nNNEhCFj+meq15pyJUOehzdM+ggeomR6lG6puDztJ/KQ+mgWALDlmy8nFnpVA2QE3y961H5+zCd9tIrpbJ3walQ8hKjyt+qSX48YUrvn2Kb9M2QXcyhszN5c352m31t7Skwu3EI6xrbwWwowZryCtymrIdyrKlRnR2r+ltUNKangddVxUrI7FBYngAC7IWdCqI4SdHCDjF/jKCPvfWtDLFZlBgS3WW5htVO5KJbPrwXQpb/8i39drrDSekDVcrVTnZEVuKgvdczvI1o9i/p0MNGfZ47DD5pRE95JQhrNqV2CN+M0H7OulvCz3u57Jzg4wx8AY2+4wnTaCXMpJZagn2PAd3euq7rsn+eu6dnDcLPi6GSbm7/QvZgWG7th17y0fc1rIV/5QzQxCL3VqQJeh1Nvdb3aRYMi00h6Qc1Cu1WS46O7xkLlUNVBzunSO3F3eyqpcjZIG/s+VagCjYNXO1ed6eW+OeIM0wEkJled8NGunLp9VbGsYvKYAuvq2G3/hHBB9Wy8n48FyRHrKrGFX0sODPqU/Vj0Xzp+QVBZ5vm44Gw4kJw7HUK0mTV/V4hmDRyeNrn7CmQgZiKaYrZLBEZscPCr8rD2gKF7pONcCDofMEqHhZldTLSIDnP/Tt9nbmFRXrULy2/z6aZHh3akBZIplwNq1P6U6hnIQnMyPY8NUbzgJIQ5eyjHCdDATtyV2ZfOEH4OP+EROim6hthApbmO5rtVKHi2km00TrvLVp644pQ5bODQxUJTEDvzuDZioayfUC53BhD0HInAkc8DKnLHYysndcqtU3BJbuS+75AjOR5XEWwToJmd2g2Bk6k1qyiHsP0oQn6ntiONdtbDoGr8KLrb7T+uxqS61/U4F 9CDY4LoN K1bEE4nJ/2zNRm6BATPLEVoRqH13foPKfcYBcEYouMMSa/2ah6/CuyT2ZSjz20KpGIuvokjyB0VYkC+Ldj2mkayVZK3e8a/PIQzdZqOTfJ/HUfjvc61zGgnyCuG+Z2mhmISyuvzZ+wtqI+0jZNjtbd17f5pHbFYu2AspvJZ3BYrI/zh9+U/AM7vis87/jUhWPrhVra59z+MQJeTLckzQZXcUJqSMRzclO6n610yz9pB/pnBKkOkPxlsbnD0qbe4+UnwTshLRqrYXCaCBfU6cKqAKALEnB1BTcvsEadTNGmZ7F4FKRfR1JOrNlZ3FXJM+Y4gT/xwBWA4jmC1Lisrm1qM81WJGQwHG5bEr7rjmh2ZZRGvc79nb5fACgMC+R8gPnDHvnnqpbDNXAcdylnyjuO2rzFcrLsPYsCshkB2/NcaTVkWFSGHeg6JvEauoVFwWOuDljyzvUkIadH3H4my/VpfEB1XQsbP41jLdB 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: syzbot is reporting sleep in RCU context, for commit d66c718d28ac ("workingset: refactor LRU refault to expose refault recency check") missed rcu_read_unlock(). Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=3c6cac1550288f8e7060 Signed-off-by: Tetsuo Handa Fixes: d66c718d28ac ("workingset: refactor LRU refault to expose refault recency check") Acked-by: Johannes Weiner Acked-by: Nhat Pham --- mm/workingset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/workingset.c b/mm/workingset.c index d81f9dafc9f1..90ae785d4c9c 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -303,7 +303,7 @@ static void lru_gen_refault(struct folio *folio, void *shadow) goto unlock; if (pgdat != folio_pgdat(folio)) - return; + goto unlock; lruvec = mem_cgroup_lruvec(memcg, pgdat); lrugen = &lruvec->lrugen;