Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2888526imm; Sun, 16 Sep 2018 05:22:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaRIUs2U+rNE4nD2UpwJxM/XeFScY62M10ZS7EmBMG+J6cmEtS57AxC/6gEwPbwSjvnYl2X X-Received: by 2002:a62:c8d2:: with SMTP id i79-v6mr21360337pfk.35.1537100551273; Sun, 16 Sep 2018 05:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537100551; cv=none; d=google.com; s=arc-20160816; b=Hj+4jIr28lD2zsp+tmflqc/ekse68/4UVwScXCbWM6Oisf16re1eqEV2diRlDl0hgz tCGn94skFf1vbovemDiU+/cZzI4feLmpHg/tDG/zTVKDn2aQK97Ht2hUTyX98YTlMGwN c5aTzVjQ4qA/V9hPoBmAkjrLvvdWbACw3l1HdDG33y/MDMLJAwPL4YHZ26Kx9e8R0mjN wF/VsZW4WvQ5tx68vmTEkX0uTYGLOGJOZ7M1FWw1p7pwC+dng5Yj9hAvI30ob4fDcWFE M+zJCxxe0LQ5cbItQFKB/DrG14QyjixSfib3b4vy2vsiAYEyiom/9+TYSWkiG26fIlDc nriA== 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 :message-id:in-reply-to:date:references:subject:cc:to:from; bh=uJBS19ocT8hG3YiTnSPg1j7ayAPZyaCpYvEeU+F+Rn0=; b=obAujup67CuTqHLeO2MqJ8wSrfvtKMRwhybopzegeSt8DFu1cYgRDrO3XMCnAiPkYl W3cf5hfd+beNVQZlC5D+fnpDEWDyMN4oss3C1Dooi8QzjDin9C7CWOlkga0zXO3j7p8U xdTBInsHSVkd0CTi7zTfyxsgR0zLEFIfTMX8/DXx2nDwTpVU/PZl/IiSZYWsIvNDTg45 ijX24sJnHkVNwjPQVTkAfBBoJaz3ooXLK7mlFQ0gDmplMeya/NakdPYln+XXEC/+iVG7 JyHWFWDCnY9fxSd53JNQWkQq9QsQAbt1cWA++Z8mjmk5F5bsjUZdFCg6NfY1OwKuk0PX ZG/Q== 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 f23-v6si12265031plr.470.2018.09.16.05.22.02; Sun, 16 Sep 2018 05:22:31 -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 S1728241AbeIPRoo convert rfc822-to-8bit (ORCPT + 99 others); Sun, 16 Sep 2018 13:44:44 -0400 Received: from albireo.enyo.de ([5.158.152.32]:53230 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbeIPRoo (ORCPT ); Sun, 16 Sep 2018 13:44:44 -0400 X-Greylist: delayed 328 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Sep 2018 13:44:43 EDT Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1g1VyT-0007lT-HN; Sun, 16 Sep 2018 12:16:25 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.89) (envelope-from ) id 1g1VyT-0006uT-AF; Sun, 16 Sep 2018 14:16:25 +0200 From: Florian Weimer To: Rich Felker Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , linux-man@vger.kernel.org, "Michael Kerrisk \(man-pages\)" Subject: Re: futex_cmpxchg_enabled breakage References: <20180829222221.GA22017@brightrain.aerifal.cx> Date: Sun, 16 Sep 2018 14:16:25 +0200 In-Reply-To: <20180829222221.GA22017@brightrain.aerifal.cx> (Rich Felker's message of "Wed, 29 Aug 2018 18:22:21 -0400") Message-ID: <87fty9hc2u.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Rich Felker: > I just spent a number of hours helping someone track down a bug that > looks like it's some kind of futex_cmpxchg_enabled detection error on > powerpc64 (still not sure of the root cause; set_robust_list producing > -ENOSYS), and a while back I hit the same problem on sh2 due to lack > of EFAULT on nommu, leading to commit 72cc564f16ca. I think the test > (introduced way back in commit a0c1e9073ef7) is fundamentally buggy; > if anything, it should be checking for !=-ENOSYS, not ==-EFAULT. > Presumably it could also fail to produce -EFAULT if mmap_min_addr is 0 > and page 0 is mapped (a bad idea, but maybe someone does it...). And > of course other nommu archs are possibly still broken. Maybe it was related to this (“Kernel 4.15 lost set_robust_list support on POWER 9”): The Kconfig change you suggest was explicitly rejected as the fix. I believe the expected userspace interface is that you probe support with set_robust_list first, and then start using the relevant futex interfaces only if that call succeeded. If you do that, most parts of a typical system will work as expected even if the kernel support is not there, which is a bit surprising. It definitely makes the root cause harder to spot.