Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2180242pxb; Thu, 11 Feb 2021 06:26:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2vJhcBiH4GsB/gGRNX5Yt2PkcLfcBL7iB9eJjPw4f4BbsrMbrX6BX8z+YqhGAcmK1r9uK X-Received: by 2002:a50:ec8f:: with SMTP id e15mr8587157edr.79.1613053613479; Thu, 11 Feb 2021 06:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613053613; cv=none; d=google.com; s=arc-20160816; b=geu0sF1dfqwjHFEo4ph9SyirXUDGX8fMj6a9k9mLfXLg3o/I2mswvR4X1i7IEwUypT BdL1yY+A0X7VqvudDp/vKoqeQrWlmdJ2LC0/wgbgfo2l7AJDjlq2wXSAM0tc+CTIkKKd pHHEnd3x9CKBfabZIuAg8vOXOuEd6w3W9/WFm0CW8t6/ko8cqenv/ZnROF0OrngLSlpj uSoJ0YT3pVpXlqI+nHTRcVimGrzgYQ4JyhqQA/seWkvsH6Hu4DQqKMOUSoAFrxk4gkge CpVhwLp4xIUvlYH/OmVPIi323uBUjHdZ8JWeEyOhvD8arjANmTwX0bra6OIMiWw1lzNv mNpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Id1rvYTl6OU9FX0z5Yd573l7tF4Bgejp/fPk91EVH/c=; b=TY9wtFwEC9jvdYb1ztQooQ70mmLled3/J+LkDySiR5topNS8rua3vkQK9gDbSlmI1t DlLLMlCf9Z2LW6SieHT7JiHNPTeIJMslLKP5X9Fzh2Qv8QOZg//dOT8Eua/bpbVUVZCK 7UPXXbh+/sQ3/mldGeg3Jaxd1nOGZjeKLK89A9/SNwrxLXavejH9bRXNva2PS+hC1wJY AiT2mwwsTLvdkmlzlAwa3DGnnRgThrTjl5+9hMugswrt3uJZZ80aPj7Thb7FAezaOr7X UkNcTWEPysl9DBfcSl+uonQSijgi7Irf2jkDAGbGJ/aRDSJ+GPs7SxpgZ8foPGvjFqzO TIGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=S7pdJ9ns; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si4339659edd.431.2021.02.11.06.26.13; Thu, 11 Feb 2021 06:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=S7pdJ9ns; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232269AbhBKOW4 (ORCPT + 99 others); Thu, 11 Feb 2021 09:22:56 -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-kernel@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?