Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5228110imu; Wed, 19 Dec 2018 07:41:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/W9ifowHwIMSAtaHces/vtIDd8uTf0Hys/rDNv8uCZ7o3Ric3S7268u1vdPj00FTDkXJTNU X-Received: by 2002:a17:902:12f:: with SMTP id 44mr20972336plb.74.1545234071572; Wed, 19 Dec 2018 07:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545234071; cv=none; d=google.com; s=arc-20160816; b=L0w2XVWpBxvAuUsonqNauHSe7v+QzbZmhPZXHY+JnGjny7CBIuniVEWSiqh1mJfpYq +5rJu7vvb3cCvKS1q1iPmQGOwgDYx7lqaD9SxQUBZCVyobUi5+HryNZ44VZNdp+v0hqM f5GY21sS33JTsUTEy1q3GiXT1JJFuH6TRDJLhjHvX32GfNRbx0vLyS8kb+mXBrFN6vA8 PfCGDdXM5gG5gaDJMNroepp7AzTmsOgZFfj0HMzZrvjuqlOEYnx1DTmnXc5DsFgkHEcr T/idp+dxteoj9+xUghIu+qpN/47NyQ6UeA6fB1etfIvKYwvn7w5jCwdNMYAl06/xlUVI ALtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=qjFn5N40DANfOJff27sg+lcrtnvY2GE3j6gANC77lQs=; b=yOAx6S9/E9LyhZqC7cTRjheHlj8cPvKXAevY64u+0yAVb9I/SLrE9l1mepdnpWhnNn SV4TR1BiH87QllkdYxlWGh5RgMVuBFfdzifj13r798YFZj+U6FqfYfIIpyGdqKEdrxPG Yh95Zd1Mebzg3HNUmo+wpxoNOqDBe4ZfmLiT4R4QRGIBhSgOJRBlQgybwslO0YSadwzv ZoSMZbgZ3P21vmk1A3AC26ewZaR36NMtQ4EUmW+wqm3Boy+8hIg4gV4DQmXB2NoP0sUP gM+FCbZorY/0EX4uo4RgthgUWf5LyMpd0OwZGBEPgn36jc9zsUMXo0zvR12bjas/OFPU V2tQ== 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 n1si12524117pgq.36.2018.12.19.07.40.45; Wed, 19 Dec 2018 07:41:11 -0800 (PST) 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 S1729219AbeLSN3N (ORCPT + 99 others); Wed, 19 Dec 2018 08:29:13 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:58736 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728093AbeLSN3N (ORCPT ); Wed, 19 Dec 2018 08:29:13 -0500 Received: from www-data by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1gZbuQ-0004ta-EO; Wed, 19 Dec 2018 14:29:10 +0100 To: Peter Zijlstra Subject: Re: [patch] futex: Cure exit race X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 19 Dec 2018 14:29:10 +0100 From: Thomas Gleixner Cc: LKML , Stefan Liebler , Heiko Carstens , Darren Hart , Ingo Molnar In-Reply-To: References: <20181210152311.986181245@linutronix.de> <20181210160205.GQ5289@hirez.programming.kicks-ass.net> <20181212090418.GT5289@hirez.programming.kicks-ass.net> Message-ID: <539c47359b37a5b6b9177da823be45d6@dl.linutronix.de> User-Agent: html based client Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-12-18 10:31, Thomas Gleixner wrote: > On Wed, 12 Dec 2018, Peter Zijlstra wrote: >> On Mon, Dec 10, 2018 at 06:43:51PM +0100, Thomas Gleixner wrote: >> @@ -806,6 +806,8 @@ void __noreturn do_exit(long code) >> * task into the wait for ever nirwana as well. >> */ >> tsk->flags |= PF_EXITPIDONE; >> + smp_mb(); >> + wake_up_bit(&tsk->flags, 3 /* PF_EXITPIDONE */); > > Using ilog2(PF_EXITPIDONE) spares that horrible inline comment and > more > importantly selects the right bit. 0x04 is bit 2 .... Plus wake_up_bit() and wait_on_bit() want an unsigned long, but tsk->flags is unsigned int.... Moar staring....