Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp919803pxb; Tue, 14 Sep 2021 11:32:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNFyq7FMwtCCaKMTCddnpgp7g2smWw2ZrCrzNlgTuHpJ6rbVYofEAJ6OTUuB09TSdYtZKV X-Received: by 2002:a05:651c:4d0:: with SMTP id e16mr17248337lji.498.1631644365559; Tue, 14 Sep 2021 11:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631644365; cv=none; d=google.com; s=arc-20160816; b=BdfaDXyuVsxemw4mbtoLmTpic+63UVo26fjtWPq3Z/wFGozhK1LYKFDXTzADAL20BN NuxTHO5NP5XhBu1+jqMztowSofV6nd1ogFMA4RszHXaqxt3pubC+WmOhl+yUqDizV6YQ ayDoM5gfh6PLr5vN9pSwCCCP/5d7ZPPLT4zOO/a6H60itpJCwq8se6SFdZpugJtq920d AkbX2sUsAVX8f6mKkOxHLMTNSb85Y2mEHQrHEfIST+khmkJfS9/uooa2JAOXmwWc/DAO b0HYKNRSoS7u88rJytno7d29ZwvFm52xihV21Cqc6TnjwHjuBxWH24MPixeyEgU5sxWT tMYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AFVYzJ8YTa+AGDh1qk1TwKj2W51f7K7hlovDVMVEqy4=; b=MZv0C/cWXRmVxnU3uMBBVbUdM5xquCN36VCb3TAbMZr3dmYqpAy8E9281LChokrV5G jwbC/YdJirN35XEY9Pq9LqP6Y2oA1FJdMd9UeMyRAgerVRZlhFB/+/xrfvkQ1FAtUQy5 Ppn9Zb4wfsr7pL6tHYPDZx2x8uM25E2oCNJbuIQTnqfkky2ahGnPf8OPfx/gar34H4gX 1t+Ko1D8J5B6OR62EiUukAuFpmMuhn3EPlG+ebXvDRloYc6cETJCicay2Nej3t4vMRtR hqzv0HBoITPsQ7DmrS+FsooHCzEZrrZfogLRiDwiFppkJ8VrmHorosXJVlEBmUC5OZbn SUVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NhlGWuGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p24si18349920ljj.416.2021.09.14.11.32.13; Tue, 14 Sep 2021 11:32:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NhlGWuGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbhINSbS (ORCPT + 99 others); Tue, 14 Sep 2021 14:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbhINSbS (ORCPT ); Tue, 14 Sep 2021 14:31:18 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23ABFC061762 for ; Tue, 14 Sep 2021 11:30:00 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id w4so269258ljh.13 for ; Tue, 14 Sep 2021 11:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AFVYzJ8YTa+AGDh1qk1TwKj2W51f7K7hlovDVMVEqy4=; b=NhlGWuGaV0jYGjNbfdOafXTFiTSg+9TM+X1xSh6FvChIKfpetxiyJDG3dyef0TJKiW VSfZ5VINDVFMjKErAw96wZa5KIRdwcSoScZaWLldpalE5xpvALmfN8tDTQ3X0NtRj0wi 3AHBmf7W9aOH+qfOvddVqr7xnUvazkaEPHoLbPIuG3zM8whFPoBwT1PJPefa9FvtYRQw RozofHJugThFbZCpg1QpDvIhOidMo804YW8NiGNB1v8WW8codCAlJYieVM7Bcp0ArNJy ckhoVkQjR0WcOuSilst/EpYecHBlHF/qkKSGVr6jsQ9WFNkBCEpQBlfUbtiP2Dlbq94i 0PRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AFVYzJ8YTa+AGDh1qk1TwKj2W51f7K7hlovDVMVEqy4=; b=kRkmW7aGPTQNBy16Xvvs8cA443au4FxUJZu3JND4F1fSZu7dAHgjbwP6hNSIUtWYSm zLPENZgrv84coZ9vG4S5pjGHYgc5pmlaQv6MxAXrKMwdU3FiCiyqoN5ozU/zXfFPdSVN 7zPzxruNilTrEgEk6YNDwSFUaUM9dGZI3bxzJzLGN+MyS3WNCJjN+do6SKBXwAw/8SeJ WudRc697VdgQ9zyZaYgNbDMzMWbO5zAJWs7DU+dslHOXZRfZK+cLpD2tBeSXk2sc0gpg aXgQs6f0rLGT+GlaL8aWbTrNyHKIs5RQuh5QQPWCwgi+s8ZKMgXgYV1x1bSrsTgHVEkd n9Ww== X-Gm-Message-State: AOAM530C42LV4iaesnBM2V/tjcTd3d/2n9Nfw8MF86E8qHnrWfZMpZTy ozflQ/UOqRp+m01YqTHtZ5SJLPbzwhET/u3JzP4Dmw== X-Received: by 2002:a2e:a726:: with SMTP id s38mr16630655lje.386.1631644198402; Tue, 14 Sep 2021 11:29:58 -0700 (PDT) MIME-Version: 1.0 References: <20210908184905.163787-1-posk@google.com> <20210908184905.163787-3-posk@google.com> In-Reply-To: From: Peter Oskolkov Date: Tue, 14 Sep 2021 11:29:46 -0700 Message-ID: Subject: Re: [PATCH 2/4 v0.5] sched/umcg: RFC: add userspace atomic helpers To: Peter Zijlstra Cc: Jann Horn , Peter Oskolkov , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Ben Segall , Andrei Vagin , Thierry Delisle Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 11:05 AM Peter Zijlstra wrote: > > On Tue, Sep 14, 2021 at 09:29:00AM -0700, Peter Oskolkov wrote: > > In the version of the patchset that I'm preparing to send I've decided > > to punt on the issue and just ask the userspace to deal with locking > > the memory as it sees fit: mlock() is available and as far as I can > > Sadly mlock() does not imply no faults. Someone had a too literal > reading of the POSIX-RT spec (of which mlock is part) and figured that > all that was required was to keep the page in memory, not avoid faults. > > Linux has had this bahviour for ages, PREEMPT_RT has tried to change > this, but so far to no avail. At some point sys_mpin() was proposed to > meet the original POSIX-RT intent, but afaict that never actually > happened. > > In short, mlock() does not avoid minor faults, or even migration faults, > which can take a fair while to resolve. Ok, I'll go with transiently pinning pages in __syscall_enter_from_user_work(), as you suggested. Seems easy enough to do. Thanks for the suggestion!