Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3174669imm; Fri, 20 Jul 2018 11:26:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdglI4EaZ9poCSK/M86q+4ZvmYrKHlWEa8Y937Rw9Bp42T3tXlopXMdhTVIwxgldK5YjVtj X-Received: by 2002:a17:902:7683:: with SMTP id m3-v6mr3055307pll.255.1532111201237; Fri, 20 Jul 2018 11:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532111201; cv=none; d=google.com; s=arc-20160816; b=BuOMqm5qgXbytsW/RSzhpcqrOmlZPN9GaY8974jHjmyQMhT70IXf0/8Vp6BHB7V8Mf C+a/lWIZnsJ4UbtO5uR/uvTtJhckZzxP/uBennORn8BSzOei6UGtbkHYTr1YYR63wqmW +2EoylD4tDItV6XnUQpOfQvvXXcZgW/fG4k3QFbj4I9OwY7/C05UZDbChxAX/1c934YX FjdJZVJW19CkRHgYm/lWNx5vAo3f3upWxZ/r9INbW9oWPW1CEmRglUPcKx8k6In2p+aR L8viVUIdjKvQZ7Nc5A+Pkm3J1PBb/TbeYbprvKsHQGYt9xlWC06DxnxxQvjWTw8t+IRa AVIA== 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:arc-authentication-results; bh=7+sKF2TYhf8+SOxT4+NZduq3/kQ+TBw2mblq/H1BE0s=; b=fo1qXdShMOqmehzGM0RIwfu+GuVAVAdS5hSSBUnl+CUetvGVsrFvqQGmfwsq9LBbw3 TIeQQX2wsHTIKjUlwK0VgbgthsyBX3bX0PP3WakMDVqanzkY4hI5bqHb2+5qmXzOhqdh ycsq7o5Z4BvjbvnnN7EzkBeIzj1KlWJrWzccn8IeyYnjKvaN5driSDIVHJAKzyuItaHQ pNosUKqJVvMwTpcowC4wQeuF9TCehJT49Vdm5bd2TR2Jtx8lhe+2pLxoAX86Ryr9uDca Q3FARJOoJvFPYhcexfTQiYb+7Tw0jAqohiPNB1Qz2bA1YTrDrW/M5yiD3UByBlS+Q898 wOqg== 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 d30-v6si2102308pla.64.2018.07.20.11.26.25; Fri, 20 Jul 2018 11:26:41 -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 S2388266AbeGTTPM (ORCPT + 99 others); Fri, 20 Jul 2018 15:15:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:39400 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387994AbeGTTPM (ORCPT ); Fri, 20 Jul 2018 15:15:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9F2F0AD1E; Fri, 20 Jul 2018 18:25:43 +0000 (UTC) Date: Fri, 20 Jul 2018 11:25:34 -0700 From: Davidlohr Bueso To: Manfred Spraul Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH -next] ipc/sem: prevent queue.status tearing in semop Message-ID: <20180720182534.2u2fh5i2cyhd7owo@linux-r8p5> References: <20180717052654.676-1-dave@stgolabs.net> <7909e12b-6dd7-e28a-010c-003545a8e4b5@colorfullife.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <7909e12b-6dd7-e28a-010c-003545a8e4b5@colorfullife.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Jul 2018, Manfred Spraul wrote: >Hello Davidlohr, > >On 07/17/2018 07:26 AM, Davidlohr Bueso wrote: >>In order for load/store tearing to work, _all_ accesses to >>the variable in question need to be done around READ and >>WRITE_ONCE() macros. Ensure everyone does so for q->status >>variable for semtimedop(). >What is the background of the above rule? The fact that it's done under the ipc lock, doesn't mean that the compiler won't try to get smart. If we have lockless accesses we musn't see partial stores/loads. > >sma->use_global_lock is sometimes used with smp_load_acquire(), >sometimes without. >So far, I assumed that this is safe. > >The same applies for nf_conntrack_locks_all, in nf_conntrack_all_lock() Oh, yeah I remember _that_ saga. I'll have a look but iirc it seemd ok back then. Thanks, Davidlohr