From patchwork Thu Feb 10 16:03:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 546801 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1AG3w6X019751 for ; Thu, 10 Feb 2011 16:03:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756561Ab1BJQD4 (ORCPT ); Thu, 10 Feb 2011 11:03:56 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:52014 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756339Ab1BJQD4 (ORCPT ); Thu, 10 Feb 2011 11:03:56 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 926F48EE0F5; Thu, 10 Feb 2011 08:03:55 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tbt0m2Pdy7D3; Thu, 10 Feb 2011 08:03:55 -0800 (PST) Received: from [192.168.2.10] (dagonet.hansenpartnership.com [76.243.235.53]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id E84188EE0D7; Thu, 10 Feb 2011 08:03:54 -0800 (PST) Subject: Re: [PATCH] parisc: Improve dcache flush on PA8800/PA8900 From: James Bottomley To: John David Anglin Cc: dave.anglin@nrc-cnrc.gc.ca, linux-parisc@vger.kernel.org In-Reply-To: <20110208184509.2E2C74ED8@hiauly1.hia.nrc.ca> References: <20110208184509.2E2C74ED8@hiauly1.hia.nrc.ca> Date: Thu, 10 Feb 2011 10:03:53 -0600 Message-ID: <1297353833.4933.50.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 10 Feb 2011 16:03:59 +0000 (UTC) diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 3f11331..c60cc42 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -276,10 +276,13 @@ __flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, void flush_dcache_page(struct page *page) { struct address_space *mapping = page_mapping(page); - struct vm_area_struct *mpnt; + struct vm_area_struct *mpnt = NULL; struct prio_tree_iter iter; unsigned long offset; - unsigned long addr, old_addr = 0; + unsigned long addr = 0; +#ifdef DEBUG_ALIASES + unsigned long old_addr = 0; +#endif pgoff_t pgoff; if (mapping && !mapping_mapped(mapping)) { @@ -304,14 +307,25 @@ void flush_dcache_page(struct page *page) offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; addr = mpnt->vm_start + offset; +#ifdef DEBUG_ALIASES if (old_addr == 0 || (old_addr & (SHMLBA - 1)) != (addr & (SHMLBA - 1))) { __flush_cache_page(mpnt, addr, page_to_phys(page)); if (old_addr) printk(KERN_ERR "INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %s\n", old_addr, addr, mpnt->vm_file ? mpnt->vm_file->f_path.dentry->d_name.name : "(null)"); old_addr = addr; } +#else + break; +#endif } flush_dcache_mmap_unlock(mapping); +#ifndef DEBUG_ALIASES + /* since we have only one page, flush outside the lock. If the loop + * didn't happen (no mappings), mpnt will be NULL */ + if (mpnt) + __flush_cache_page(mpnt, addr, page_to_phys(page)); +#endif + } EXPORT_SYMBOL(flush_dcache_page);