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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 10AE5C433DB for ; Thu, 11 Feb 2021 14:13:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C23CE64D9A for ; Thu, 11 Feb 2021 14:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231628AbhBKONG (ORCPT ); Thu, 11 Feb 2021 09:13:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbhBKOKz (ORCPT ); Thu, 11 Feb 2021 09:10:55 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7740BC061574; Thu, 11 Feb 2021 06:10:05 -0800 (PST) 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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?