From patchwork Mon May 14 17:28:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 10399033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB81C60216 for ; Mon, 14 May 2018 17:28:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBF7728173 for ; Mon, 14 May 2018 17:28:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C055928396; Mon, 14 May 2018 17:28:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B441328173 for ; Mon, 14 May 2018 17:28:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41EFA6B0007; Mon, 14 May 2018 13:28:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3CEA26B0008; Mon, 14 May 2018 13:28:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2703B6B000A; Mon, 14 May 2018 13:28:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id C5A766B0007 for ; Mon, 14 May 2018 13:28:35 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id w7-v6so11097507pfd.9 for ; Mon, 14 May 2018 10:28:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:message-id :date:user-agent:mime-version:content-transfer-encoding :spamdiagnosticoutput:spamdiagnosticmetadata; bh=bW+iO8umi+aBZhJ1s6EozwO3DLu0mUyAUPfSsReSp40=; b=Pjf6lB4z8safwI6y0uPpds9v82Rq7f8wxbZHLwOCGVfc4ltL3KKawZ29nqSNFFi8x1 FG55+UUZPAGtcRHZuiiP7b4sZj2hybvu4o7rC7XRhIXASNtIjBkwpu/gt2t3BK/gZf/O 7H0Vlj5jeV5mnIdnmShDGf2MhSAzztUA2axCAWamFS8Tqcz10vxsPYIc3RGf2rLbfMmw g5EKkOUPtLZacdca4SFos1eDtuZUbqaeD3CP6HbtWHE1tT3+lmnxZ76fvZk3UtsF639G QkAbwHcqEPCDAKA302W+3/qzA86H9Ilc0Y0OTJd7pxrOpgrD/QtC17GRmlmWVUyt/KMX eBzA== X-Gm-Message-State: ALKqPwcTuMrcAsCd0waKWYbTLiWGMohcpO7I9EffPBDzkK2jS7d0Go15 u+PsKG4IjtvAOgt+Siu5KUd2ZYOIGgym2y0IfpqENun7Vw+5+Fcv1AyOH1h476poFP6nDBgCky4 J9xRkghnoA6lFPDOarAC+OtM3IaQHow0XHOK+1vRwnpZRcJMkEtjdR+vg4oCZSxDqQg== X-Received: by 2002:a62:5281:: with SMTP id g123-v6mr11398958pfb.22.1526318915386; Mon, 14 May 2018 10:28:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq/P0dzl/aHyJzfdG497kyVFfsjGhV8rtxvqqvG3W4X0iqCTz6KcZUcCbENGKJseFgBt5h/ X-Received: by 2002:a62:5281:: with SMTP id g123-v6mr11398900pfb.22.1526318914191; Mon, 14 May 2018 10:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318914; cv=none; d=google.com; s=arc-20160816; b=vwrgBIg02wGiit0gojJ6Gdd1E37gVkbPlbEpksivOGeulpb5jZU+RRloiPTawr8Wfs hQH0b2u5PtqXldhIaHOVi13yMXHqDx3KJ7sTVVPKypGmtiNEppXHe/OEM1z80kZNcCrU X8I+YPZYuPhN67gTACYCufbW5hvR7ZypigU2mkiDxU32bZlmOtnD1cQo6Rg3WfpLlzkh 1ARPxS7GN7B323ISLNlmSZocP7Uuo4nCDtmGHphCMkg7fh5KurGWFbdIqZarJ+9Q4PwM VBj9TVYjSYWW26hzr/gEWsfBQcxjUdCgtBn/l34kHKjnhNgycyOiruRf0jYt3nNuSDcb 6/gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:mime-version:user-agent:date:message-id :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bW+iO8umi+aBZhJ1s6EozwO3DLu0mUyAUPfSsReSp40=; b=L6i9L0XSAItriBe6Q0Ri0wH0NhA5HXfidbkTeHM0UeOyWCtntkT58Aty6BUwMW2Nqa 0vDBitTkgb+mIxYU9n5V/qquN90+ztshTx/Z7GmTCOOvqMZtAw75014uAnvO4Zt2i6ia w6GF4A7IRJ+8uTt/63z9s6r7F6xGhV4cGo0+YYb0bCaF5DFZjaaB2zo4VysPFmDmj5OG UH6OlHdZjsepznQqbiZuc7rgUM4PgCe9oRLhU+3fwHTr9ZRa3V59F8VrG+bJxHEjbNzs PtXEETP0QqhSh3f8pa050QDdz1ppzJA46Dso/0EcQDsUE9nbO8Iy9mnvkhpDpvSCrrZp 3Peg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netapp.onmicrosoft.com header.s=selector1-netapp-com header.b=pbpwFoQk; spf=pass (google.com: domain of boaz.harrosh@netapp.com designates 2620:10a:4005:8000:2306::b as permitted sender) smtp.mailfrom=Boaz.Harrosh@netapp.com Received: from mx142.netapp.com (mx142.netapp.com. [2620:10a:4005:8000:2306::b]) by mx.google.com with ESMTPS id p8-v6si2724843pgs.441.2018.05.14.10.28.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 10:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of boaz.harrosh@netapp.com designates 2620:10a:4005:8000:2306::b as permitted sender) client-ip=2620:10a:4005:8000:2306::b; Authentication-Results: mx.google.com; dkim=pass header.i=@netapp.onmicrosoft.com header.s=selector1-netapp-com header.b=pbpwFoQk; spf=pass (google.com: domain of boaz.harrosh@netapp.com designates 2620:10a:4005:8000:2306::b as permitted sender) smtp.mailfrom=Boaz.Harrosh@netapp.com X-IronPort-AV: E=Sophos;i="5.49,400,1520924400"; d="scan'208";a="253685586" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx142-out.netapp.com with ESMTP; 14 May 2018 10:28:33 -0700 Received: from HIOEXCMBX08-PRD.hq.netapp.com (10.122.105.41) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 14 May 2018 10:28:33 -0700 Received: from VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) by hioexcmbx08-prd.hq.netapp.com (10.122.105.41) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 14 May 2018 10:28:32 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) with Microsoft SMTP Server (TLS) id 15.0.1320.4 via Frontend Transport; Mon, 14 May 2018 10:28:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bW+iO8umi+aBZhJ1s6EozwO3DLu0mUyAUPfSsReSp40=; b=pbpwFoQk+lSB35FrLbt0/0OiCOdeIuWsZwIHLi1+YW7Nua8zc5q9d+EzbxGeiNvvXPOXiYhkFmIqL7VgwR5LzkTxTbvMGjOgUqNbbWieEqa0eUknjZ7JEASGnz1LGln2tNizhN+M/IaQppBXLFkGNnAsi1OKKjGyKlTneDIPVyc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Boaz.Harrosh@netapp.com; Received: from [10.0.0.5] (207.232.55.62) by CY4PR06MB3080.namprd06.prod.outlook.com (2603:10b6:910:58::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Mon, 14 May 2018 17:28:26 +0000 From: Boaz Harrosh To: Jeff Moyer , Andrew Morton , "Kirill A. Shutemov" , linux-kernel , linux-fsdevel , "linux-mm@kvack.org" CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , Peter Zijlstra , Dave Hansen , "Rik van Riel" , Jan Kara , Matthew Wilcox , Amit Golander Subject: [PATCH] mm: Add new vma flag VM_LOCAL_CPU Message-ID: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> Date: Mon, 14 May 2018 20:28:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 X-Originating-IP: [207.232.55.62] X-ClientProxiedBy: AM5PR0102CA0025.eurprd01.prod.exchangelabs.com (2603:10a6:206::38) To CY4PR06MB3080.namprd06.prod.outlook.com (2603:10b6:910:58::34) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(2017052603328)(7193020); SRVR:CY4PR06MB3080; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB3080; 3:/SscqJztj+o9OxfH+HHaNvFtpfgRwtGQsMuea1en3LSmljRo0eSwo7HYA5r2qoqCpFkh9TtXB0//NkrO+gJEFKy4ecp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37pueTJ7teRLwQQBSFyP3hYvBrffH8d6HmEsTiAPREdY6cDUe2tvaKbj2iw8N8aooLj53aRSyceVEcVeq2ZR77WrafChDn7J4vV/h+GOkL839uyhpwJvNPOFcwJsYQnAoNCN7NFDxYHsp/8LrW+ziNJo2rZL6BQapR+dAmVrFD0JzqnafudVhdEQQ+qwC3QJaXmV1qE5z6TtsjHxLPXqPpo2LVWFaoVGI/Y4gEkit1DDmDgC; 4:KN+G3ixjasGi6WVa/NLtjmTLd9QUqPDHa5PFM5stjDM6XVizwK/+ljJdUuK8OTWBspzDik4FF8pHUPRJwr/vb+DMwvDrQLFC/4kQkzS8UvSPwk71AsgNVsSgfIerTRj5abHD7HMpMFMQs2oCA3hsEEu4SLK+PbM3qoinv+3j2bnFF/36iESgqrGQczeh4pOzEzD09BhhLRiPD5Xth6T/x+YeCXPgs+Le/5pvTjBOKSKOnF5/4k7MpYS/7KQ9M8PXpsKxxPhbC+/bo4eEi1pwdtvo3l+5s0fdzIxAW1wnTHmB4S3Qo0nCKYX7udpTXhCJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:CY4PR06MB3080; BCL:0; PCL:0; RULEID:; SRVR:CY4PR06MB3080; X-Forefront-PRVS: 067270ECAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6049001)(39380400002)(39860400002)(366004)(346002)(376002)(396003)(189003)(199004)(50466002)(476003)(316002)(16576012)(54906003)(110136005)(8936002)(478600001)(58126008)(2906002)(68736007)(72206003)(6666003)(6486002)(8666007)(64126003)(106356001)(105586002)(2616005)(956004)(486006)(5660300001)(107886003)(77096007)(26005)(65826007)(31686004)(7736002)(53936002)(66066001)(8676002)(31696002)(81156014)(16526019)(386003)(97736004)(25786009)(4326008)(52116002)(3846002)(230700001)(52146003)(2486003)(23676004)(65806001)(59450400001)(1857600001)(305945005)(47776003)(6116002)(65956001)(2501003)(36756003)(81166006)(7416002)(21314002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR06MB3080; H:[10.0.0.5]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: netapp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjA2TUIzMDgwOzIzOnFwTGNGZk1yVzNmelZWWTQwa0JmVHR5aDBx?= =?utf-8?B?UURZY2hzcWNwcmxkZUYxSkM3dVE2WW9QK3Q5NG13NTlaVVdjeEJyVm5XSkI0?= =?utf-8?B?QThQSy9YWXk3bTc1a0diZlYwb2lXTm9zOTZrTU9zL2ZKRHhTYkRqVDdzWDR5?= =?utf-8?B?WmtQalJlNmlpKzV3UG5ZdCt3STM2MWdlNzg3bWFLdmJoUkE1R1gyVEVFK3ZV?= =?utf-8?B?WHlDYmpiZzdSSTRUQWhqVVQwZVIzbTBJMmlCVm5yRTJnVlZabVFOR0EvL1Qv?= =?utf-8?B?RzloY292MHRFYmQvTHY2WTFxUWhHMWgwVGI5bFNvZktrcUhrbytxNlp2Z0VE?= =?utf-8?B?YUJ6L0kyVWM1UE1YY2dRcXMzUGVCcjA5cXpNeXNScUdIRXJkRTZtQjdCZUgv?= =?utf-8?B?MDVNazZCUHJsZ0prdDB4Z1JNaURLWUw1SUJVWnNyWlFTUXNZWjU5aG1BZUM3?= =?utf-8?B?cVRqc01ObTlSdFlwcmdDYzZCVHZpMzg0Ry9aTE1FczFkaVVuZ0I5ZnRUTU1s?= =?utf-8?B?QjR3UGIwSkNvc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2Qmp/53xDHctC X-MS-Office365-Filtering-Correlation-Id: cf323139-2bc8-422e-5d79-08d5b9c01c5f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2018 17:28:26.4445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf323139-2bc8-422e-5d79-08d5b9c01c5f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4b0911a0-929b-4715-944b-c03745165b3a X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR06MB3080 X-OriginatorOrg: netapp.com X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On a call to mmap an mmap provider (like an FS) can put this flag on vma->vm_flags. The VM_LOCAL_CPU flag tells the Kernel that the vma will be used from a single-core only, and therefore invalidation (flush_tlb) of PTE(s) need not be a wide CPU scheduling. The motivation of this flag is the ZUFS project where we want to optimally map user-application buffers into a user-mode-server execute the operation and efficiently unmap. In this project we utilize a per-core server thread so everything is kept local. If we use the regular zap_ptes() API All CPU's are scheduled for the unmap, though in our case we know that we have only used a single core. The regular zap_ptes adds a very big latency on every operation and mostly kills the concurrency of the over all system. Because it imposes a serialization between all cores Some preliminary measurements on a 40 core machines: unpatched patched Threads Op/s Lat [us] Op/s Lat [us] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 185391 4.9 200799 4.6 2 197993 9.6 314321 5.9 4 310597 12.1 565574 6.6 8 546702 13.8 1113138 6.6 12 641728 17.2 1598451 6.8 18 744750 22.2 1648689 7.8 24 790805 28.3 1702285 8 36 849763 38.9 1783346 13.4 48 792000 44.6 1741873 17.4 We can clearly see that on an unpatched Kernel we do not scale and the threads are interfering with each other. This is because flush-tlb is scheduled on all (other) CPUs. NOTE: This vma (VM_LOCAL_CPU) is never used during a page_fault. It is always used in a synchronous way from a thread pinned to a single core. Signed-off-by: Boaz Harrosh --- arch/x86/mm/tlb.c | 3 ++- fs/proc/task_mmu.c | 3 +++ include/linux/mm.h | 3 +++ mm/memory.c | 13 +++++++++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index e055d1a..1d398a0 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -640,7 +640,8 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, local_irq_enable(); } - if (cpumask_any_but(mm_cpumask(mm), cpu) < nr_cpu_ids) + if (!(vmflag & VM_LOCAL_CPU) && + cpumask_any_but(mm_cpumask(mm), cpu) < nr_cpu_ids) flush_tlb_others(mm_cpumask(mm), &info); put_cpu(); diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index c486ad4..305d6e4 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -680,6 +680,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_PKEY_BIT2)] = "", [ilog2(VM_PKEY_BIT3)] = "", #endif +#ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS + [ilog2(VM_LOCAL_CPU)] = "lc", +#endif }; size_t i; diff --git a/include/linux/mm.h b/include/linux/mm.h index 1ac1f06..3d14107 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -226,6 +226,9 @@ extern unsigned int kobjsize(const void *objp); #define VM_HIGH_ARCH_2 BIT(VM_HIGH_ARCH_BIT_2) #define VM_HIGH_ARCH_3 BIT(VM_HIGH_ARCH_BIT_3) #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_LOCAL_CPU BIT(37) /* FIXME: Needs to move from here */ +#else /* ! CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ +#define VM_LOCAL_CPU 0 /* FIXME: Needs to move from here */ #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ #if defined(CONFIG_X86) diff --git a/mm/memory.c b/mm/memory.c index 01f5464..6236f5e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1788,6 +1788,7 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr, int retval; pte_t *pte, entry; spinlock_t *ptl; + bool need_flush = false; retval = -ENOMEM; pte = get_locked_pte(mm, addr, &ptl); @@ -1795,7 +1796,12 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr, goto out; retval = -EBUSY; if (!pte_none(*pte)) { - if (mkwrite) { + if ((vma->vm_flags & VM_LOCAL_CPU)) { + /* VM_LOCAL_CPU is set, A single CPU is allowed to not + * go through zap_vma_ptes before changing a pte + */ + need_flush = true; + } else if (mkwrite) { /* * For read faults on private mappings the PFN passed * in may not match the PFN we have mapped if the @@ -1807,8 +1813,9 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr, goto out_unlock; entry = *pte; goto out_mkwrite; - } else + } else { goto out_unlock; + } } /* Ok, finally just insert the thing.. */ @@ -1824,6 +1831,8 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr, } set_pte_at(mm, addr, pte, entry); + if (need_flush) + flush_tlb_range(vma, addr, addr + PAGE_SIZE); update_mmu_cache(vma, addr, pte); /* XXX: why not for insert_page? */ retval = 0;