Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp949789rwl; Thu, 10 Aug 2023 04:22:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFo+aF1UyzBrs3PJFFmH5g3XVXmS/JE0gc9qeo3UEQY93y5gNTg0oe9GBndUzJuL6qrlGT2 X-Received: by 2002:a17:90a:c7c4:b0:268:22bb:f0d0 with SMTP id gf4-20020a17090ac7c400b0026822bbf0d0mr1519345pjb.7.1691666572008; Thu, 10 Aug 2023 04:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691666571; cv=none; d=google.com; s=arc-20160816; b=nozOK8wkgBKvNJONsytkTYRjHIf1bL367dye/mLVBUD7ejOA1OlmtYiKUIgz0ya4vv 9s8GtIcZR95tH2YL1v3ka3FpHYCIGNqa7apAQUoY2tnzLslnB7zK8vpgBvG9Rmz8ifHm uL3B/KIMFIDjk9ekQlkJJ6JNWRP1ccb9DNFiB0lStam2RZy5GvfF+d7E/yifTYkQPJsH hlqCH1Usf7xDbcIZa3++z6p3rYiJCn/X80qg/AE4r71wYv2HLsE/OdCM9L/ldWqKbmGn uZi7iOZKdFFQycChShZpyS/TSnaJPl23i0JeEQRETfkdqP3kLZoQjsKCzpMkLa+frZ7E Dxsw== 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=tGkLyhqRoLFRVJQK/UkE7fnuWiZcJWw6rG3njlxfxQ8=; fh=zAye7c7ps62QTmf1feZ2JuOGQJ4xR26oSwWHmWAREGw=; b=j2X3QKMLi378KLSXnJLXBLgbYD8O8lrGejr225bQTrVQtdKSShCWzOQSsvZIbvcU9j NamfEjwNikUvwTaEMfeagUkK8dSL6Th6pUgCFvAIVCIcDa/RPFklmFcg0Zdjl9ULywyD 2LOi2+eILDD/zfa5jfi6VeSN1FSpfChqwfPB+L5aMtiuwT9wQ+8iUWkyYQa2rfo2AxuV 4cLheUjVnKIOS/86eD6FWJ+ywapdbEB2eNwm09dZO/w74XMYZOsKtQ58f6CrwGlhrNYb 4l+I889dprWGk+ARYh5D7Y1I1cIY2W2aa7bmDzhvziB4oKFPCl59PHvkNPDk8wsTtQri cyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aOqymy5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds1-20020a17090b08c100b00265ca1c461asi3458313pjb.175.2023.08.10.04.22.38; Thu, 10 Aug 2023 04:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aOqymy5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233872AbjHJKgo (ORCPT + 99 others); Thu, 10 Aug 2023 06:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbjHJKgn (ORCPT ); Thu, 10 Aug 2023 06:36:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0DAEF2; Thu, 10 Aug 2023 03:36:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E3FD63B15; Thu, 10 Aug 2023 10:36:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50214C433C8; Thu, 10 Aug 2023 10:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691663801; bh=7STLk6rer7/WorIAWuagccGXb4zGN98HldySsPD3+No=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aOqymy5dDQqmV9rwAQp+pXXD+NaZr6GDNhX/UT9tK6WVqRjj4OV9iyu4J9kCV1Qlj WN0MZjoZ0V8KAyYHdK7UwKO+kpDIWABFo7rM/yqA5kM59kTLHBSujtWEJnFKLnXsj9 x9Xk7/lFdAFfAbq+8aCLM8F6CHBJNVoTjKxpqqavQuyBpsV+7kAaF/Eipd+7fe56T6 QmO40r3DpfMHZ+Puz+zSCSv0Lh3nv9qtY1mo5pxYKe3VRalw8FgcQcVETvdhtS9ktO VtaRip1Aa2lVui1QNDmC0JIxMOUS4sjhCqNOYPcrnjjf/mvHQV4EJynaV3zYlSu3yt j3IfyzHH8EReQ== Date: Thu, 10 Aug 2023 12:36:38 +0200 From: Frederic Weisbecker To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro , Christian Brauner , Matthew Wilcox , Christoph Hellwig , Jens Axboe , Dave Chinner , Valentin Schneider , Leonardo Bras , Yair Podemsky , P J P Subject: Re: [PATCH] fs/buffer.c: disable per-CPU buffer_head cache for isolated CPUs Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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, Aug 04, 2023 at 08:54:37PM -0300, Marcelo Tosatti wrote: > > So what happens if they ever do I/O then? Like if they need to do > > some prep work before entering an isolated critical section? > > Then instead of going through the per-CPU LRU buffer_head cache > (__find_get_block), isolated CPUs will work as if their per-CPU > cache is always empty, going through the slowpath > (__find_get_block_slow). The algorithm is: > > /* > * Perform a pagecache lookup for the matching buffer. If it's there, refresh > * it in the LRU and mark it as accessed. If it is not present then return > * NULL > */ > struct buffer_head * > __find_get_block(struct block_device *bdev, sector_t block, unsigned size) > { > struct buffer_head *bh = lookup_bh_lru(bdev, block, size); > > if (bh == NULL) { > /* __find_get_block_slow will mark the page accessed */ > bh = __find_get_block_slow(bdev, block); > if (bh) > bh_lru_install(bh); > } else > touch_buffer(bh); > > return bh; > } > EXPORT_SYMBOL(__find_get_block); > > I think the performance difference between the per-CPU LRU cache > VS __find_get_block_slow was much more significant when the cache > was introduced. Nowadays its only 26ns (moreover modern filesystems > do not use buffer_head's). Sounds good then! Acked-by: Frederic Weisbecker Thanks!