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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCDB5C433DB for ; Thu, 11 Feb 2021 14:10:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC51D64E92 for ; Thu, 11 Feb 2021 14:10:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC51D64E92 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2DDF46B00F4; Thu, 11 Feb 2021 09:10:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28F2F6B00F5; Thu, 11 Feb 2021 09:10:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17D7E6B00F6; Thu, 11 Feb 2021 09:10:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id F27826B00F4 for ; Thu, 11 Feb 2021 09:10:02 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B3D52180AD802 for ; Thu, 11 Feb 2021 14:10:02 +0000 (UTC) X-FDA: 77806171044.01.jump52_340f6f927619 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 96A93100473C7 for ; Thu, 11 Feb 2021 14:10:02 +0000 (UTC) X-HE-Tag: jump52_340f6f927619 X-Filterd-Recvd-Size: 2849 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Feb 2021 14:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Id1rvYTl6OU9FX0z5Yd573l7tF4Bgejp/fPk91EVH/c=; b=S7pdJ9ns6qMKUu6eNpgc2ZbeHn Itf69hnjbyHpRZRwWeZIgENy4xl7cCFrvswYtM4My5Un9ipLEHMHBD/PYRBnVIbNbDSaUfwW75FTI 9RpIXQwnnV4yadb8Xdhu/TJxaBDtK2G0stoiq2FtXNQ+DKppMGjFhhRebSOdZrYDTH0F+h92gSzN1 n6Dtvl9owj3Olb6XDJb6Q3Ef7tA2dwFRZgW9bJxs30zmKXvIgRIT47Mkyz/CMlTFNibUczP6RK99x fVlSCs8NSAjl4Lg5CllXXi5zgmYTq/hYkl+ELdK/YWHRZ2/ayVjakIH6114aDA0cxmrfUxTx4NYB7 GUOuHIvg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lACfG-00AKE2-Tu; Thu, 11 Feb 2021 14:09:51 +0000 Date: Thu, 11 Feb 2021 14:09:50 +0000 From: Matthew Wilcox To: Chris Goldsworthy Cc: Andrew Morton , Alexander Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Minchan Kim Subject: Re: [PATCH v2] [RFC] mm: fs: Invalidate BH LRU during page migration Message-ID: <20210211140950.GJ308988@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: On Wed, Feb 10, 2021 at 09:35:40PM -0800, Chris Goldsworthy wrote: > +/* These are used to control the BH LRU invalidation during page migration */ > +static struct cpumask lru_needs_invalidation; > +static bool bh_lru_disabled = false; As I asked before, what protects this on an SMP system? > @@ -1292,7 +1296,9 @@ static inline void check_irqs_on(void) > /* > * Install a buffer_head into this cpu's LRU. If not already in the LRU, it is > * inserted at the front, and the buffer_head at the back if any is evicted. > - * Or, if already in the LRU it is moved to the front. > + * Or, if already in the LRU it is moved to the front. Note that if LRU is > + * disabled because of an ongoing page migration, we won't insert bh into the > + * LRU. And also, why do we need to do this? The page LRU has no equivalent mechanism to prevent new pages being added to the per-CPU LRU lists. If a BH has just been used, isn't that a strong hint that this page is a bad candidate for migration?