Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4870197imm; Mon, 14 May 2018 14:49:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqxOCjJJ17Bb1JnLPjjfz9SMzigJMLJwIu8wf8YVLSteAXcgmgp/PSBm0U6vMe+PQDbn0VX X-Received: by 2002:a17:902:a616:: with SMTP id u22-v6mr11714357plq.186.1526334598560; Mon, 14 May 2018 14:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526334598; cv=none; d=google.com; s=arc-20160816; b=UCHedcZxZgOITweHu0+hvhpav2sxJBeS/Xz8ab7Beyph+P9jAiwRHk8WRM4SOh20bz VFUhsYaLEgLonX9R3a3Xqy76RA8Y2Q71zv0Cv11gzG9f+mgWMxxpZ0kvxpuZgzdPHkpA +yCdfABCpU5KICwoWJDDAah3fdDsOxCDCmh04vm+uoqduwNlv0cGbZBu6lArKS9X8RZq +hL5w9WR7/CEtsago0VNeCIWiSVDjkREXSCCWpgoe3MndsuWpz+XsGPgYcJ0pmSnjD2b su2MycSHhcOGFPYuqvmKPiu6jCymZsPhJFDmiWo62mrMpE8F4sZDNoyBf7crdmUuRXY0 t6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=dEI4TKevTW7Eflkiip0FqtBAxAZ2+NWoECLnY+UIkhA=; b=idUFlQMMt6n62FWY12Iuys5IY2sYyHVlrM+wd5ePSQW67j18erpsxWOTES+fXRs88u LkqFADFkRFSy6+TiZ/599nk6NDSJGpkS1U7NMxXDnok60YYXe/QLzk8eafqfHgioqlwH hiEp5+r5/zmGFEu+4E47fsJ1JsknCX0EFKUvCAdOUZ9qAceIk/gcCk7J2P41L0cejpZZ 7xS7CBHbng0SAiF9f5lzZ2QyAZWmR9c2jkLrTSRTCwV6qsQAFuxLrdHYxXkic3FdTyWi bKxLDDjFcPDrYwoGDByY7AaHB1oJScLe8ZK9G+fNG0XXHv6p8D7Uz/q6dmdu+PPSowyT JMyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b62-v6si7992528pgc.505.2018.05.14.14.49.37; Mon, 14 May 2018 14:49:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbeENVtE (ORCPT + 99 others); Mon, 14 May 2018 17:49:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35856 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbeENVtD (ORCPT ); Mon, 14 May 2018 17:49:03 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.71]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2A1B816B9; Mon, 14 May 2018 21:49:02 +0000 (UTC) Date: Mon, 14 May 2018 14:49:01 -0700 From: Andrew Morton To: Boaz Harrosh Cc: Jeff Moyer , "Kirill A. Shutemov" , linux-kernel , linux-fsdevel , "linux-mm@kvack.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , Peter Zijlstra , Dave Hansen , "Rik van Riel" , Jan Kara , Matthew Wilcox , Amit Golander Subject: Re: [PATCH] mm: Add new vma flag VM_LOCAL_CPU Message-Id: <20180514144901.0fe99d240ff8a53047dd512e@linux-foundation.org> In-Reply-To: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> References: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 May 2018 20:28:01 +0300 Boaz Harrosh wrote: > 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 I'd have thought that in this situation, only the local CPU's bit is set in the vma's mm_cpumask() and the remote invalidations are not performed. Is that a misunderstanding, or is all that stuff not working correctly?