From mboxrd@z Thu Jan 1 00:00:00 1970 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 4E38BC636D3 for ; Thu, 2 Feb 2023 23:19:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1C326B0071; Thu, 2 Feb 2023 18:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CBA16B0073; Thu, 2 Feb 2023 18:19:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 893396B0074; Thu, 2 Feb 2023 18:19:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 79BD36B0071 for ; Thu, 2 Feb 2023 18:19:31 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 54A891C6949 for ; Thu, 2 Feb 2023 23:19:31 +0000 (UTC) X-FDA: 80423920542.25.64EC760 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf22.hostedemail.com (Postfix) with ESMTP id CFCD7C0015 for ; Thu, 2 Feb 2023 23:19:28 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Sf4lvK+Y; spf=pass (imf22.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675379969; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZhQMwz2saQCibfkGRo0jyWoEY6amZtqoVIN90zr0RV8=; b=DRG3RzYNplw8pGt+5onaDd7E3oLcJxZkBURQo3vtEmjHs+a2WrjSNvrnzgUsi8fbchtBom ZnPcCA/GF7RaTE8ny2Ak4Kst01xo2AJ0Z7O5rjDzyp5p6Y2wT2Yg1lQFzJBFVIznjczsiT Hn2EGGKLE3Xxz9uGc6shuQNEVLLl/WE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Sf4lvK+Y; spf=pass (imf22.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675379969; a=rsa-sha256; cv=none; b=ZOLeO1ZapbxoTMi6HUCpeeI2RwHe35OlQaKMQzTiERdawqryKdoYetXx+CYpv6d7RsUfXo /qNMODsdAYvOY+cx1d8EV5SJ4Ly/3k7NhYBMM1jjAmNz7KT1xvwDYEp/w9hmQEkf+2rRx3 M2FFFnP00mVU3LrAaWr+9glgLD6APYw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675379969; x=1706915969; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=lWJAn9td+PqQHkfIKEwTLnXZUHyzgqPba1YnkuIyk2I=; b=Sf4lvK+YOH1lFGh6RAZUs2qT9pG3XPCvGyCJKalwN83iAtLlQRDb72C/ JNRGxcEDBVAvvxMQdrT0o+PzXF1gLHD/X06jaoWxQ2vxZsdPEHhsKSy9f OzOrG9mh7DEF3iexwTZ2nixkP0ZYx8zNWhtB6XkLv7Wl56XpvZWJ32QAX PFMw7b3lw3hnBQoHikFBaU06OwoMuIhX8V35AW1zSn9Vti/QuyZHj4veY kKl0VhhCtgrN7WixllBj5EkAsXWa85b+d9kMaCMVT5+3DM6v4+cEm2R9L UcK94IOrmih1U2h5nwVXTz6R3S4UqLogwyfBXSXcV3X0CGq0uBXHIA/IG Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="316595184" X-IronPort-AV: E=Sophos;i="5.97,268,1669104000"; d="scan'208";a="316595184" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 15:18:16 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="615484463" X-IronPort-AV: E=Sophos;i="5.97,268,1669104000"; d="scan'208";a="615484463" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 15:18:13 -0800 From: "Huang, Ying" To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Zi Yan , Yang Shi , Baolin Wang , Oscar Salvador , Matthew Wilcox , Bharata B Rao , Alistair Popple , haoxin , Minchan Kim Subject: Re: [BISECTED] first bad commit is c203c6d5b3f0597 ("migrate_pages: batch _unmap and _move") References: <87h6w5othj.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Fri, 03 Feb 2023 07:17:14 +0800 In-Reply-To: <87h6w5othj.fsf@yhuang6-desk2.ccr.corp.intel.com> (Ying Huang's message of "Thu, 02 Feb 2023 07:28:56 +0800") Message-ID: <87wn4zmzd1.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: CFCD7C0015 X-Stat-Signature: 6j77q55cmpdzpz5riiyuhatdhtcscgy9 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1675379968-70825 X-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jka/bp7ZAldFmlL85jeFG0feNFw/IPQTTCQ5d37DL5oD5nUjCDP9y+n+KRpPnYUELENcDjyD1HVfVr7o5HAF06+dASZUOpjbnTGiLsMquXqbBIiQt/WbIKxhrZn1zll/5JzaIATvlarV6289/eWGIi2WZgOjMjzYDCINph0Y9aw6xVbjOjxnL0D+isbUOjSwljQfjBfPShwC2kkMVG6AO+LjMD4RoOvdPV8Y2L5uyoLlRUGFW/OLEsJ3zPEGltceIbhwBRtGwD9zw6r9jMLEyqIAnKsUi/jOqtw9Bh/homhHPphclJXwzUbBQJ80/YGH47lwDU= 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: "Huang, Ying" writes: > Hi, Hyeonggon, > > Hyeonggon Yoo <42.hyeyoo@gmail.com> writes: > >> On Wed, Feb 01, 2023 at 01:09:10AM +0900, Hyeonggon Yoo wrote: >>> I've observed random list_del corruption on mm-unstable, >>> where HEAD is commit d69862e693c069f4 >>> ("mm/migrate: convert putback_movable_pages() to use folios"). >>> >>> The issue can be easily reproduced by stressing MM multiple times: >>> stress-ng --bigheap 0 --timeout 300 >>> >>> The compiler is gcc 12.2.1 and config, dmesg are included as attachment. >>> I will try to bisect but can't promise quick resolution :) >> >> >> The first bad commits appears to be: >> c203c6d5b3f0597 ("migrate_pages: batch _unmap and _move") >> >> the first bad commit _probably_ be earlier, but this is quite >> easy to reproduce so at this point I think above is the real bad commit. > > Thank you very much for reporting the bug. I'm in travel now but I will > try to find some time to reproduce and debug it. Still haven't reproduced the issue. But after reviewing the code, I found a bug in the code, which may cause list corruption. Can you try the debug patch below? Best Regards, Huang, Ying -------------------------------8<------------------------------------- >From a4eef847fe4f6e50b6c3f69651c1dfdeb4b23bc4 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Fri, 3 Feb 2023 07:12:24 +0800 Subject: [PATCH] dbg: fix list corruption for -EAGAIN --- mm/migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 143d96775b4d..4205a0297ef8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1230,11 +1230,11 @@ static int __migrate_folio_move(struct folio *src, struct folio *dst, rc = move_to_new_folio(dst, src, mode); - if (rc != -EAGAIN) + if (rc != -EAGAIN) { list_del(&dst->lru); - - if (unlikely(!is_lru)) - goto out_unlock_both; + if (unlikely(!is_lru)) + goto out_unlock_both; + } /* * When successful, push dst to LRU immediately: so that if it -- 2.35.1