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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 5D1A0C433E0 for ; Thu, 7 Jan 2021 20:18:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 148D523403 for ; Thu, 7 Jan 2021 20:18:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbhAGUSl (ORCPT ); Thu, 7 Jan 2021 15:18:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbhAGUSk (ORCPT ); Thu, 7 Jan 2021 15:18:40 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BCA4C0612F4 for ; Thu, 7 Jan 2021 12:18:00 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id o17so17626431lfg.4 for ; Thu, 07 Jan 2021 12:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dGs5SC/WgPGPwKJAjM4eEmzVICBqZQ76JG19WsL7/rQ=; b=FQSGvmK+Xq6jpxFayh+QAC+i2+ruwFl+7GQruzMXs4TpJg88gnkX97b2mPGKPlgJGX AMrAJMDLYYA+DHS2uYLi42G+367WhqwDgya7y4vMNHXqZ4lSr2ADFnbQw8rUyv/G3+vo vp9ggy2xaeUofO3SQxirTt7eGCncCcRZZ9eJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dGs5SC/WgPGPwKJAjM4eEmzVICBqZQ76JG19WsL7/rQ=; b=ljHqk8AZZK8g5YFCrO8fdurd8MVLclEyrAwKFWAVe1CH6IVW3Cdp2ErV71w3OOjqpG 8qlh+wWKC2hloZPddtMaqTn1A3bBQWvnQhqIhNoffpgYyVD2FiL90bS1GWj23nfT2UgT OLn1wNR0urfdQuCFDdYrTGTjKjMsqZtpiq5sZ5oMaCBuTWU9bAw5fOSSn/aUiPoamb31 TeNMxdC0RTiovA1+7jswZu5yH9Sks+u7k9aT/BVoLQQqRhvOwZvgKTxiskx7q2dGC+yl jMaXO1Jlk9aczjJTdc2Fpz525XewhKrONo+VnUaiuYF1vowODpRKIlEtDM1pwOuchGKo JwbA== X-Gm-Message-State: AOAM530rbWou25O+LP4ceCOKyX3TuF8q5GZkrHU4lB/kp/940CIqzzVw Om860ZIGFFPwMwsoY4Kn7j5jUNK4iO8QEA== X-Google-Smtp-Source: ABdhPJysUHnMvX/bXtG3zWq+kWHeBaGz7aoEiS81Jd7HevI620hjrNG7uovd53v5X1B+g4Q64SQ/lQ== X-Received: by 2002:ac2:4249:: with SMTP id m9mr212201lfl.594.1610050678025; Thu, 07 Jan 2021 12:17:58 -0800 (PST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id b5sm1391219lfo.126.2021.01.07.12.17.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 12:17:56 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id m25so17482756lfc.11 for ; Thu, 07 Jan 2021 12:17:56 -0800 (PST) X-Received: by 2002:a05:6512:338f:: with SMTP id h15mr189659lfg.40.1610050676088; Thu, 07 Jan 2021 12:17:56 -0800 (PST) MIME-Version: 1.0 References: <20210107200402.31095-1-aarcange@redhat.com> <20210107200402.31095-3-aarcange@redhat.com> In-Reply-To: <20210107200402.31095-3-aarcange@redhat.com> From: Linus Torvalds Date: Thu, 7 Jan 2021 12:17:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] mm: soft_dirty: userfaultfd: introduce wrprotect_tlb_flush_pending To: Andrea Arcangeli Cc: Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jason Gunthorpe , Jan Kara , Kirill Tkhai Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 7, 2021 at 12:04 PM Andrea Arcangeli wrote: > > However there are two cases that could wrprotecting exclusive anon > pages with only the mmap_read_lock: I still think the real fix is "Don't do that then", and just take the write lock. The UFFDIO_WRITEPROTECT case simply isn't that critical. It's not a normal operation. Same goes for softdirty. Why have those become _so_ magical that they can break the VM for everybody else? Linus 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 12443C433DB for ; Thu, 7 Jan 2021 20:18:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 67BBC23433 for ; Thu, 7 Jan 2021 20:18:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67BBC23433 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A47298D0145; Thu, 7 Jan 2021 15:18:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F7748D013A; Thu, 7 Jan 2021 15:18:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E6638D0145; Thu, 7 Jan 2021 15:18:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id 785B88D013A for ; Thu, 7 Jan 2021 15:18:00 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 35557180AD817 for ; Thu, 7 Jan 2021 20:18:00 +0000 (UTC) X-FDA: 77680090320.15.farm69_41147cc274ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 141831814B0C1 for ; Thu, 7 Jan 2021 20:18:00 +0000 (UTC) X-HE-Tag: farm69_41147cc274ed X-Filterd-Recvd-Size: 4460 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Jan 2021 20:17:59 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id h205so17615203lfd.5 for ; Thu, 07 Jan 2021 12:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dGs5SC/WgPGPwKJAjM4eEmzVICBqZQ76JG19WsL7/rQ=; b=FQSGvmK+Xq6jpxFayh+QAC+i2+ruwFl+7GQruzMXs4TpJg88gnkX97b2mPGKPlgJGX AMrAJMDLYYA+DHS2uYLi42G+367WhqwDgya7y4vMNHXqZ4lSr2ADFnbQw8rUyv/G3+vo vp9ggy2xaeUofO3SQxirTt7eGCncCcRZZ9eJM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dGs5SC/WgPGPwKJAjM4eEmzVICBqZQ76JG19WsL7/rQ=; b=rE7gO9hkhKg2z1qM+ztMuMfVJ28m7UQ5AQJJn2XnIWEExrOV5aow5T9uBPfRkBTjqY J6m2q4voSe8h+rNL644GgM3M6w/+WS9SEYA5rLsSrft4sTpTkoytzE+IFqU8luU6/zJp 3evcHIiFdCu5v/5zSEyF30Co9N+fZroHDRFgtx9O4hRR6EuhTifylbRRfkI3q/ctln1b oe0uCrx9tFYAYq48hDdTLx+qase18bJJV3XTmEVXP0RyvHNlWQzqTQfPXlR1lp160c7U 0ZOOBrFeoKfj8qyS//S4zcok6mgkCREs0E5fv24zeApCGnronV2Mcp9sEKBTrCyuxqNi JJBw== X-Gm-Message-State: AOAM531uS/+toIyoNHnIhZ8f7yoLmG/JeTDHzZFZB6Hwv+ntw6y8dJBp 3M/A1OoOL0p/vilj9JOO/9XK9mF5xtgTVQ== X-Google-Smtp-Source: ABdhPJzGkSHIMv6gRHcz/MLo6fW6rY7lRMBH2xT0SRoiFGJ23g8Hs340C9xJG92xLZnX+lqohnaMpA== X-Received: by 2002:ac2:48a5:: with SMTP id u5mr176399lfg.97.1610050677846; Thu, 07 Jan 2021 12:17:57 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id p17sm1366113lfc.273.2021.01.07.12.17.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 12:17:56 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id h22so17682715lfu.2 for ; Thu, 07 Jan 2021 12:17:56 -0800 (PST) X-Received: by 2002:a05:6512:338f:: with SMTP id h15mr189659lfg.40.1610050676088; Thu, 07 Jan 2021 12:17:56 -0800 (PST) MIME-Version: 1.0 References: <20210107200402.31095-1-aarcange@redhat.com> <20210107200402.31095-3-aarcange@redhat.com> In-Reply-To: <20210107200402.31095-3-aarcange@redhat.com> From: Linus Torvalds Date: Thu, 7 Jan 2021 12:17:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] mm: soft_dirty: userfaultfd: introduce wrprotect_tlb_flush_pending To: Andrea Arcangeli Cc: Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jason Gunthorpe , Jan Kara , Kirill Tkhai Content-Type: text/plain; charset="UTF-8" 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 Thu, Jan 7, 2021 at 12:04 PM Andrea Arcangeli wrote: > > However there are two cases that could wrprotecting exclusive anon > pages with only the mmap_read_lock: I still think the real fix is "Don't do that then", and just take the write lock. The UFFDIO_WRITEPROTECT case simply isn't that critical. It's not a normal operation. Same goes for softdirty. Why have those become _so_ magical that they can break the VM for everybody else? Linus