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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19F41EB64D7 for ; Mon, 26 Jun 2023 18:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbjFZSrr (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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)