From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08036CA9EAE for ; Tue, 29 Oct 2019 08:56:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8D4120663 for ; Tue, 29 Oct 2019 08:56:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ahVlpW42" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8D4120663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 712E56B0006; Tue, 29 Oct 2019 04:56:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C3AC6B0007; Tue, 29 Oct 2019 04:56:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B2F26B0008; Tue, 29 Oct 2019 04:56:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 396456B0006 for ; Tue, 29 Oct 2019 04:56:32 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id AD931181AEF23 for ; Tue, 29 Oct 2019 08:56:31 +0000 (UTC) X-FDA: 76096216182.26.error66_38ee5de00fc33 X-HE-Tag: error66_38ee5de00fc33 X-Filterd-Recvd-Size: 4242 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Oct 2019 08:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Xez2J0gdWTQqquZ7HMjmzRRSRKuRWvTSCcnNPVHNA/g=; b=ahVlpW42taty0lSMLliukzweJ 8X1ZH4o3vxmyak/TqNyxf+gECDUZYtp8vOeQ6+PqM84XwgzJLbPzwd6Qt5PG44zLYkayeKOqdVGWk EBvmbYDmTM/qMF9WUUuSFuzj2Yrw62cJy0fL24dBwAnFV6zbi4EHYEPP2hiqc6+RuQoBTvJooa8iE dBkUF5CznIhOc0ErpTfWlgg77CpH39CI/28hg7lS84MVEc7lexhWN9OMfGXalAzlEx+6LluZy7E9b SEEoo+KVUU78wyle+Ct+G9N34+5ZPTjrbW0oiZMpsHqpx6uZJTKYLC8hTHFiDG1UVwmoIq3RDBTuP 2ebVCEniw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPNIL-0008JR-Rv; Tue, 29 Oct 2019 08:56:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 74473306091; Tue, 29 Oct 2019 09:55:01 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 20B0220D7FEE3; Tue, 29 Oct 2019 09:56:02 +0100 (CET) Date: Tue, 29 Oct 2019 09:56:02 +0100 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Dan Williams , Mike Rapoport , Linux Kernel Mailing List , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , James Bottomley , Steven Rostedt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux API , linux-mm , the arch/x86 maintainers , Mike Rapoport Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings Message-ID: <20191029085602.GI4114@hirez.programming.kicks-ass.net> References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> <20191028123124.ogkk5ogjlamvwc2s@box> <20191028130018.GA7192@rapoport-lnx> <20191028131623.zwuwguhm4v4s5imh@box> <20191029064318.s4n4gidlfjun3d47@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191029064318.s4n4gidlfjun3d47@box> User-Agent: Mutt/1.10.1 (2018-07-13) 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: On Tue, Oct 29, 2019 at 09:43:18AM +0300, Kirill A. Shutemov wrote: > But some CPUs don't like to have two TLB entries for the same memory with > different sizes at the same time. See for instance AMD erratum 383. > > Getting it right would require making the range not present, flush TLB and > only then install huge page. That's what we do for userspace. > > It will not fly for the direct mapping. There is no reasonable way to > exclude other CPU from accessing the range while it's not present (call > stop_machine()? :P). Moreover, the range may contain the code that doing > the collapse or data required for it... > > BTW, looks like current __split_large_page() in pageattr.c is susceptible > to the errata. Maybe we can get away with the easy way... As you write above, there is just no way we can have a (temporary) hole in the direct map. We are careful about that other errata, and make sure both translations are identical wrt everything else.