Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 098A2C636D6 for ; Mon, 20 Feb 2023 21:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231582AbjBTVJy (ORCPT ); Mon, 20 Feb 2023 16:09:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjBTVJw (ORCPT ); Mon, 20 Feb 2023 16:09:52 -0500 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 571721C5BB; Mon, 20 Feb 2023 13:09:51 -0800 (PST) Date: Mon, 20 Feb 2023 13:09:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676927389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8JBYS9FvWj14eT3JNuqmdGK9JV/xnFH80x2sQQSrkTI=; b=ddyUu3zsm6Y0+vR74DJIcnENOFBU8ue0+E83vkrKf6R+AXgHiE5UZ30o4jj02lbdkPvcYt hUCpldBu9NYSmkpAO3+ReRrGa6FiNIZdA+U5woA1UPiRVI9z6yNGlYdYQvvLUTggIAmbrf IhM61gJLeSwVxu90+kkRBSSiNec/GKE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Yue Zhao Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, shakeelb@google.com, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: change memcg->oom_group access with atomic operations Message-ID: References: <20230220151638.1371-1-findns94@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230220151638.1371-1-findns94@gmail.com> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 20, 2023 at 11:16:38PM +0800, Yue Zhao wrote: > The knob for cgroup v2 memory controller: memory.oom.group > will be read and written simultaneously by user space > programs, thus we'd better change memcg->oom_group access > with atomic operations to avoid concurrency problems. > > Signed-off-by: Yue Zhao Hi Yue! I'm curious, have any seen any real issues which your patch is solving? Can you, please, provide a bit more details. Also, WRITE/READ_ONCE() don't generally make operations atomic, they only prevent the compiler from merging and re-fetching reads and writes. Thanks!