From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 529892DA758 for ; Wed, 3 Dec 2025 09:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764753312; cv=none; b=PrCmmpviW1VeifUQ0xfvjaxd+MTyrFiV73CdkKyMSsJjOoG/0O2efwPSLhm/gMqAm/2GAennOFJrQFr4bIwSCpE/7ryw4d4HQoSLrn0HFDH8QzOqyOZUeY5uIfe2pefdGPTlIGEGma5K9/NBrrGIHUYx7BjaX2iii34q8/AUj1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764753312; c=relaxed/simple; bh=GaDFCad7NEt89kxm4f2cl1q8wMHwQHh4HZxgOzMmDpE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dKORos9BOizPA5n4wiEZdf+Ht+ylNKl48TmllsbtVda04QLsjQcCo1B4nlDOhiQHHnCSt1JFmP8Rqt7kE9KR6TcOy3lNxx6g22TuGsXFY+WtbxfErm6qnxGNrbVh7VeiXuP8qEuzUpIOnAcxguFrrTbqxNj9ma0HejnT/wKsLHk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BKs6zCBd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BKs6zCBd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 065F3C4CEFB; Wed, 3 Dec 2025 09:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764753311; bh=GaDFCad7NEt89kxm4f2cl1q8wMHwQHh4HZxgOzMmDpE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BKs6zCBdwGPsyEPwcs1gEVvu5t2PJcOt+xtaio0LA4TKyf8lLFrd2/NiWZlIoXfOi 3z+wsZxhQX0ztsosa+/WOSjyaKs8E9Q7eMBuK6cGFfRKgif8lnujjVbS21YtkK27bx Ge7tHzYiOEvrSFfu48MX8F541K4kGRgOh61/5PQlNcXKFY0mB3Gx9J7ph9R9g//nye i0z4JnvRfZkB2YlYbEogk98y1YZUPv6M19fO9V4mGvmfHZO+zUFWQFeNrzgvK0azlB fS19ls5f6wv6z04NQbn6QxcuEHEF8k+c0nUpfFCMe9oec1UcBqRNHqeG5Utz6u81Q0 ieU48pd8ECimQ== Message-ID: <8b89bb59-6b6a-4a79-a571-e97b9ae5287f@kernel.org> Date: Wed, 3 Dec 2025 10:15:04 +0100 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] mm/page_alloc: make percpu_pagelist_high_fraction reads lock-free To: Gregory Price , 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 References: <20251201060009.1420792-1-aboorvad@linux.ibm.com> <20251201094112.07eb1e588b6da2ee70c4641d@linux-foundation.org> From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. -- Cheers David