From: Jens Axboe Subject: Re: [2.6.22 PATCH 22/26] dm: bio list helpers Date: Thu, 10 May 2007 23:40:15 +0200 Message-ID: <20070510214014.GA4163@kernel.dk> References: <20070508194845.GC24114@agk.fab.redhat.com> <20070508174159.7d78a275.akpm@linux-foundation.org> <20070509064923.GO4163@kernel.dk> <20070510152957.5c1ddec9@the-village.bc.nu> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20070510152957.5c1ddec9@the-village.bc.nu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Alan Cox Cc: Heinz Mauelshagen , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Jan Engelhardt , Andrew Morton , Alasdair G Kergon List-Id: dm-devel.ids On Thu, May 10 2007, Alan Cox wrote: > On Thu, 10 May 2007 16:17:57 +0200 (MEST) > Jan Engelhardt wrote: > > > > > On May 9 2007 08:49, Jens Axboe wrote: > > >On Tue, May 08 2007, Andrew Morton wrote: > > >> > +#define bio_list_for_each(bio, bl) \ > > >> > + for (bio = (bl)->head; bio && ({ prefetch(bio->bi_next); 1; }); \ > > >> > + bio = bio->bi_next) > > >> > + > > > > > >Besides, manual prefetching is very rarely a win. I dabbled with some > > >benchmarks a few weeks back (with the doubly linked lists), and in most > > >cases it was actually a loss. So I'd vote for just removing the > > >prefetch() above. > > > > So is the prefetching in the basic ADTs (e.g. linux/list.h) a loss too? > > Depends on the box it seems. On the newest systems the processor > prefetching seems to be very much smarter. On a "classic" AMD Athlon the > prefetching made the scheduler about 1.5% faster... It very much depends on the box, indeed. The ones I tested on were _slower_ with the prefetching, perhaps the dumber CPU's will benefit. In the long run, I don't think the manual prefetching is a good idea. -- Jens Axboe