From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C188F23C4FF for ; Fri, 26 Jun 2026 09:39:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782466800; cv=none; b=qWc74TVKxMAq4tSlDvmq1PSjjeWKxcQ0rDpEKhStyAz/rCITbMEawXdZupU8lzkS9jIJqb1zUbEOOMy8n8wpi95MawWXsRu0Q/QS7uoKv6imWlVKQ5BPXWHpKZ9KsFdrvHvof6qhXF64fgW7Kq22P4jZqkxbzMtlIRvL0zk6OgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782466800; c=relaxed/simple; bh=9XEkSyx4rpuWC/zLRuDgN3PFQFALOZecikzTfjtec/c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qcu1DI1Rfm6tPqkIMi73u0yvMk1wf8UxcOle8cMGdR2Gi5sxCE23FPfZTTzQX9QwfKN0FZi+WHtdltXcndBx0ex5nXSc3EAGoUyuhlsfbTMfJ3tedMtoMW6z0xu/FkkNFVe/BCtWE3mrdZcLSvHx0RFqiWa6wxLwfrFXcfKFNQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=hOVShjV6; arc=none smtp.client-ip=209.85.222.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="hOVShjV6" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-92120eb916aso78135585a.1 for ; Fri, 26 Jun 2026 02:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1782466797; x=1783071597; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rbYFlDOdrRKL62BQTd9+XWo+imzEYyLX5XadmB2EubY=; b=hOVShjV60QH/eoDP8knLL7NSLULzmaWYTo9I+DNSVCI6GNNNfwS2izxk8lml+MhQz8 08Hj+zFhXkXNKGID1+P8Uzs8H+5hRBZ8JScyija1mli22sYmy6o5WoKsjTfBpZXIDKNu g05svHcQFli1+lJ0c4pxhaTStLREG91gj+6RX22HGVErXF9pu+wxj+4TRtetsAoghHIL Onpss8D3UQx2G4mV6usvf1ywa2f2xakXfDhjgb6uPXyxFFvilboDG1VyZ8k2stmhRne+ uqSngmzU9aP7DLIuao63USjZuKHaPc328PYDhJqw1Ue5DYVdNTsuGA5CkDSKAQL82ish uUZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782466797; x=1783071597; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rbYFlDOdrRKL62BQTd9+XWo+imzEYyLX5XadmB2EubY=; b=fvvsE5EhjJ7O5oHruVNCx6hXw7a/4A0svUAt2i4B1N+SBfDlBpzW29uXl+9Lzl3EQZ wQ/uK4TKKCGIBXCscqHoWCjvmyXp/MloyAqqD9TW7jDzp7tMh9XR8396l64ds6MaiSEI PeoWuJqwpoFHwq2YHFI71nKnXU+y2+6un6P3uaT5/jIp0QImvl1Xa2flvrshhu36Ie+9 PfOH9TMjmzLZ7yGSmow0iYLUTHQHkWy49zCEXI6sTOhb39wDelKiJM95Uo8wYGLVitvG OGuzPeBEC9TCLbVr2yw1RhcKB436HwUWsu3YFrOvdOeC/NwW2mf+PS4H3JuYik1vLhay pc9A== X-Forwarded-Encrypted: i=1; AFNElJ92LXX1s5LajDZQnjzBis8nD8zzmooqMyZ+ElVhIoF6M0+eDpWqldn/SdksmRuoBKqXkbX4WPAo6xWjqhk=@vger.kernel.org X-Gm-Message-State: AOJu0YzPTaZNubagEUTjEv6YkU6SUq2vHKqDAu05lG5Ghv0TEQrpvjhT 9Ts1WIwwfa8icdUVeA4yojO48PKNHgaJWqergJMb2cxZhKCwsGupP3vtmVHmSomHGMM= X-Gm-Gg: AfdE7ckl0tnBAQKiBXuvnkHhinCSqvQey6TNKVctWyg8vC0HbSpuh8RHrSSfaxtTtmn UED6YXsRFxGpzbfizHfx4kpEegwYEjs9kfUxum47S5M/7lEIQ5WQz5U5P4VntdJrPZHxN2GDBKD zppuVsAjUj/vmOBm4JllnmaJOFnWc2yGnYbgCBwJTZ2ZZtGOwekOad2iGuPzflaFfyePBqrFy1z C25AnSxKpudQEmh8aqexoCNhjJVSwRQARPKsXdCJX+93ZVRs7ugrqE5BfKxY0Ie3rrdvPovky2b xQWpRy5d7RMbRN6F/tPPBV7JoD590jKjefUL9+JICpYxUJytHuYpaW60B6giXHk5gEAITAk3PhP uyTQZ9e3hjaLWNc7Xl5AN8eRkDrp56nrr5ou9iu2bB18NcfO3Wkl5eegGkTRTWgTo57AUz/h3lo YOGtCav7RN68M= X-Received: by 2002:a05:620a:4056:b0:915:8f76:8005 with SMTP id af79cd13be357-9293cadf811mr996276785a.47.1782466797609; Fri, 26 Jun 2026 02:39:57 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id af79cd13be357-925fd391b22sm1107164385a.2.2026.06.26.02.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 02:39:56 -0700 (PDT) Date: Fri, 26 Jun 2026 05:39:56 -0400 From: Johannes Weiner To: Qi Zheng Cc: Harry Yoo , akpm@linux-foundation.org, david@kernel.org, kasong@tencent.com, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, muchun.song@linux.dev, peiyang_he@smail.nju.edu.cn, mhocko@kernel.org, roman.gushchin@linux.dev, ljs@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng , stable@vger.kernel.org Subject: Re: [PATCH v3] mm: mglru: fix stale batch updates after memcg reparenting Message-ID: References: <20260625151554.55105-1-qi.zheng@linux.dev> <4c7b0c46-14f0-4a62-893e-e50714e09b74@linux.dev> <46ac28bf-5be1-4600-b522-0a1aa76c28e6@kernel.org> <08cf8972-6cfc-4452-9a3c-88e0368dbbf9@linux.dev> <90fd5300-1016-42e7-abad-08ad85fb62b4@linux.dev> <5a0c6597-6b96-4781-a71b-fd1298b2b7bb@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 26, 2026 at 03:04:17PM +0800, Qi Zheng wrote: > On 6/26/26 2:48 PM, Harry Yoo wrote: > > On 6/26/26 3:24 PM, Qi Zheng wrote: > >> On 6/26/26 12:59 PM, Harry Yoo wrote: > >>> Observing a dying cgroup should be rare anyway, it's worth focusing > >>> more on readability? > >> > >> While it's rare to encounter consecutive dying memcgs, it can still > >> happen, right? > > > > But is worth saving a few instruction in a basic block that is > > unlikely() to be executed? > > I don't have a strong opinion here. Hi Johannes, I'll leave the decision > up to you. If necessary, I can send out the v4. Yes, I was thinking what Harry actually bothered to spell out ;) The race is rare, multiple levels even rarer, and even *then* mem_cgroup_lruvec() is a quick inline. This way you have one block to handle that one rare race condition. One place to put the comment. No labels, no goto. Simplicity wins :)