From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 409A925A659 for ; Fri, 17 Jan 2025 09:34:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737106442; cv=none; b=IIdPTivacTFoIzmc+qo7t/PIcni/UUz7oRSJsKupcz2kVMPU36Xz+7GLyPfxZPMvVRIGxfjLm+eUd1c8RybdkPKwykjkGOODFT+yoN4yjb7MVGkURxXlyhdYzYZ4j6EUTLzEBn50PfQJr3AYA2nB9MUjjxwFC9dbV1Wf7K17PDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737106442; c=relaxed/simple; bh=cnITsTvGmNqhJGWq2jKzgEF3ZQHDwDL3o92KopbghWc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QZi9PRp45fOjyYK2wQd+e3K//1SiXwdgkv3iF/KW2+bZ0H2wDlEyngmiNwxvEF66y/zEN+yqFU+PqeauKPfbEdYISWvXNVVzC66enh51+c0ylfzXixhLg3VqHAF6kqHbvLV+MwUumyr7x/a6bKz60g4IqIRH29quCYLR68MtJhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=gkQWfE2z; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gkQWfE2z" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso11494735e9.1 for ; Fri, 17 Jan 2025 01:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1737106438; x=1737711238; 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=DpEcDbL12pVoi7d2pYABiZaYKE4gVvTaOXo3VG2boqw=; b=gkQWfE2zpPs7mEBNlUzWvrbhH73ncOPsixsYNn/GDGsflZiz+s/MT2GiKBvM5TwSfZ /iJNWuT657Syofn9nCK0naUtPYVFKjvGVELgKfeUcB+lkAPMWkw3Z2W4S+J4NdgqRw3q 1kXkRvBTEHEIWyvCWIRhRkNuj7dZXrWS8alCBBDH/Hi2XFjlNLTB+cWP6LLkOqyWMWxc XxQ8MNjKzgUk3DAe8qxH2/w28fzAjtFe1JgPqfa5rJ8avDS11uSPFa/TKtGx8s6Lf1HI MfbIsdubIUd53GCMKAvzEi8pmJ6BPRs+FL0wo/ZXIs+Snc5C5DOQNyI7V3Ai4cQzPqU0 XAKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737106438; x=1737711238; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DpEcDbL12pVoi7d2pYABiZaYKE4gVvTaOXo3VG2boqw=; b=J3S+EtoW7TOdNcTuXZ2iTkfSY7PdwwFjbhEeb56r1EY0iI9s3kXrQ3ez2+HmYnEat8 sWPlcvZzcatCyA2ubzLQedjquLv5Oa31teyiShPBzL794Z5zqdUS2kViCMazVHc91uvP J7FrBOHkyx2hd+hMOHkZpqIofDGHA1RkAWWDqvw+YEykTKXFizLvjGJsNhlFOiiOPjDX 6MJokkCahYgSpWgsNJgcwIycBQ+W+3otfiLY6/960CbywVt/fI8oyfe4LNi3RCIdBTkn niAMBqX833tdY62H5NgBTd6YsiRrTwrPeAV3sQ2tddTqfEX5daEZgrMQknSha4KzDf3Y kvWw== X-Forwarded-Encrypted: i=1; AJvYcCXFWDPsGaEpqo7SPrccvway5v0k6ACSxKevolpgPC21iHce254MUljEdFRyO1L2dSs03mp3RnnFDZlRnZU=@vger.kernel.org X-Gm-Message-State: AOJu0YwSL0yG06q4WFEV1GHBr9nOsHLLgNi5DY55tDrYQjySjZl1622H FRkqeNwxl1zNbACC0VBewfDIPyHfX8p+Q2+XxwICF3JWWJGt2KyVew5oIPY/SY4= X-Gm-Gg: ASbGncvx989MJNlOGkiakJSr/MVD8HACeVAJgS8c40N/KxaA9w9ShaMlno/kGKo9/kj cIzjS0QxaFz8/eu2o8+kWaX/vc4rNzdH376T9pfYuPE3vV60RRScGFPbNqhkKBZSQcCva//sij7 L+cjspz9o8f0Zkn/N0SBbmChu8u3tv1rDIaRO3VSn+8XdBuFMGWGiMPHbzgJbfKSlHldj++CyAc Gow+bcuaidrY4waFbR/6KEKnXrn08EIflq8c8Lt2xfTSf9DOWtFb1Nn/U9Ds9Ht5RFEfg== X-Google-Smtp-Source: AGHT+IFFj5UxXG8t53dNKmaUTxCG+4Bqsl1WEiLZQzzk2+K5RgvbOuitcW8UcJVnLe9LnQvdnrJyeA== X-Received: by 2002:a05:600c:3481:b0:436:fdac:26eb with SMTP id 5b1f17b1804b1-437c6afdb21mr94369605e9.7.1737106438583; Fri, 17 Jan 2025 01:33:58 -0800 (PST) Received: from localhost (109-81-84-225.rct.o2.cz. [109.81.84.225]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43890468869sm26761175e9.35.2025.01.17.01.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 01:33:58 -0800 (PST) Date: Fri, 17 Jan 2025 10:33:57 +0100 From: Michal Hocko To: zhiguojiang Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com Subject: Re: [PATCH] mm: memcg supports freeing the specified zone's memory Message-ID: References: <20250116142242.615-1-justinjiang@vivo.com> 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 17-01-25 12:41:40, zhiguojiang wrote: [...] > In response to the above situation, we need reclaim only the normal > zone's memory occupied by memcg by try_to_free_mem_cgroup_pages(), in > order to solve the issues of the gfp flags allocations and failure due > to gfp flags limited only to alloc memory from the normal zone. At this > point, if the memcg memory reclaimed by try_to_free_mem_cgroup_pages() > mainly comes from the movable zone, which cannot solve such problems. Memory cgroup reclaim doesn't allocate the memory directly. This is done by the page allocator called before the memory is charged. The memcg charging is then responsible for reclaiming charges and that is not really zone aware. Could you describe problem that you are trying to solve? -- Michal Hocko SUSE Labs