From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 BABD51A8F93 for ; Mon, 20 Jan 2025 09:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737366056; cv=none; b=eBxseyRr67mvUggbDTi6jwmJ3qdUfFwpraTtceK25KZ2cfwgMOyz1c2kn1mxTZnGmwqAmqzsBeRquJOzCEUtnP0/14/bvHF6HBHMG30ftdwi7Kj574yAKzrpYJ8tMkJQa9N1azhPX33m54C3TqREMIAjyxpk07GLq5Xb5tsaWcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737366056; c=relaxed/simple; bh=jGAuDk4ODppPL0yi45/0osBz7E1mny8BsvEuH80d6ag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z78/OmsxsXXnWeabCNnqI/r58aCw+F0ltwIDav+3WuvPtQAwtSRhLaDkv/xaNEQaW4v8htAhgEaspycfIF52SJNHCY3BbvnCo8yRAQlp75nDoztZCh9zlvYQ0nRtCV6rG+gCetXX7Bq7pRQMqV+JkEexE4cgZJtTYhPYGSZGi34= 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=L3l9f683; arc=none smtp.client-ip=209.85.208.46 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="L3l9f683" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5d4e2aa7ea9so7903086a12.2 for ; Mon, 20 Jan 2025 01:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1737366053; x=1737970853; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yPKYIW+/1BswY6JPHJ5KhjmDv3E4BoFMuuugSXDPRmg=; b=L3l9f6839oeESHI7wG6LOqUYdeAi2BAbbZ2AeLF3VZqNGpKNZNBgUkU21WKHt3DM04 aCMMiT71S/FvQb4P4Txp8hxQ8aX8wz+HhmP6bbwDxh6Pf3gP8tDhf5EokZzkBODdtLK1 +n2Zqcb23P9Xe8/baBFQh+AxUbfQa2zXWSL3PCuMjLOCZyXpRI2hBOYQwC758a68WGxc pFgltv9s74uUZv5Gek10QaMNfw7asRTyKP/qsA2cijFu4TUKShXTXI6cfjHAhrg0sy7d h3WTQ5Mk8da9zTQ267bI0XWWZIEMJ9/j2o/68B2rCAJ49WETB+ud9VqBz2FxKK2PiuPO 2k6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737366053; x=1737970853; h=in-reply-to:content-transfer-encoding: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=yPKYIW+/1BswY6JPHJ5KhjmDv3E4BoFMuuugSXDPRmg=; b=GLBWId46+fKmm6ZL+7FQ8i9Z7lAp7uHOlZjWbfQojy1JLuzeRIWf6Q0X1/H7M1U4oI 4tZ8cNSX/SDzbr+RLDD0zuxey89Ua7W4/lfFLrZDgOxW2SHfWKuv60iFJNNK/SLVHNXp UejV+d1iZGHnNZMIYtagfLr/HfzEf7mApsd3rtYBVja2O5vaywlpF8JdWb2wJt8zUOJg dtvHsud5tIxSW3WsGD2CPpNGC9GoNjC5xUMTaWgJNEDy6NJ7puFYx50oEwa++5IRDKT4 Oas8IxTZNCEa7Du0yb8BBP+k1sH9if2/yuvxz+3rRpV0b3v5NsfzivkEqUoad7gLhOXc rWNQ== X-Forwarded-Encrypted: i=1; AJvYcCVoHDzBBFYXiEM2Vh7kYjnQQKJHYcowqDmCScbf09/I8yUU7KYDnxB0xsRn6/784idCMz/3doirPjMRfec=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8TcBtjvM7LGbn+u1wvce/ATts2YSlDq7J7k9Pq9Xa6Db2WK2y SN6ikmRNf0dkn0SlT772LRUeBP759CFrSv/E6whUpBuWX7PyOkO0M5R+MCb+WpU= X-Gm-Gg: ASbGncsX+x6NGCPpLd2gvVPr/0gV83T0Mhcb3otmeHG4a4thzUf2j7jvm6L8C+YXRnb J5bjZgO/AbxB0Lk0Vox5DiOc/awoTQV6+Hf2iyMnolkuteJENdsG2wVP1H1u8dgHGZ2GOrTg0l0 Dozxb7p07Q+dTtcjX1Zv88DqK9JIUblAISMnrRYFRl0pWzxKmDJzimWj32cuNcYoKn5TGqa2Mmw WbNn8uoCl0P+elXM1tEZLeZ3KL/LRJvxNrC+sKdG/XeiWmGirScoYxRco/4tmHAtAyVJXp8W44c Woxq3KU= X-Google-Smtp-Source: AGHT+IFA2mrrQCmqsHXHh3qM1OB0JGHDkTSHTxhU+WYqBMFAdjqFLOjNjtr6V6ka7y9doZtbRAOrKg== X-Received: by 2002:a17:907:7da2:b0:ab3:84b5:19b7 with SMTP id a640c23a62f3a-ab38b52ed37mr1243807866b.56.1737366052904; Mon, 20 Jan 2025 01:40:52 -0800 (PST) Received: from localhost (109-81-84-225.rct.o2.cz. [109.81.84.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f86244sm592211066b.152.2025.01.20.01.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 01:40:52 -0800 (PST) Date: Mon, 20 Jan 2025 10:40:51 +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> <3156c69f-b52d-4777-ba38-4c32ebc16b24@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon 20-01-25 09:22:47, zhiguojiang wrote: > > > 在 2025/1/17 19:43, Michal Hocko 写道: > > On Fri 17-01-25 18:25:13, zhiguojiang wrote: > > [...] > > > > Could you describe problem that you are trying to solve? > > > In a dual zone system with both movable and normal zones, we encountered > > > the problem where the GFP_KERNEL flag failed to allocate memory from the > > > normal zone and crashed. Analyzing the logs, we found that there was > > > very little free memory in the normal zone, but more free memory in the > > > movable zone at this time. Therefore, we want to reclaim accurately > > > the normal zone's memory occupied by memcg through > > > try_to_free_mem_cgroup_pages(). > > Could you be more specific please? What was the allocation request. Has > > the allocation or charge failed? Do you have allocation failure memory > > info or oom killer report? > Hi Michal Hocko, > > RAM12GB, Normal zone 7GB, Movable zone 5GB. > Issue: kmalloc-order3 fails from Normal zone and triggers oom-killer. At > this time, > there is no order3 memory in Normal zone, but there is still a lot in > Movable zone. Thank you, I believe this makes the situation much more clear. It seems that the Zone normal is too fragmented to satisfy order-3 allocation request (the amount of free memory is above high watermark). That means that the focus should be more on memory compaction rather than reclaim. And more importantly at the global level rather than memcg. Also you are running quite an old kernel which might be missing many compaction related improvements. I would recommend re-running your workload with the current Linus tree to see whether your problem is still reproducible. If yes, please report along with compaction counters (reported viac /proc/vmstat). Good luck! -- Michal Hocko SUSE Labs