Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1013101iob; Fri, 13 May 2022 19:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfUxb7CKrHSmqp0RV8Vf4qSfV2n5sXm/gaSq8poAxS8wefnn5hM+TpcuUUwG0wrqmoNWhF X-Received: by 2002:a05:600c:358d:b0:394:8343:a67a with SMTP id p13-20020a05600c358d00b003948343a67amr17760029wmq.189.1652495839776; Fri, 13 May 2022 19:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652495839; cv=none; d=google.com; s=arc-20160816; b=CcvuDpqzeMnEVVZyXSZsYWqMTJxQs+NGuY4FYo2X5rBV70k7iSCU8jsSqlDFafRjUo h6czcl+yfpDzbomIl+pDSqOc7U0eVa4z19eAluUrMLCFV9v9y4wePYFGzsCPuuILxkn/ iuacG1p6QrkASvbd9jawTPlGFVG33QkB0jkkmGKk1L3B6gG0Ej2TVCmX7Acc1abTkdNs DR8QrV3dOXFBYyifRi10y3yj90nyjnDWU1ttqPdZxrxu1DIi2l4/rDKQrbudU+Svky79 zndeldXwIfp6f6WSNKDhVOctdxzEr64cOHSIb4UbvkQYQ3QpovmDpYo7px9lNwopAm1L CnKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=q7wgDfhcuBpXDJtYqE/2ob/s2LnJ7Re+xtCTbFHBibg=; b=OkKVxOT033Eu3zfXuopGxbpkMoTrrhe7pZiOdKiX+0X854i52/QNDsZWZtXo2fMB8t 3jcAs51nRRcawkAvfJ1YHZ59Pbr3EGL7nGoztUo8w4pcf9DboXVymJevP4PXTFX2ZgfA DL37n5dCY6cnynkvB2ow8OW7R7GPNuCyO75wyHX6zkgZ/zMqsjVPcCCa4jIo0AXtQkI9 jvE3leO50cB5GfONXHZdvCN7PL6uuep5FLk/EANrsQdctXX1G1FBjzOGf7DcmeUojhjr HvIaKTCD97wdoZTtBaJat6M3ZourM2Ung9dnro8yD8LlDcWRtwZCEIc/WPftu/6z4oYa ONyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Il8ZJG9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n2-20020a05600c4f8200b0038c77be9b84si9065971wmq.159.2022.05.13.19.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Il8ZJG9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7FBD64F4D98; Fri, 13 May 2022 17:48:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384598AbiEMVBw (ORCPT + 99 others); Fri, 13 May 2022 17:01:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384601AbiEMVBt (ORCPT ); Fri, 13 May 2022 17:01:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B68254993A for ; Fri, 13 May 2022 14:01:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62A77B831DC for ; Fri, 13 May 2022 21:01:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D309BC34113; Fri, 13 May 2022 21:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652475702; bh=K30XMESHglCJLbQuyFBmL05TFQc8cKlakkW76H42nlc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Il8ZJG9tgo+mG6W51u/73e0HJDadPxdS1p8DITFOz144F+OCYHqklMgcUw2adM+Zy BLGfrMgtrDmLLE7GNtTq9f3uwGH2tV4+mcKus8lOKgLCVo05V1UIhgeZ/BuJah8Msb 7+I0nMgMMs8m2K00P/7JlVqCUuj/qRTnkOjwjmSM= Date: Fri, 13 May 2022 14:01:41 -0700 From: Andrew Morton To: Rei Yamamoto Cc: aquini@redhat.com, ddutile@redhat.com, linmiaohe@huawei.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mgorman@techsingularity.net, vvghjk1234@gmail.com Subject: Re: [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone Message-Id: <20220513140141.3b2accfc8fbae08ec4177781@linux-foundation.org> In-Reply-To: <20220513041112.31609-1-yamamoto.rei@jp.fujitsu.com> References: <20220512134945.fe74df5e322b98ae4046ce15@linux-foundation.org> <20220513041112.31609-1-yamamoto.rei@jp.fujitsu.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 May 2022 13:11:12 +0900 Rei Yamamoto wrote: > On Thu, 12 May 2022 13:49:45 -0700 Andrew Morton wrote: > > On Thu, 12 May 2022 13:27:33 +0900 Rei Yamamoto wrote: > > > >> >> Thank you for your review. > >> >> The runtime effect is that compaction become unintended behavior. > >> >> For example, pages not in the target zone are added to cc->migratepages list in isolate_migratepages_block(). > >> >> As a result, pages migrate between nodes unintentionally. > >> > > >> > Many thanks for clarifying. :) Is this worth a Fixes tag or even CC stable? > >> > > >> > Thanks! > >> > >> Thank you for your reply. > >> > >> If add a Fixes tag, I think the following commit: > >> Fixes: 70b4459 ("mm, compaction: use free lists to quickly locate a migration source") > >> > >> Andrew, how do you think about this? > > > > Thanks, I added that and also a paragraph describing the effect of the bug: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch > > > > I assume this problem isn't sufficiently serious to require a -stable > > backport of the fix? > > This would be a serious problem for older kernels without commit a984226, > because it can corrupt the lru list by handling pages in list without holding proper lru_lock. Thanks, I added the above to the changelog. The patch applies OK to older kernels (I tried v5.10). So I guess we put a cc:stable in this, so it gets backported?