Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp140558ybp; Wed, 16 Oct 2019 15:21:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3fuiTMrVPwdK2IqnCHCh1/CXKRVqelGbjtNMtLNyHXouEPhpYOmVn/CGMqOW8/pWMcQQg X-Received: by 2002:a17:906:184e:: with SMTP id w14mr642752eje.10.1571264492687; Wed, 16 Oct 2019 15:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571264492; cv=none; d=google.com; s=arc-20160816; b=S+YbXJROgIzW38dvj8UTDZfr8ktGxGbnnEQZbW3nJCRe9hFk74xiiimwP/oxHMx4TO d4990sNPYaoIqwRdzlF6zP4hP4RXinQMqHsR+tqh4wI0gDDmx2UqTT7DirXEb83MRu++ zMNgsvy6fddpJxoRlSTI0J+bybNkDn7vOLagknu808pHKm6+9QEz7Hm6BXqBp9dCqnee BAGi3+oQ9MtnveJ9SXFoJ1lch6k+JrbmW5u9LdzB2mcIdaRwjLcOGCpT4Tv6BbgWkvhB 2jPV2Z6Px201kmTqcdEVIZBu1LFsa3JwBqpWXRPS7ELrXr3wytMsxNt58v+rgAuAWMJq uSew== 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:dkim-signature; bh=T9N8Qt/Q4T/fLDKFrE/yGjdsJz9c4IKV5iMQVuzGrps=; b=C2HsZi3uGxNezM0q1XYBQCvDZf+fTChCVRuPI2+wckPHzJzUAOa3Xx/k8HsY5fWc2b S/M370DGO5hh5rDSDVSTFR/XxvLM/d2HKB/6SxEvRDSeRQC9KhEgzPL6wM8b88lu6tru id1/QzpjIuu4RSFzggv9a4rcEOjy4r+8+e4Uk/iosEqbAstufYGIrvEmu1VjtVH5WBqD 1mcn+tqKDUS73UFDjDiX4ohhEL/j4BmC1bMFXn6JWjXWk4w0dnKKPM6/y32AVcPysJRx lXMPk+1O4zHQP++5TNSKrcetu53uXXc/biUkibnF8ZDz5pEF2aJl6AI9IxjH1XtM0wff Wb8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="uR+B/8Kp"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si236797eja.273.2019.10.16.15.20.41; Wed, 16 Oct 2019 15:21:32 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="uR+B/8Kp"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404999AbfJPPci (ORCPT + 99 others); Wed, 16 Oct 2019 11:32:38 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34008 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbfJPPci (ORCPT ); Wed, 16 Oct 2019 11:32:38 -0400 Received: by mail-qk1-f194.google.com with SMTP id q203so23161583qke.1; Wed, 16 Oct 2019 08:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=T9N8Qt/Q4T/fLDKFrE/yGjdsJz9c4IKV5iMQVuzGrps=; b=uR+B/8KpPRzIhOBAr5vomaF58ezGmJX/eSypGMHunaNAhefJay3pXHyQMlfeT33DY2 E7CYU5KMl9Bvj6oHq9PBQ/vQ4QhvoLaD8r9wy3Id7EKa6ZnUkh9C8r0M1g82ZyAAcRsA F8+Xxp3LqG/0rsTC+TCAaLPer+M4sVHPnYCFLSQ8AgEKp+5dkJ5KUf5oSjb4BDsB9VnN LTdQU3BkzHyE+SgCrKzT8ogPqp79w2Z45xmDJ2QbmKgqdd1vmbWHGQW5kdpch5QSKCt5 9LN25GRra8d834gUX5t4Z/INq89v6v7FkHZNuYvqadr1h9sT7s7zYSlvpz+zY8zONofD hXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=T9N8Qt/Q4T/fLDKFrE/yGjdsJz9c4IKV5iMQVuzGrps=; b=TahZLGn8FfS68bbu4SCx9zK+NuY4PXmWieaqMVzW8thWVJo9cAmB79UgEAlf50cM9+ A9orCeUJ669l72Pj0cT5sD1J+Jr3C5hzO1Qs8RjrZtO+/jVYHl9ioLwSqT8JZFRQaY2k pe8VRrKN3qJFnXfwsse3uo+9LPyg52GF7Dgensavu6mp+IMNxQYLfUfEYnKshBBhahZi d8F5luQLGc94pWdlBFVIer1vT4S0ozto4+bwXIZwqL8OdKXTcTzYwcRh6DdaSx4IRLfb ZM4xqIX5XQzUqEWWfzLOdiJTSujYm7NZxhELOcY+KHy87o0hRwkfjMobMHd6c+K+gPPn 0nzA== X-Gm-Message-State: APjAAAXg2NsYSXtnHBkticKPKQ+LKMyF+7FxlNxZ0TFD4RoY+8yC4Uia aLBrVmW5SzJU1tdDPcU4MX0= X-Received: by 2002:a37:4151:: with SMTP id o78mr38324867qka.263.1571239956891; Wed, 16 Oct 2019 08:32:36 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::1:2d57]) by smtp.gmail.com with ESMTPSA id o14sm16778400qtk.52.2019.10.16.08.32.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Oct 2019 08:32:36 -0700 (PDT) Date: Wed, 16 Oct 2019 08:32:34 -0700 From: Tejun Heo To: Aleksa Sarai Cc: Li Zefan , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations Message-ID: <20191016153234.GO18794@devbig004.ftw2.facebook.com> References: <20191012010539.6131-1-cyphar@cyphar.com> <20191014154136.GF18794@devbig004.ftw2.facebook.com> <20191014155931.jl7idjebhqxb3ck3@yavin.dot.cyphar.com> <20191014163307.GG18794@devbig004.ftw2.facebook.com> <20191016083218.ttsaqnxpjh5i5bgv@yavin.dot.cyphar.com> <20191016142756.GN18794@devbig004.ftw2.facebook.com> <20191016152946.34j5x45ko5auhv3g@yavin.dot.cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191016152946.34j5x45ko5auhv3g@yavin.dot.cyphar.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Oct 17, 2019 at 02:29:46AM +1100, Aleksa Sarai wrote: > > Hah, where is it saying that? > > Isn't that what this says: > > > Therefore, if you find yourself only using the Non-RMW operations of > > atomic_t, you do not in fact need atomic_t at all and are doing it > > wrong. > > Doesn't using just atomic64_read() and atomic64_set() fall under "only > using the non-RMW operations of atomic_t"? But yes, I agree that any > locking is overkill. Yeah, I mean, it's an overkill. We can use seqlock or u64_stat here but it doesn't matter that much. > > > As for 64-bit on 32-bit machines -- that is a separate issue, but from > > > [1] it seems to me like there are more problems that *_ONCE() fixes than > > > just split reads and writes. > > > > Your explanations are too wishy washy. If you wanna fix it, please do > > it correctly. R/W ONCE isn't the right solution here. > > Sure, I will switch it to use atomic64_read() and atomic64_set() instead > if that's what you'd prefer. Though I will mention that on quite a few > architectures atomic64_read() is defined as: > > #define atomic64_read(v) READ_ONCE((v)->counter) Yeah, on archs which don't have split access on 64bits. On the ones which do, it does something else. The generic implementation is straight-up locking, I think. Thanks. -- tejun