From patchwork Wed Jun 10 06:27:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwei Tao X-Patchwork-Id: 6576801 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 71EA59F399 for ; Wed, 10 Jun 2015 06:34:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A02C420395 for ; Wed, 10 Jun 2015 06:34:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9558C20528 for ; Wed, 10 Jun 2015 06:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933390AbbFJGd5 (ORCPT ); Wed, 10 Jun 2015 02:33:57 -0400 Received: from mail-pd0-f196.google.com ([209.85.192.196]:32875 "EHLO mail-pd0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933130AbbFJGcx (ORCPT ); Wed, 10 Jun 2015 02:32:53 -0400 Received: by pdev10 with SMTP id v10so7464509pde.0; Tue, 09 Jun 2015 23:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pOas+aajmlrKl84VKtQ3HRRSOC/qYEjrNwSYa6GLK0o=; b=VDCuea3abEk+Y8we9nklJ+cldsfrdXnyB4mq1q33YO2VglFlnWU/QVFVbpRgnmAz3P ejrzt9rclbdAQjT6bDheps2yIid2ZyeHYbVi8kb8VzkynbV/j/MfQ6gnWBxbwXAP6ZvO JU87WZCMJ+Uzck7tTDd4aVtGn65SqNZKecXxnhuvtRtBwXdlNCus9pGS4QTIOS447oFm 5sSU2ZHiAZhGzEBgQthgjj5f5hbM6uGdoCK38Z6DsxXXTIywaV8T21nJ5SF+tfH58VYl LAWv213dKcY0+m6JOUrc18xJEXSHQ+jC8NOmASTRSe+tGeWgA8OWyMN2kRuqRYbFlHc6 tj5Q== X-Received: by 10.70.89.199 with SMTP id bq7mr2900401pdb.168.1433917972167; Tue, 09 Jun 2015 23:32:52 -0700 (PDT) Received: from wenweitao01ubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id ve1sm7425188pbc.52.2015.06.09.23.32.45 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 23:32:51 -0700 (PDT) From: Wenwei Tao To: izik.eidus@ravellosystems.com, aarcange@redhat.com, chrisw@sous-sol.org, hughd@google.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, viro@zeniv.linux.org.uk Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, wenweitaowenwei@gmail.com Subject: [RFC PATCH 5/6] x86/mm: change the condition of identifying hugetlb vm Date: Wed, 10 Jun 2015 14:27:18 +0800 Message-Id: <1433917639-31699-6-git-send-email-wenweitaowenwei@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1433917639-31699-1-git-send-email-wenweitaowenwei@gmail.com> References: <1433917639-31699-1-git-send-email-wenweitaowenwei@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hugetlb VMAs are not mergeable, that means a VMA couldn't have VM_HUGETLB and VM_MERGEABLE been set in the same time. So we use VM_HUGETLB to indicate new mergeable VMAs. Because of that a VMA which has VM_HUGETLB been set is a hugetlb VMA only if it doesn't have VM_MERGEABLE been set in the same time. Signed-off-by: Wenwei Tao --- arch/x86/mm/tlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 3250f23..0247916 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -195,7 +195,8 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, goto out; } - if ((end != TLB_FLUSH_ALL) && !(vmflag & VM_HUGETLB)) + if ((end != TLB_FLUSH_ALL) && + !((vmflag & (VM_HUGETLB | VM_MERGEABLE)) == VM_HUGETLB)) base_pages_to_flush = (end - start) >> PAGE_SHIFT; if (base_pages_to_flush > tlb_single_page_flush_ceiling) {