From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 1DF7524DD09 for ; Wed, 3 Dec 2025 08:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764750955; cv=none; b=Jh7d5V+/nO14HP3eEfF+aBn7ZB0suBTG2P2n1lkPwZCrKQaTOvrFjK8NHGcl6nEnzDhRN5jvAl15Ok5hb0DyC4ygR1q1IHnLUjI7Us+5dXYkGHoO7en9ZbWlBkWn/R/uxJvNvI1sxCZ4gMNmsa0nGh7YAmLQNcRP1jdvnzz9qZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764750955; c=relaxed/simple; bh=qaDoTHwYCln78hCf/nhLjW3ZEOFrY40XxpZH0roEHNE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M5+HQXP7Ozz77YceM25wXI1Wi6aS+mLiRMwnXXtG1cAK6ECbKUO7sk2LY1RvnI6NWQqv/VY/GSQiYy4pPOy5fisUOhgMS4Ujvl9p17i0Z/R6KOqfbj34qTyIyRUsNTpdzCFtPqt7/z9LxBE5j8+HP4iRh/ydXNgbwIFk4CL3Zkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=S7anc4ue; arc=none smtp.client-ip=209.85.160.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="S7anc4ue" Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-4ee2014c228so48919841cf.2 for ; Wed, 03 Dec 2025 00:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1764750953; x=1765355753; 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=LA3Ic4i9iG/4Wuv4J3py+fbGaONiUwvROdkBn6i8vWM=; b=S7anc4ueCu9/4NztcBy2vLrPkGxbvNnFwU96nWVWgac3Z43U9oFMjLkjLECN/jbSwH WnxCi96YT410PeaSO/j7I/d4NNQ1uMs6pPIimGbz0HUxui+6JrW/e08q1LfPeMtGn6qs n5+dHTZXvyplaTztpkTHYnGMgctxM0b12KPb+rV06o8ZZvFb1fNairJNosCzZXsQxZhC GLgB4zhRoXxTvKykOtfzopxT32urA9X/g5EdYCRS6faN4Cdsh0CyqUn355xa/ccH18oX RdPqh4VM6Tj2/cjbWPGdQXjLRgAf+ly1RzDO9xhCNO67mOIjEHSvI2fNaSnM7nMkqmA2 Ld0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764750953; x=1765355753; 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=LA3Ic4i9iG/4Wuv4J3py+fbGaONiUwvROdkBn6i8vWM=; b=vaAo7AZjsVydIUkrEdI0mMdyvlBNSMADCUG/4zJkDd7kWWMHjrlLumOw29Voatd2S1 MZvyX4i9NJCvyD0OJ8HJ7Ur2/NKQm9avInu78fXHoDaAjzfuJpYHtxdS4Tx6K0HQac/A UE8LDg5ZokRZb1UfGo+hxE08Yyv8SFWahkaU2f1uaZGCOH/PQ0SGc2C66uRHA83UGCiJ /M2Rv/55auAdul6G57NgQ591tPYnPchqzcZRD1+OfRozo/KuMMV2GejUyjABDsk/AyYV /feq5aZ9rxGJT0Q65DtogK/N9t0/ydMxKnulblOqrRYqxDVHmkwMweI6nR2ya4PU6deh evVA== X-Forwarded-Encrypted: i=1; AJvYcCV2SKReGUOCl9h3qtwdj3SSGwD/Dk2RwmlRonn4j9PYmchMwVIKmRemkCtWPbuj8H4zkrYHyA+gV8xvGvM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3IBJt0p9QJ7XgrMuYRSifetq0gtyNcwsdkgALuEBmOiDjPcKR d2h+K6bLgkQgbus//UL2wC+XMC1RPjFvDqE4hYP2OUovsq1CWScoi+NLRPlSAKlwW+4= X-Gm-Gg: ASbGncuZPakkOpvgdxawODRjLthUSscMHE8dDylKgarkERTl7434SlERtmlBIxrrGre 6sGtR5u2HiaRZXX6eLiUwbMewHpUHFkBZ8OKPfKt6V1bOFao/OwC6JMoLkb9Y8wa8rB9HHTOyLJ RsbYh6aH2DyMio16G/erjw5M3ZTRAbw0rabS54eM/jpek8EEkf0UcKb0X4Ll7gHtbmjSXzJ5hfx VcMBH1QdSggmjLzXJyfSQUuaw9B5158usOMc0I54yXmE0hKRFXwC85Qq0OdOR3xt1FwrHafgAdA vI3EpbusI/iz2TifkfJSexZrBKfL4oQ2WnnwiM0kx4LUtSv2fsSZlRJ+oRoa45JVi7porPQoo6Y nnIyaf1bbYrlAT3b08Fkes4IR+vTYoIPt8xGG49jvsSb2lGtaBDpwgWvH42z98IcRJ76sxOgByW A05Pk3CCwshWPqQHYrF81FBpv4cbAtZ/Q36HK/4KkJ3Oq27J5AE8QNtAq/+z6nbmiZkDPAeA== X-Google-Smtp-Source: AGHT+IE+xTKCihlHnzhY+EDeazvLtTzGsfm3e95I2Isk/JbAyqkqXC51wwHlCSOST50MpY+yA0iIyw== X-Received: by 2002:ac8:580c:0:b0:4ed:6e15:d2c9 with SMTP id d75a77b69052e-4f0176c2d84mr18524351cf.71.1764750953001; Wed, 03 Dec 2025 00:35:53 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-886524aff3csm126348616d6.5.2025.12.03.00.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 00:35:52 -0800 (PST) Date: Wed, 3 Dec 2025 03:35:51 -0500 From: Gregory Price To: Michal Hocko Cc: Andrew Morton , Aboorva Devarajan , vbabka@suse.cz, surenb@google.com, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador , David Hildenbrand Subject: Re: [PATCH] mm/page_alloc: make percpu_pagelist_high_fraction reads lock-free Message-ID: References: <20251201060009.1420792-1-aboorvad@linux.ibm.com> <20251201094112.07eb1e588b6da2ee70c4641d@linux-foundation.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 Wed, Dec 03, 2025 at 09:27:26AM +0100, Michal Hocko wrote: > Let me add Oscar and David. > > On Mon 01-12-25 09:41:12, Andrew Morton wrote: > > On Mon, 1 Dec 2025 11:30:09 +0530 Aboorva Devarajan wrote: > > > > > When page isolation loops indefinitely during memory offline, reading > > > /proc/sys/vm/percpu_pagelist_high_fraction blocks on pcp_batch_high_lock, > > > causing hung task warnings. > > > > That's pretty bad behavior. > > > > I wonder if there are other problems which can be caused by this > > lengthy hold time. > > pcp_batch_high_lock is not taken in any performance critical path. It is > true that memory offlining can take long when memory is not free but I > am not sure we can do much better. I guess we could check contention on > the lock and drop it to make cpu hotplug events and > sysctl_min_unmapped_ratio_sysctl_handler smoother. The question is > whether this is a practical problem hit in real life. > I just today hit a scenario where offlining was blocked on migration failures that took an exceedingly long time to offline (many minutes) even on a relatively small block (256MB). Now that I'm looking at the double-do-while loop in memory_hotplug.c zone_pcp_disable(zone); /* (pcp_batch_high_lock) */ ... do { do { ... cond_resched(); ret = scan_movable_pages(pfn, end_pfn, &pfn); if (!ret) { /* * TODO: fatal migration failures should bail * out */ do_migrate_range(pfn, end_pfn); } } while (!ret); } while (ret); ... zone_pcp_enable(zone); /* (pcp_batch_high_lock) */ Maybe it's time to implement the bail out? ~Gregory