From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [BUG] bug when enabling VM DEBUG Date: Wed, 12 May 2010 14:06:38 +0100 Message-ID: <20100512130638.GB19314@shareable.org> References: <4BEA1559.9000107@gmail.com> <1273662639.23818.67.camel@e102109-lin.cambridge.arm.com> <20100512115340.GA11261@Chamillionaire.breakpoint.cc> <1273667099.23818.86.camel@e102109-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail2.shareable.org ([80.68.89.115]:51633 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805Ab0ELNGs (ORCPT ); Wed, 12 May 2010 09:06:48 -0400 Content-Disposition: inline In-Reply-To: <1273667099.23818.86.camel@e102109-lin.cambridge.arm.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Catalin Marinas Cc: Sebastian Andrzej Siewior , Jeff Garzik , lkml , DE/ATA development list , saeed bishara , linux-arm-kernel , Robert Hancock Catalin Marinas wrote: > On Wed, 2010-05-12 at 12:53 +0100, Sebastian Andrzej Siewior wrote: > > * Catalin Marinas | 2010-05-12 12:10:39 [+0100]: > > > > >> > --- a/drivers/ata/libata-sff.c > > >> > +++ b/drivers/ata/libata-sff.c > > >> > @@ -894,7 +894,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) > > >> > do_write); > > >> > } > > >> > > > >> > - if (!do_write) > > >> > + if (!do_write&& !PageSlab(page)) > > >> > flush_dcache_page(page); > > >> > > >> I would think that check belongs inside flush_dcache_page itself, rather > > >> than forcing every driver to include it.. > > > > > >Sebastian (cc'ed) reported this as well for MIPS. > > Thx. The patch above looks what I've sent a while ago. Jeff was going to > > merge it afaik. > > > > >I think it makes sense for this check to be done in the > > >flush_dcache_page() function. > > > > Why should flush_dcache_page() not flush pages you tell it? > > From Documentation/cachetlb.txt: > > | NOTE: This routine need only be called for page cache pages > > | which can potentially ever be mapped into the address > > | space of a user process. So for example, VFS layer code > > | handling vfs symlinks in the page cache need not call > > | this interface at all. > > > > A page from slab or stack is not going to see the sky of user land and > > therefore it should not be fed into flush_dcache_page(). > > You are right :), so fixing the driver is the best approach. It worries me that a driver has any knowledge of the PageSlab() flag, though. Especially uncommented knowledge. That flag seems VM internal, and it's conceptually iffy: Kernel code using get_free_pages() and using that for I/O also does not see the sky of user land. If all the PIO drivers have to be changed, I'd be happier with: flush_dcache_page_for_pio() which wraps the check, explains it, and provides a single place to change if needed. -- Jamie