Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751173AbdFCN5V (ORCPT ); Sat, 3 Jun 2017 09:57:21 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34901 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbdFCN5T (ORCPT ); Sat, 3 Jun 2017 09:57:19 -0400 Date: Sat, 3 Jun 2017 21:56:36 +0800 From: Sean Fu To: linux-kernel@vger.kernel.org Cc: ebiggers@google.com Subject: Re: [PATCH] fs/buffer.c: make bh_lru_install() more efficient Message-ID: <20170603135634.GA18453@linux-zmni.DHCP> Mail-Followup-To: linux-kernel@vger.kernel.org, ebiggers@google.com References: <20161229193445.1913-1-ebiggers3@gmail.com> <20170326033430.GA20915@zzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170326033430.GA20915@zzz> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 29 On Sat, Mar 25, 2017 at 08:34:30PM -0700, Eric Biggers wrote: > On Thu, Dec 29, 2016 at 01:34:45PM -0600, Eric Biggers wrote: > > From: Eric Biggers > > > > To install a buffer_head into the cpu's LRU queue, bh_lru_install() > > would construct a new copy of the queue and then memcpy it over the real > > queue. But it's easily possible to do the update in-place, which is > > faster and simpler. Some work can also be skipped if the buffer_head > > was already in the queue. > > > > As a microbenchmark I timed how long it takes to run sb_getblk() > > 10,000,000 times alternating between BH_LRU_SIZE + 1 blocks. > > Effectively, this benchmarks looking up buffer_heads that are in the > > page cache but not in the LRU: > > > > Before this patch: 1.758s > > After this patch: 1.653s > > > > This patch also removes about 350 bytes of compiled code (on x86_64), > > partly due to removal of the memcpy() which was being inlined+unrolled. > > > > Signed-off-by: Eric Biggers > > Ping? Al, do you have any interest in taking this patch? > > - Eric IMO, It is great patch. Could you please share your microbenchmark steps? I wanna take a deep look at it.