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 F06CBC07E9D for ; Wed, 28 Sep 2022 01:46:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E7D68E0110; Tue, 27 Sep 2022 21:46:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8957F8E00C1; Tue, 27 Sep 2022 21:46:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75D438E0110; Tue, 27 Sep 2022 21:46:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 62D528E00C1 for ; Tue, 27 Sep 2022 21:46:47 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2FB07160D06 for ; Wed, 28 Sep 2022 01:46:47 +0000 (UTC) X-FDA: 79959805254.04.344F009 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf20.hostedemail.com (Postfix) with ESMTP id E9BD91C000D for ; Wed, 28 Sep 2022 01:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664329605; x=1695865605; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=wKxma6gGKHcNExPVyGZahd3ehBcvdZoLL+UplMnLgpo=; b=fuDVg8iT0NNue4yUeZ18R/J5HLeuuuTUOoREuB6eqaX8pvqjv9mQwEqu 7dShvkExCWlzjEihsMwREj9X2jsAqASiCBMpRpDqNDwN968MZnhxXYaQG AmA8E/z8uo/npqzQbb7W+tCuqADnojsGbB0xei1cIdE+rib/J3zMOlnBv p9jCy9v3aV32544nfExYSFvvH7EKVQQcSQHOpe6KifM8380HOA+0B7ZEj W5bbtBAsjk4dYVGAiPgROGk8p11dHmWQDFE3UDBrI0oYOfwuRujf8dzmp Sh+qAHaO0kvzuMjHF0QAg9XNeRaovgL5nA+1XxOe+R9uaYLAnRXJoUymL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="301455083" X-IronPort-AV: E=Sophos;i="5.93,350,1654585200"; d="scan'208";a="301455083" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 18:46:37 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="747253258" X-IronPort-AV: E=Sophos;i="5.93,350,1654585200"; d="scan'208";a="747253258" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 18:46:34 -0700 From: "Huang, Ying" To: Bharata B Rao Cc: , , Andrew Morton , Zi Yan , Yang Shi , Baolin Wang , "Oscar Salvador" , Matthew Wilcox Subject: Re: [RFC 0/6] migrate_pages(): batch TLB flushing References: <20220921060616.73086-1-ying.huang@intel.com> <477e50ab-9045-0ca2-6979-e2dca71be263@amd.com> <87bkr6jzmz.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Wed, 28 Sep 2022 09:46:01 +0800 In-Reply-To: (Bharata B. Rao's message of "Tue, 27 Sep 2022 16:16:42 +0530") Message-ID: <878rm42rvq.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664329606; a=rsa-sha256; cv=none; b=Uwe7YBkAUgkNU1Api57opOzNkWdE3xdVZeTBb/aUZvSlPYF0jTplLAKaQ2mrGqBAAjQxXu kxDT3zCylnVghQ2Krl35uiqERHV5DzzHGKsualhDa0ZxnJ4iD9Rjx7wKtvX1l+3VA4C5fq m8iIz/eE1Dr8yn4aOnjjRY3i4oBgSw8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=fuDVg8iT; spf=pass (imf20.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.115 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=1664329606; 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=7ya9RdAvYcvadd3LAAYLlqGN4K6akiLEATDLusNZDcI=; b=CQSC5ANrF7OV427Spcg9WAM8871wfpjEwsPzzaAi7RgvytXQOwvCYSXOliMbu1Ay49I5+/ UTLNqXQMcQECvyY7ZcxxHIoASjjtb2H6G91YYFyNXQtHQaixZ4eSDicNFeiPvECEve/fVZ 4aGmS5gjmaFrCaN+UBwQfq6+Ngo8U2A= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E9BD91C000D Authentication-Results: imf20.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=fuDVg8iT; spf=pass (imf20.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: ufwa6osufgrdywj7tpwjcg4qzn6ijs6p X-Rspam-User: X-HE-Tag: 1664329605-848385 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: Bharata B Rao writes: > On 9/23/2022 1:22 PM, Huang, Ying wrote: >> Bharata B Rao writes: >>> >>> Thanks for the patchset. I find it hitting the following BUG() when >>> running mmtests/autonumabench: >>> >>> kernel BUG at mm/migrate.c:2432! >>> >>> This is BUG_ON(!list_empty(&migratepages)) in migrate_misplaced_page(). >> >> Thank you very much for reporting! I haven't reproduced this yet. But >> I will pay special attention to this when develop the next version, even >> if I cannot reproduce this finally. > > The following change fixes the above reported BUG_ON(). > > diff --git a/mm/migrate.c b/mm/migrate.c > index a0de0d9b4d41..c11dd82245e5 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1197,7 +1197,7 @@ static int migrate_page_unmap(new_page_t get_new_page, free_page_t put_new_page, > * references and be restored. > */ > /* restore the page to right list. */ > - if (rc != -EAGAIN) > + if (rc == -EAGAIN) > ret = NULL; > > migrate_page_undo_page(page, page_was_mapped, anon_vma, locked, ret); > > The pages that returned from unmapping stage with -EAGAIN used to > end up on "ret" list rather than continuing on the "from" list. Yes. You are right. Thank you very much! Digging some history, it is found that the code was correct in previous versions, but became wrong for mistake during code rebasing. Will be more careful in the future and try to organize the patchset better to make it easier to review the changes. Best Regards, Huang, Ying