Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp790346pxp; Fri, 11 Mar 2022 15:12:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/5Oy9PfkKk6XCcIO9Lw8hvn6Jny5A2V+OkqLkPy6Flxj4vybjvENiZGbj8bzroptUOOWK X-Received: by 2002:a17:90b:3ec8:b0:1c5:68d3:1883 with SMTP id rm8-20020a17090b3ec800b001c568d31883mr3061117pjb.201.1647040334698; Fri, 11 Mar 2022 15:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647040334; cv=none; d=google.com; s=arc-20160816; b=u9eLOoRsKOBd5jxVJKvkWQ8xlehBkKMsk58wB5aO+vmeoHhpzm9CIZp5sjhvvCcTGU F4O7M6z/Thc3bkDl0ThPMNpQXmAo60WjnUmriC2mFiMx/11qYMkULyxUlBRdEFrIS3Ql INIuTMfYvpvySyp/QGYkjM/GWQEss7fovsBcMnG87mYmPQcmnxB2qoG3Ot0SZOts8yAF jhlLNgN+PjK4AnPWUdO4Oy3dnGydQ6tbMsd8BF3aQvHPRiJ5rez4TqUYPoLXi/ICQBtt b4sxawXsSJUS/Y7wPAmnJpnpnaIL/VQQ877oJKQUpUsykhe0aYgafkiQcObpMy7RGmHc ZSpQ== 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:sender:dkim-signature; bh=pvPyQOUK1Gw9CokGjQgnCkQhkHHplgDsrtGMviZ3X7A=; b=k2I0tiKp6kjtfcipgotoBXU9nPUhMVZ5FEONRYnp6XtmZZIRXP7JUFVsECSawo3taD YTimLDK+VfYaF/QQSSq85CyoOzRkBcw41W8nLLjEWAXAdhQIfZlfG0zu/meGYUGTO04O aOrvBYvZ26Ewj3C5imUK1RzbBDjKgplpUcIIV7FSWY/88qhmd3zv0b7OiQx7zfTQPHdg VOY5l0G1XkoYe2EMyTTv02L1xMR98MNy6mImHps9B/HSs3wd1RybSzSGXpj3pd0a8Z+o T8kF5MZKg0BUMpvGplebcqWuldT8EvCVy4WGTu/2JQHlOHwyAnoD5VlBXeNpGTAWmlfx 5OLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BaBvApgi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bf23-20020a656d17000000b00364bbb2d72bsi9321873pgb.785.2022.03.11.15.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:12:14 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=BaBvApgi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E6442CF9C5; Fri, 11 Mar 2022 14:10:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238821AbiCIWlp (ORCPT + 99 others); Wed, 9 Mar 2022 17:41:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231814AbiCIWln (ORCPT ); Wed, 9 Mar 2022 17:41:43 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39AE712220F for ; Wed, 9 Mar 2022 14:40:44 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id g19so3493483pfc.9 for ; Wed, 09 Mar 2022 14:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pvPyQOUK1Gw9CokGjQgnCkQhkHHplgDsrtGMviZ3X7A=; b=BaBvApgiq6eKkKHjV5y9VNHSX8YDVNOkXj5MayW95Bs0iCadLeVSVrBWCSdznB/PA4 0gKQ2wbaRy7xLMnNrIapT0t2YDCwEkZbX6Z2RsTW+Vxjk9bX0Nl42o76dLzzL3OdIF+b 8qXFqJI1VXyVwT/F93OTri8tbdhSHqlQOdcASY9uXy8RcNqd6XwZwMCNRWhyh2QG/Nea 9XCa2PeR7oijZX6OcHOj3mt6MMzGw0+QbQea2MlyfD7hGKunuDfDz2l+8uzuyyeBH6fr TBk2OQETxmRVJeM0n+PhbCEGu8kAyfbQXYuQNAAZ2ouSFjKQ+gE076+73neyZ7eCz52M wcCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=pvPyQOUK1Gw9CokGjQgnCkQhkHHplgDsrtGMviZ3X7A=; b=iMcOhwtH+Off9uiIP4pGERoxZUFR5Pc/LN/v8KYU8g7IkcUsQR1NiFbd4cAJE8IOjG sxQ8xF//tyc/mhax3I3dFvCrJ1ZMai3+Q/kuse+D19xLUVZM35Itut/Tk6/zU0boS0Qj 91CeWRDm7DB6SODU9+up3vLVIuXwJPO8iaAqpHyCPmSWP+HC5SNqg7F3xibWU6CEebl/ KST59KEZsGb0us5vqdyAEJUkceG7runt/ng7C0GbMEV6oVZJTTBYzgCaGCcstA9sQIU4 SdvmmNohUo3B5J8ndgjLeQOveZ4Q2iyLD/5oBamZ+N5eJ+KM17A18j6iEguTXbqgatRB h9bA== X-Gm-Message-State: AOAM532PE52OzgmBjTz/LqFUawq1NS0ogWSIjIoKkYdicdMgRdf36Tmc 7ryj56MfvAzjYeOmRwMqVvU= X-Received: by 2002:a65:61ad:0:b0:378:8f01:7674 with SMTP id i13-20020a6561ad000000b003788f017674mr1576104pgv.314.1646865643638; Wed, 09 Mar 2022 14:40:43 -0800 (PST) Received: from google.com ([2620:15c:211:201:aee3:831e:b1d0:905f]) by smtp.gmail.com with ESMTPSA id 2-20020a631342000000b0037487b6b018sm3166928pgt.0.2022.03.09.14.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 14:40:43 -0800 (PST) Sender: Minchan Kim Date: Wed, 9 Mar 2022 14:40:41 -0800 From: Minchan Kim To: Andrew Morton Cc: linux-mm , LKML , Chris Goldsworthy , Marcelo Tosatti , John Dias Subject: Re: [PATCH] mm: fs: fix lru_cache_disabled race in bh_lru Message-ID: References: <20220308180709.2017638-1-minchan@kernel.org> <20220309140627.eeaa069daa921dbef64f8970@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220309140627.eeaa069daa921dbef64f8970@linux-foundation.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Mar 09, 2022 at 02:06:27PM -0800, Andrew Morton wrote: > On Tue, 8 Mar 2022 10:07:09 -0800 Minchan Kim wrote: > > > Check lru_cache_disabled under bh_lru_lock. Otherwise, it could > > introduce race below and it fails to migrate pages containing > > buffer_head. > > > > CPU 0 CPU 1 > > > > bh_lru_install > > lru_cache_disable > > lru_cache_disabled = false > > atomic_inc(&lru_disable_count); > > invalidate_bh_lrus_cpu of CPU 0 > > bh_lru_lock > > __invalidate_bh_lrus > > bh_lru_unlock > > bh_lru_lock > > install the bh > > bh_lru_unlock > > What are the user-visible runtime effects of this bug? Once the race happens, CMA allocation fails, which is critical for the workload CMA allocation depends. > > Is a cc:stable needed? Ah, missed it. I think it would be rare to trigger the race considering how CMA allocation would be rare but once it happens, it makes the CMA allocation failure, which is critical for some. And the patch size is small enough so I think it's worth to add in the stable. > > Should there be a reported-by? I found it on my own while I reviewed Marcelo's other patchset so I don't think we need to add my reported-by. Andrew, please tell me if you want me resend it.