From patchwork Tue Apr 30 16:30:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 2505661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 3C8B03FD85 for ; Tue, 30 Apr 2013 16:34:07 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXDTy-0007D2-QW; Tue, 30 Apr 2013 16:32:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXDTa-0005wi-6n; Tue, 30 Apr 2013 16:32:22 +0000 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXDSo-0005lW-U9 for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2013 16:31:36 +0000 Received: by mail-we0-f174.google.com with SMTP id t9so581437wey.33 for ; Tue, 30 Apr 2013 09:31:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=Hy5VTD4V6sl5MpTwR7tWNSKuxDcvFMaJVeFmSqfGLFo=; b=mJdhu08zgu1bsF0ZP5OhrZHC7IItOo1u2lvIzdy05ZRvtMPzq/VCW5Y06qjF8ZPxPp chCmeaw/T5Uk5V53c1Bf1QzlXjh8JAk+UfqpKeD+AxJ/S/L5SEQ//wScBGpM48GGc1YS aHEEV+jrgem/eiyBmwgxAFTevOeGC+bogdrB1e+zeEwED38PqCP6wQz0HStKTJxPcCME pPOY2BjgqgNsP+VAQfkv5LWJKzGb8jVoEp+BI79Xwdb43TBDZFKZUEBgqnVEyH3PnjWR vvE5pOnkjayKg7vgXIrBgz4TUIcqS5iLu1aYBpFeZLMsqLx/pPjYZjFLakpCM1iv8c56 kbxQ== X-Received: by 10.180.72.227 with SMTP id g3mr24666331wiv.1.1367339472035; Tue, 30 Apr 2013 09:31:12 -0700 (PDT) Received: from localhost.localdomain (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id k5sm30044708wiy.5.2013.04.30.09.31.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Apr 2013 09:31:11 -0700 (PDT) From: Steve Capper To: linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 5/9] ARM64: mm: Add support for flushing huge pages. Date: Tue, 30 Apr 2013 17:30:44 +0100 Message-Id: <1367339448-21727-6-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1367339448-21727-1-git-send-email-steve.capper@linaro.org> References: <1367339448-21727-1-git-send-email-steve.capper@linaro.org> X-Gm-Message-State: ALoCoQldkXahq3dM4KHJpvI7ckPyaXNm/5I6LVH63fY6WeYJjnz4MApQwtBELEJ+g/ikv4fZEJzc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130430_123135_152099_552F85C6 X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Steve Capper , Catalin Marinas , Will Deacon , Michal Hocko , Ken Chen , Mel Gorman X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The code to flush the dcache of a dirty page, __flush_dcache_page, will only flush the head of a HugeTLB/THP page. This patch adjusts __flush_dcache_page such that the order of the compound page is used to determine the size of area to flush. Signed-off-by: Steve Capper --- arch/arm64/mm/flush.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index 88611c3..71c182d 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -72,7 +72,8 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, void __flush_dcache_page(struct page *page) { - __flush_dcache_area(page_address(page), PAGE_SIZE); + size_t page_size = PAGE_SIZE << compound_order(page); + __flush_dcache_area(page_address(page), page_size); } void __sync_icache_dcache(pte_t pte, unsigned long addr)