Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7541495ybp; Wed, 16 Oct 2019 10:10:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYlk0z8puXEOCf9N2qMWunf2cL77Czrb1DYxeCd/4cU5VqijEPVRHYzv4Ago04RyCIFLPi X-Received: by 2002:a05:6402:51a:: with SMTP id m26mr40271338edv.298.1571245831615; Wed, 16 Oct 2019 10:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571245831; cv=none; d=google.com; s=arc-20160816; b=w5EAnG0tsoDiT7oQkH8dkLL1iHCwrdDDvs6pcVIeajLjFUtbYt6d5WktFZBKInd0rJ 4tfq9fzx2yUJH+220UFrUfWl2Sl9ft/uACJFNkGpMmA5r0ZDbWVk4lntN9Xusfx8953g QEO/D5mqBRkATdboz9MY0aZMhsxldlGibmiDH/TS7b+hvA1nqcWNNG22yPOTPklLHoEG e4+YurcI6oAZKy4MuP3G5Tu4TYB+Zix+oXRcpTqR0CkEViMNPB3bu++rd7TrRXQI9MLb 1CUHxxs5JiRj3KpVcOdlYR9MfiZjO+B6Dr1dauJKExsnhzA48AAYc6ZY+XFwqt+aA/IK 07qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=1Vntn77riZ8a5tXm3N6d8FcGi6d6u8GQ4A+Am284rl8=; b=KSySnE+GVW7WgIe+CiH6vTpdMxC3BHmXr7ZJsA7SMPqKbAtcUlyljX1KMnU0Qbud17 XnWpiXRVO662v8YsdsiJPsQETKNgQgIY7kG5uyEKTgsRFj10LSbO+dxWaG0JMtH0J5nI JJR/0DBwBiv1A3O079CMfXYFUikkLJrVCKkE9hM8DM5odNuqEmtIvuU505LmxFF4gv3o sZMU7A4U2gMqErSECsNf2x2MRqkf/0L7f/R/QK++pPKY2/9ulKzrWD+9FutciEuLrMJe nzv9su3rEeTCewGKtpoSSjKx63U5ipB1OHB7gRdWQ+Ahy3uP2bMXw4kEqmU03hPgak5U Cxmw== 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 o14si15185628ejc.421.2019.10.16.10.10.08; Wed, 16 Oct 2019 10:10: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 S2394155AbfJPPaD (ORCPT + 99 others); Wed, 16 Oct 2019 11:30:03 -0400 Received: from mx2a.mailbox.org ([80.241.60.219]:61477 "EHLO mx2a.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbfJPPaD (ORCPT ); Wed, 16 Oct 2019 11:30:03 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2a.mailbox.org (Postfix) with ESMTPS id F1804A1834; Wed, 16 Oct 2019 17:29:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id kkkccsEGnCco; Wed, 16 Oct 2019 17:29:55 +0200 (CEST) Date: Thu, 17 Oct 2019 02:29:46 +1100 From: Aleksa Sarai To: Tejun Heo 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: <20191016152946.34j5x45ko5auhv3g@yavin.dot.cyphar.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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xxhpmezvextnbaiz" Content-Disposition: inline In-Reply-To: <20191016142756.GN18794@devbig004.ftw2.facebook.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --xxhpmezvextnbaiz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-10-16, Tejun Heo wrote: > Hello, Aleksa. >=20 > On Wed, Oct 16, 2019 at 07:32:19PM +1100, Aleksa Sarai wrote: > > Maybe I'm misunderstanding Documentation/atomic_t.txt, but it looks to > > me like it's explicitly saying that I shouldn't use atomic64_t if I'm > > just using it for fetching and assignment. >=20 > 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. > > 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. >=20 > 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) --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --xxhpmezvextnbaiz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXac3ZgAKCRCdlLljIbnQ EgBeAP40qsKIa/xjyp5QTDwPZUTxUPFnsAGGUbniwVLQeb2vXAEA+tT7cTDK410D c5RreKV4Dwzp3kNtNNHnA5BxvXioJAI= =kEi+ -----END PGP SIGNATURE----- --xxhpmezvextnbaiz--