Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp651140ybb; Thu, 28 Mar 2019 09:28:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2zeEsbkZLfC92R3tPvFIPTTmsYgSGIp4sjTT4hR31FP90oauJ60jtnafLK103oh9G1sQw X-Received: by 2002:a63:6fcd:: with SMTP id k196mr28878860pgc.238.1553790498778; Thu, 28 Mar 2019 09:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553790498; cv=none; d=google.com; s=arc-20160816; b=IraPX7BGixKAnZTyytGLIgi750T2St1hF0oYAu9Fcly0JrUMOTXNfUZ4dL0YTEEDQm kNgIxET92TBEktvk+jNJWKRhpw4EMWMWV0I2IHs3AydPOPztdI0beE4R/EqTiY/LPV11 R0kTmMq2mNYzHr40Ry6d26tojhl9VTpyIJCgv/4/LJJJ4WMoDpYuqHsEKnCqMeWF2TiI 7xaVNw4CQJUdb2fWYzcc6Q65q8KePBKiWcEQHDbxCW5yW4WmpmfNCKhHOeWOuEY39dVw tlnFCllx0A9/Fu3u4k0QjfKzCcrDXVbFVqrWbwtZfQWeKHCq/s1948ndXXCxGSJcIgP6 RMMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/JFTzq38SmZdGIRpLTksapWJY+GfLqSlrRVfIxnTvNo=; b=RwARBZb/icBYZniioJg4Q4WVJYNv3fbLocjJmHLDZLLrpx8+Ykb1TmPLUKtkU8l2e8 xPMIWPKXKhnrxomgCOGrDHC+JtIkRrhTTwb/tllTWNhi1iz5dRjhMVDJIRoSXl2p8Q3c EJ8W2TW9GY2B5b0jMv/MxJCaLQZ6TvCfW4QdHvXJXMAGgOVhO5bAUEc0eSOf66moP3Xr /Dx/oG0O+Ize5lKTRRtUsBb+Qn4PUQFISFPE5vx534YakKOsUR0GPL7Nj1OCPEZM52H+ AkvAqvfi4SNKyJXSFDnu8WKbxVellfc3hSp8xM64WpShRiQ1WszgisoEgI5dlp9qTOM7 oUHA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si7338849pfh.249.2019.03.28.09.28.02; Thu, 28 Mar 2019 09:28:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726453AbfC1Q0q (ORCPT + 99 others); Thu, 28 Mar 2019 12:26:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbfC1Q0q (ORCPT ); Thu, 28 Mar 2019 12:26:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C89EA7F6B3; Thu, 28 Mar 2019 16:26:45 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.68]) by smtp.corp.redhat.com (Postfix) with SMTP id 3201B608A4; Thu, 28 Mar 2019 16:26:43 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 28 Mar 2019 17:26:45 +0100 (CET) Date: Thu, 28 Mar 2019 17:26:42 +0100 From: Oleg Nesterov To: Jann Horn Cc: Joel Fernandes , "Paul E. McKenney" , Kees Cook , "Eric W. Biederman" , LKML , Android Kernel Team , Kernel Hardening , Andrew Morton , Matthew Wilcox , Michal Hocko , "Reshetova, Elena" Subject: Re: [PATCH] Convert struct pid count to refcount_t Message-ID: <20190328162641.GC19441@redhat.com> References: <20190327145331.215360-1-joel@joelfernandes.org> <20190328023432.GA93275@google.com> <20190328143738.GA261521@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 28 Mar 2019 16:26:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/28, Jann Horn wrote: > > Since we're just talking about RCU stuff now, adding Paul McKenney to > the thread. Since you added Paul let me add more confusion to this thread ;) There were some concerns about the lack of barriers in put_pid(), but I can't find that old discussion and I forgot the result of that discussion... Paul, could you confirm that this code CPU_0 CPU_1 X = 1; if (READ_ONCE(Y)) mb(); X = 2; Y = 1; BUG_ON(X != 2); is correct? I think it is, control dependency pairs with mb(), right? If not, then put_pid() needs atomic_read_acquire() as it was proposed in that discussion. Oleg.