From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.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 EE04C2E7BD9 for ; Wed, 3 Dec 2025 09:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764754954; cv=none; b=q5mw1vSVjAfdgGV08NAZv3nxSovvy0wcpW9VDVTTsOyBueuRgmCYehNtBALHckriRb+lDg4NUJYTLBr1qsrw7UE4F8Zc88nuN0g86SCw29pepKNQuYpK70BjK1QnuQvegNoSRdGTjNj3p2lcKSRLp9FTd/fOC9/DfG1xnL9WmKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764754954; c=relaxed/simple; bh=QE8/iJYgAqCr3neVZTdj1VTB6+81GUQP82spByx2HQk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iNAVzAXYxmBYs6SPc+K2zt3bHMvAS76Ij8MZmCjHa1opwMSuZpplnwcwZnB5uKWrDPR9ngCtH1mxwWWHZZYu0uk8ceNoWX7MYogK/fSU3FaIV2AOq1bvDBU6n4oTxNh/R0xxSQPPefQ1nyNvv2dliDlIhwylZgXPB2a7HT76Ceo= 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=QvwSdFRe; arc=none smtp.client-ip=209.85.218.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="QvwSdFRe" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b79af62d36bso586167166b.3 for ; Wed, 03 Dec 2025 01:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1764754950; x=1765359750; 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=boQ69Ybh1wYDqumvtIviIzfcc3zlXtCv/CYxGlxCowA=; b=QvwSdFRe9JQLCF+7RvqFky2jA6c5DzFe779TpkgecJh1Unf1RfY8JhLyjhXKAp8DjO zYi0S9Qn3aD7MmSdCCZi94cjDm98hN13TFAP8RcGp1YeObUYlsCxgltBZSbio0C/l8jM UdyykQNjQTLm5L8ZNiPr19+040xxpPsahERcCRGn5ul8Tzbu29vUZhN9FRAppSgn6Onv LUkVpmzq1Y6CQ0AfObfrJHOFGhB4ilt3PJbw5UD0b2e/qe0u2tVj8kQtXQA9qTshf6Bt NEn9u1FRgdjbfOd/7TPbyzvG4c1BN/nxcPakMTDaJFCAo/eiJrBAfcJP9Ke2dFOsyIp9 TJmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764754950; x=1765359750; 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=boQ69Ybh1wYDqumvtIviIzfcc3zlXtCv/CYxGlxCowA=; b=Dh286Uy5uqXaJocSCEhpz0f6r3YmKInT1Lzh2dzGzbkM2AAX6uGDYFDF9QeBE0kGo1 gDf1iMbTMzTIVL38S7kfpmSJ7BT+NW7y75Bg0jaN9TsXdGG72BUA0D5X8WhTtRRmRMPc c6r7Zo9g2368YtciXlBZKb/p0GYKVolxwtZirC+nfYzE/u//CnpHqXv5+A6zaYWhKsyc 3Z6q3rZXWbrJLHc3b822ISJnJnf/GvfslXQa2Ki2d2MPmXAmMtb5E0lEw7GFQgF5+GVc IS8aT7hddDP9k4/xrikUPxnDQGWSghkP+ZoObNG4LFMYU1375aGKtgixm+UnXo69jo7g nPgw== X-Forwarded-Encrypted: i=1; AJvYcCVBVWNrHruTJ84WOC7R+UjXy/Z6PUk1guclgPguDvER7H9bfHgBTXISa3FPMQOXvG73OJJ7PXUczFmiaxQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3lV/6v+uwMYZtZLMjFG9U1TW95j11Q9oPbqgUKmVC0ZYvUyDy CuV0YaOBhhRmbEZny8K/UujtkC1L+2Ii92rOdXKlc9KMaHTDzy69Wi3cjPgw5BAASWY= X-Gm-Gg: ASbGncsaeJiRk8zmwlJ86EC46cTTk5XZgx5LuGEN1V2D6PR+dc2ofPLeIhsHkibk7wW Ju0brRDTe48ikeRUQDsSdPNRPi1VK7svSlj77AvL4YHB6Z4jBlY9bz4iOCeNlR5BlqwZit6lU0t jNSa7ejQLSSRzaVTZ+5GKWpDz4fQDrM61jv5DytwXu6CR+EDC///msXFBEbt6uB0EV4r/bziGta FW7+d32rCsjD9nMB6GmJc6ER6a9BI3QGy09ve2zU1xC4kpKFSb4rk3Bg/CZ3JlSCT2Yd2RFJCHA 7a5YRjlMqgWnuM+Xv8XhUyZh/J38OThU9eCjv134xRB5zSBhPE/fy6Oauq2U+qIqcbz+j0CS/VJ tMkgit6RiDyexLe8Sajjg1Q5G7koAyJM55dltuymaoBVE1/bGIkz1eh2XdTEj8bNLPMADWut1YF zayV0uq2q9Sdj6/wcvyr9H5t6V X-Google-Smtp-Source: AGHT+IHcwn95HVY/NChXlCfMvTjFUudFZ0VlJry9IHn85kRDo7Eua7qdhWEANQT1O7oNQyl1uYTssA== X-Received: by 2002:a17:907:3f96:b0:b79:b6c9:516c with SMTP id a640c23a62f3a-b79dc51b552mr181031766b.30.1764754950171; Wed, 03 Dec 2025 01:42:30 -0800 (PST) Received: from localhost (109-81-89-155.rct.o2.cz. [109.81.89.155]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b76f4d533f2sm1749804166b.0.2025.12.03.01.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 01:42:29 -0800 (PST) Date: Wed, 3 Dec 2025 10:42:28 +0100 From: Michal Hocko To: "David Hildenbrand (Red Hat)" Cc: Gregory Price , 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 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> <8b89bb59-6b6a-4a79-a571-e97b9ae5287f@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: <8b89bb59-6b6a-4a79-a571-e97b9ae5287f@kernel.org> On Wed 03-12-25 10:15:04, David Hildenbrand (Red Hat) wrote: > On 12/3/25 09:59, Gregory Price wrote: > > On Wed, Dec 03, 2025 at 09:42:59AM +0100, Michal Hocko wrote: > > > On Wed 03-12-25 03:35:51, Gregory Price wrote: > > > > if (!ret) { > > > > /* > > > > * TODO: fatal migration failures should bail > > > > * out > > > > */ > > > > do_migrate_range(pfn, end_pfn); > > > > } > > > > > > > > Maybe it's time to implement the bail out? > > > > > > That would be great but can we tell transient from permanent migration > > > failures? Maybe long term pins could be treated as permanent failure. > > > > > > > I see deep in migration code `migrate_pages_batch()` we would return > > "Some other failure" as fatal: > > > > switch(rc) { > > case -ENOMEM: > > ... > > /* Note: some long-term pin handing is done here */ > > break; > > case -EAGAIN: > > ... > > break; > > case 0: > > ... > > list_move_tail(&folio->lru, &unmap_folios); > > list_add_tail(&dst->lru, &dst_folios); > > break; > > default: > > /* > > * Permanent failure (-EBUSY, etc.): > > * unlike -EAGAIN case, the failed folio is > > * removed from migration folio list and not > > * retried in the next outer loop. > > */ > > nr_failed++; > > stats->nr_thp_failed += is_thp; > > stats->nr_failed_pages += nr_pages; > > break; > > } > > > > So at a minimum we could at least check for !(ENOMEM,EAGAIN) I suppose? > > > > It's unclear to me based on this code here how longerm pinning would > > return. Maybe David knows. > > I would assume that additional references will always result in -EAGAIN. > Remember that we cannot distinguish short-term pins from long-term pins. > > We should never have longterm-pins on ZONE_MOVABLE, unless something broke > that contract and needs to be fixed. Right. But what should the hotplug code do under that condition. Loop for ever or fail reporting the broken contract? I would lean towards the latter. We have never promised that offlining will not fail ever for movable zones. We just guarantee that the operation is resistant against recovarable failures. -- Michal Hocko SUSE Labs