Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp900635pxb; Tue, 14 Sep 2021 11:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJAyCHjKK+lfmyBuD+4QGNYWPupoNg5Qfu/+2r7dPu4IQhFkCVa2dC6hBykzVqtiZ/SvnA X-Received: by 2002:a2e:1617:: with SMTP id w23mr12992845ljd.143.1631642850839; Tue, 14 Sep 2021 11:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631642850; cv=none; d=google.com; s=arc-20160816; b=ArwFonO2mWzf49dMTLo3n5ntIZj6ZIrku1Eofz2sEK5g7No+a7bFChQTfQxmGMIwKJ 1bCO1p8z6UgFziOmuKuiZk3v/nAWboKUO7XqMBf36FaZ5QWVn2dUghOgm5jylT9uYmMS zUBStViJbRXsCusm0ABkL9hR4CbS49lijv8WqxWUgRAq+ZEwdsUx+G6s106XfXDF7NEP eIGUWXAwlrnuzKG1mbbn6rPChXx96vJjw69ThE4qKxMSgPcKYTW3JvOWFH5bdiMWPDAr +qT5/TRevl1FrZweY3maeP+bGepOWsaAXKwWl0T4n4YxQjGr0sdNEAtEK5C0qeZHpGHn mLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gMy2+2YWwBU6udZmmpCVgiIhEGB2VyMMA5rTE2/ZjAM=; b=ZmNyFjENfzp15WUN4vRFh77XUh4lti60jYmH56dBYbZ+5hmCZIAMiMtyRM3eR8a4QB oSVg8WqgEhpgM0PiSqMwRmxTLLmmR9KraiQfBD7eNOcVPxWIdMP9whXCfIu1ZNvcqDiz q3+rlcoonf1iAw9QZyFWmniQiV6KmG1wnrG/q8rV6UTO7mi6/dn9iNI1u3qh6IT4qc+e nqU4dyIP6M4dGPtPCYiaENxVTBPjTassIpMB34o3aJIZYN61tYnlgBk3IXQTLK5rrCmP LHiG2gWHBqUTlzONOMcErfuVJPmG0d/WBjHbF4sNXX9jOQMzm2wY0y08mhEKZZapP9YK f57Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BsPNYN0z; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si13055965ljn.146.2021.09.14.11.07.02; Tue, 14 Sep 2021 11:07:30 -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=@infradead.org header.s=desiato.20200630 header.b=BsPNYN0z; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231461AbhINSGg (ORCPT + 99 others); Tue, 14 Sep 2021 14:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhINSGf (ORCPT ); Tue, 14 Sep 2021 14:06:35 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA657C061574; Tue, 14 Sep 2021 11:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=gMy2+2YWwBU6udZmmpCVgiIhEGB2VyMMA5rTE2/ZjAM=; b=BsPNYN0z0NtpnDm1PpS+NWvkw1 12FXzjO0A/AzqkQrfcBkR2+ExWQOUIyet0gfyT6fVQGKRMSAWyL+1R0ZuFYOvsraeX0kgnWr9Cftg 0zXm+XipQlDLQp1JaeqNMcA09ISqNP1ScF/fzhzYNvuu4XXjyglM/P72b8RDPdHEXb6WKDUo/igEE t08Z1G4N9PM2yPr3zuvwpTNS8VbESDshuYYCqCOtaQ9EfSFiPBapA3NDcFvryLjibxBEBOYPqH4o1 Z6Igk0EAZlypbBht7xqwlIrp/bCx10/OLddUo2QUpTqwTMOjVMDUOwnz5pwL6oWfFl2c1G+FOWg7p BYpK5wPQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQCnf-003BW4-Rr; Tue, 14 Sep 2021 18:04:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2C9143001C7; Tue, 14 Sep 2021 20:04:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1236A2D4E15B4; Tue, 14 Sep 2021 20:04:55 +0200 (CEST) Date: Tue, 14 Sep 2021 20:04:55 +0200 From: Peter Zijlstra To: Peter Oskolkov 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 Subject: Re: [PATCH 2/4 v0.5] sched/umcg: RFC: add userspace atomic helpers Message-ID: References: <20210908184905.163787-1-posk@google.com> <20210908184905.163787-3-posk@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.