From patchwork Fri Dec 13 19:05:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 22342 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03008202E2 for ; Fri, 13 Dec 2013 19:06:01 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id j5sf2276124qaq.9 for ; Fri, 13 Dec 2013 11:06:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vnyXnm8nWcWTIvnr156gVuD/cLa9xhBSbL30EQynbZ4=; b=Neca9N2z03ei9Om4XSWFj7itc8DmXSAL5HRtkqR7YJ8F+QSW3jrtL7zQ3E8uHc1v94 YNmsGBv/BY37dubcKm/uKtBUgXtq3p5VDP3bXFX/QHlPC3lYV1hUHKvhVksiYVTmll0P MYEpsd1Upoe3ldQix7G/9YJMiVXQ39UGQtPZdImQKk1iLuViT8faI0/2kNbR1NiVf310 /Ztogho5I8fnuKJdHPgOCAZm8cAvTqd6Jx7UIvK/LecBUwemYbWc7l6oUbJemk9FywY7 EF5dsrpBXFpB9UfRhSfknRysLkXIlTIC76upZmych51q9ODKT7kaYjfQ8nxf+Y8gSEk3 dd4A== X-Gm-Message-State: ALoCoQlNaOpyTJKdvrWWxNp35s0jqnEIBVcm1PHLkRjRik1D03h05Z3dbdGPFzCbD9Tmn6SCAKvf X-Received: by 10.58.2.98 with SMTP id 2mr1420987vet.3.1386961561826; Fri, 13 Dec 2013 11:06:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.46 with SMTP id nd14ls1090050qeb.19.gmail; Fri, 13 Dec 2013 11:06:01 -0800 (PST) X-Received: by 10.52.113.170 with SMTP id iz10mr1618164vdb.56.1386961561647; Fri, 13 Dec 2013 11:06:01 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id j3si1060292vcf.39.2013.12.13.11.06.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:06:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id q12so1571894vbe.34 for ; Fri, 13 Dec 2013 11:06:00 -0800 (PST) X-Received: by 10.52.162.168 with SMTP id yb8mr1611347vdb.8.1386961560922; Fri, 13 Dec 2013 11:06:00 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp61430vcz; Fri, 13 Dec 2013 11:06:00 -0800 (PST) X-Received: by 10.180.219.33 with SMTP id pl1mr3758977wic.49.1386961560042; Fri, 13 Dec 2013 11:06:00 -0800 (PST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id yx3si1268780wjc.17.2013.12.13.11.05.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 11:06:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id bz8so1530973wib.11 for ; Fri, 13 Dec 2013 11:05:59 -0800 (PST) X-Received: by 10.194.60.103 with SMTP id g7mr3584740wjr.37.1386961559383; Fri, 13 Dec 2013 11:05:59 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id o9sm289604wib.10.2013.12.13.11.05.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 11:05:58 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Cc: linux@arm.linux.org.uk, will.deacon@arm.com, catalin.marinas@arm.com, patches@linaro.org, robherring2@gmail.com, deepak.saxena@linaro.org, Steve Capper Subject: [RFC PATCH 3/6] arm: mm: Make mmu_gather aware of huge pages Date: Fri, 13 Dec 2013 19:05:43 +0000 Message-Id: <1386961546-10061-4-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386961546-10061-1-git-send-email-steve.capper@linaro.org> References: <1386961546-10061-1-git-send-email-steve.capper@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Huge pages on short descriptors are arranged as pairs of 1MB sections. We need to be careful and ensure that the TLBs for both sections are flushed when we tlb_add_flush on a huge pages. This patch extends the tlb flush range to HPAGE_SIZE rather than PAGE_SIZE when addresses belonging to huge page VMAs are added to the flush range. Signed-off-by: Steve Capper --- arch/arm/include/asm/tlb.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h index 0baf7f0..f5ef8b8 100644 --- a/arch/arm/include/asm/tlb.h +++ b/arch/arm/include/asm/tlb.h @@ -81,10 +81,16 @@ static inline void tlb_flush(struct mmu_gather *tlb) static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr) { if (!tlb->fullmm) { + unsigned long size = PAGE_SIZE; + if (addr < tlb->range_start) tlb->range_start = addr; - if (addr + PAGE_SIZE > tlb->range_end) - tlb->range_end = addr + PAGE_SIZE; + + if (tlb->vma && is_vm_hugetlb_page(tlb->vma)) + size = HPAGE_SIZE; + + if (addr + size > tlb->range_end) + tlb->range_end = addr + size; } }