From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 0A1A53947B2 for ; Thu, 12 Mar 2026 04:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773288983; cv=none; b=edks8cpsQ10SM+prII4xsU96j+XhilderJjd+pkDEokdRGa9JiTcMwNf0gjF35j02dH2bAezk/cxRfRFi1qsms3ZmQahYdhjxxY+0s7YNw67DrljSiPmoQDndjgvO6kYuRaq1zYPYdyQvoa/17qU5Gaf/uBmgajOAMHKAsD/5kY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773288983; c=relaxed/simple; bh=pgH5Wuh7SO9VfeqQ2SHlF+khVJvtUgCwSBU2kMtzHWM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NCe7LcM1mP1xcGdnpeIRJwnzAUvwsH+d1eUehaH5b+Xb1zE+u9BWyhw54X36porLwq1ZMBLrzIoW6n7x0q9j5XyHqEUHQqjG2yX82Z+68H+inmoTdzCmQ8nhzoeTcwMNpAQGJMI/8ThL3FTjw0gj+Ya1SvUIPNVUIvifperGJAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=shopee.com; spf=pass smtp.mailfrom=shopee.com; dkim=pass (2048-bit key) header.d=shopee.com header.i=@shopee.com header.b=jmccxv5k; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=shopee.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shopee.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shopee.com header.i=@shopee.com header.b="jmccxv5k" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-c73967cf77aso198956a12.3 for ; Wed, 11 Mar 2026 21:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; t=1773288981; x=1773893781; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=MhwVEJ1jJKHsVGKZZDwnOv+DL99Qt0PgcKelrAIpHWw=; b=jmccxv5k449VBUD1Avdl1YHNoVR09gdsZF+bA9n7DrAXV1VqLXAnc/YYgBVS2LIQzl d36aW2V1HqhDjdEQjEAvR2t8xJ9iDQurVJ0SERAn9rksQJpSNlPgelp9VeuqwiCEN7go Mm2OQ9PQMPQb9/SBVF9zmBIkn8ZKQzd8z74i+buyJFY1dC/JIycB68pdU2rV3KJrVZny L2sufJJL+pPQif9tQ5smJU7f8iU4a3muGRUDPWEMhKng1jRFgwflgKu1cFWLImMbNvex Cruc7qzdRUPdHo1c/G278oQWdVjmZdu2aE1frMVPi0WCIPgjCDOhjHpBoD0Iq+3ipsaO 3yTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773288981; x=1773893781; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MhwVEJ1jJKHsVGKZZDwnOv+DL99Qt0PgcKelrAIpHWw=; b=EAw+Kp613XePjuXzcKs8DijQBp8BpfY1knxdQ6b3damnYboFLL15IPS7Kd42LoEZ92 BNiGydHfCHP20OFb3IskwHzgwZtNr807CnamcUyQcK3mTPXJxINHtYoj5lCo7cy0dlzK 6nEswSBL9OfX9Bvrl8OxM6EvsRQ/C+9vwUbtQSBeRZX6y1O6ZxmpJDxx+/GYMIz3loKq vZb2WzbBHL0+51EkovkPO15pBV4q++IHnJeC8APpFGzLyPb+yoGM45wKuH/pUDdD5RJt Du2aYrVbSvcAWYcUu4njWypZnQCR3L6IM5KE50xyBRI8VXDa1rmjbu4PPmbYlK3x5rZ9 ISLw== X-Forwarded-Encrypted: i=1; AJvYcCVHdcvLY0FPb5Gpeqk9rr08mZ6dpEANdsy1PAgQu8EREHbwwM64r0TRZVEKP/wRfice3rFeB5xX4pNeBBY=@vger.kernel.org X-Gm-Message-State: AOJu0YwzQebC0uiRzb2aQuPuYUt3xgCJqzsHcHmfChQKJdtXl2q0e0g2 oFiOVifcnBNuaWMNyZWy1GLGbCrNiZ4oNbovVinMeEffLdiHagPiBflCUXKkSCimouc= X-Gm-Gg: ATEYQzz+NukjIOfotLkp5F4psjXkNH5F7DDbi87qzu1/fivjfTt0XIDRA2A8oz9m+PL jPojohL/8qzvfAnRAYX3dk5FCDXIFtzU/DXrc5by6fiBcMckrNtzJz3/jF4VXcdVMVu0FDHTjQg ktZdlnuXJ+u3+5FPfxnTJ0JFw/WVpxBcaozbOeXEGnUJjLDd9eLrkZFLWj9nLVhksoSl9PSBv3t 9ZEFar+SL6iZkHaT2AEzISfXJJ8M/AQy3diuy8s4v8dk4YqBe5dlwFuNQVr7474unDXgEWDXeih XDAoWqqIr3+AVZse+84GCIsqfiCh0nkB8VOSskp1KpqggRcBW8Crkfi2utVynnZ0JktX+QMHS5n B/vGe6hEF91X1IiLTDdRcWiC/CFxwr15WiIaWrMBq2BI516sed+dUxMwo9aUg7Yj9rn114laJfl 6K/IpIc7dXAT2Bc2hfe2/tBpdiqw6iORZA1LHa/dY07+a0Z50= X-Received: by 2002:a05:6a21:38c:b0:398:7c6b:8615 with SMTP id adf61e73a8af0-398c5e58d14mr4512612637.6.1773288981346; Wed, 11 Mar 2026 21:16:21 -0700 (PDT) Received: from [10.54.26.107] ([143.92.118.3]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c73cdf9f4f3sm3780255a12.25.2026.03.11.21.16.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Mar 2026 21:16:20 -0700 (PDT) Message-ID: <26ddcfcf-cdde-436f-860a-4cdf574e51bc@shopee.com> Date: Thu, 12 Mar 2026 12:16:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V3 3/4] mm: shrinker: optimize the allocation of shrinker_info when setting cgroup_memory_nokmem To: Andrew Morton Cc: david@fromorbit.com, roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, zhengqi.arch@bytedance.com, muchun.song@linux.dev, usama.arif@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260311030235.240953-1-haifeng.xu@shopee.com> <20260311030235.240953-4-haifeng.xu@shopee.com> <20260311141928.b4291eae43f99a2f6912cd2d@linux-foundation.org> From: Haifeng Xu In-Reply-To: <20260311141928.b4291eae43f99a2f6912cd2d@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2026/3/12 05:19, Andrew Morton wrote: > On Wed, 11 Mar 2026 11:02:34 +0800 Haifeng Xu wrote: > >> When kmem is disabled, memcg slab shrink only call non-slab shrinkers, >> so just allocates shrinker info for non-slab shrinkers to non-root memcgs. > > What happens if memcg kmem is enabled later on? cgroup_memory_nokmem is a boot parameter. If memcg kmem is enabled, all things keep same as before, root and non-root memcgs allocate id from shrinker_idr.