Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16599936rwd; Mon, 26 Jun 2023 12:14:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4C0+EdOyqfk24zQDkktYGXaUaDQTQ+Flk6Kni999pebjw1HlI1vFU1mqwRLp9Nx67Z8eXO X-Received: by 2002:a17:907:169e:b0:991:d9cb:247d with SMTP id hc30-20020a170907169e00b00991d9cb247dmr2530020ejc.57.1687806888234; Mon, 26 Jun 2023 12:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687806888; cv=none; d=google.com; s=arc-20160816; b=NupM50zsxwo56ZP/r+0a1dSLEq2PPZ5R3migktMvzJpViGjR8c2tWyozQYfn0CuJO6 5kF0xGQDHDuND1mUGPWuGCqYzDHVIPvlLXAxFNoUTPsOaMwEEf8ddkAbNA5FoQendNui liVEwuGSBF9pjtNonoJo2+SbCgIQiomGUzGfwseGqvfInj9Z8B8PBxyhuLftjGBwSEym 5vYTq3d13vz6AZjW/riidHhzZFCjIWqpXo3gBWub0PBHmjdKRhujsqcwLA1jqAW8IaqU UwLhf77OgZcIt/RcUPSsUesuqDYlfGFP87S4jne8iH6SipZWSV7es6Yp74Fb1Z9Op0Ez 0HQg== 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=XSBS7nnhjCZzBfZehcV6O1SYW8pWHbH7Bqsmx++CeEM=; fh=UZ+PgBGMWfPg1dTti712t1AreOE9soTZWTgevXqlzKg=; b=BDgVd755bBq00CU9w9u4/Wp/zFkC//2rWay4RnQhv1GtbyDgi8hj43EwRCcQrNWv6L fO0Dc9vjCxSzoLlodqSMRnW+Ebkoj7tkyPFqIaaGeJlXk1Lmod/2IISBvyjYLZD2ogSJ w5iQMUWy92G9VU/FQOWURYZwKkoN0ede0MGrFWZZUtgj2SjqI1ydOTXTKJnqO1vABXF7 yOoR5n/5RJmAg0YjZAKIE+Qq76kOi/wZHOY1zGecqu8vKOXyJPUyLWPoiszkGVmN9wLV jool/0qYN3HadxzoqnBzHC9HDLxvDh3Ev3nuzjcUxp0D3/c3KlpbCcvctupVEprC4ObV cBQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UWz5jHfE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lo18-20020a170906fa1200b0098def978d76si2880517ejb.138.2023.06.26.12.14.17; Mon, 26 Jun 2023 12:14:48 -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=@infradead.org header.s=casper.20170209 header.b=UWz5jHfE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232646AbjFZSrr (ORCPT + 99 others); Mon, 26 Jun 2023 14:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbjFZSrq (ORCPT ); Mon, 26 Jun 2023 14:47:46 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D8C97; Mon, 26 Jun 2023 11:47:45 -0700 (PDT) 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=XSBS7nnhjCZzBfZehcV6O1SYW8pWHbH7Bqsmx++CeEM=; b=UWz5jHfEbia2gvWf3/Oa8q2mON jYqy+4ZVuX6lXq/a1ZIc3OBKlnieDNQH1cYpleKNvkbSQPeMCTaXcQ6eJAUM5JHsUI7cr1uB5CYWK 63YsNc2L+MxYPbtJyB7Wjmf5M8xv1+D2TAnkzdjItJEkJA1kEwv3/KILNOGVWoyYcff37IwtEKcXE 2AUMEbUaO7LwFirgHdn5sL7AlgwZGWLEzFiJdzjDzhsIkhkZMGPG28U0escwfKenp5j5lqGJIAuKQ E8+nvkdeVYwFWfmeSww1yI/W4jfhrZU+CJNeYbV2JbggZ96jMFMRsD30F7IMR3Jw/m4EE1W0qpCYf fzajYOHw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qDrFW-001yDe-JM; Mon, 26 Jun 2023 18:47:42 +0000 Date: Mon, 26 Jun 2023 19:47:42 +0100 From: Matthew Wilcox To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro , Christian Brauner , Christoph Hellwig , Jens Axboe , Frederic Weisbecker , Dave Chinner , Valentin Schneider , Leonardo Bras , Yair Podemsky , P J P Subject: Re: [PATCH] fs/buffer.c: remove per-CPU buffer_head lookup cache 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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Mon, Jun 26, 2023 at 03:04:53PM -0300, Marcelo Tosatti wrote: > Upon closer investigation, it was found that in current codebase, lookup_bh_lru > is slower than __find_get_block_slow: > > 114 ns per __find_get_block > 68 ns per __find_get_block_slow > > So remove the per-CPU buffer_head caching. LOL. That's amazing. I can't even see why it's so expensive. The local_irq_disable(), perhaps? Your test case is the best possible one for lookup_bh_lru() where you're not even doing the copy. Reviewed-by: Matthew Wilcox (oracle)