From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f11.google.com (mail-pj2-f11.google.com [74.125.227.139]) (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 B49B03914F0 for ; Tue, 18 Aug 2026 01:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787018066; cv=none; b=gIeWoE+FDI0BTTAI4wyJvXJsfON3gr7uxr2MokL0zszwylRHMycqPfHTAO+m3FI8EdGI8nePKc2oRI8tlWOnjfhMh7Kh8s0HP8yRiDqMkW18vFbogfr/EUicgsWPyGjqIkDCK0Gjzb5An3CprvrGf6u44BPJ3EP1BZsjpKRuUc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787018066; c=relaxed/simple; bh=7qwBuOjJoCLu5PVJq07B6UqDzjb595e7RuI47kBCdJE=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=P+776w/4JeKdBQYwYw8SxiuwE8XCiAEGpL5b1SMVeTGcvQ+2xyYGdZ8pyKMgih7W8Jwin+LODgSA9vfC6pPC4I8U8UDHvk8yPjg/ncL3OULWPXfrefdTu3vN2+GvXMflZ+b8NfXG8pqpc8RUIX5QJccaQAlwHed5RDj1bhbmmvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nkr1enCN; arc=none smtp.client-ip=74.125.227.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nkr1enCN" Received: by mail-pj2-f11.google.com with SMTP id 98e67ed59e1d1-38dbe53179bso1294377a91.0 for ; Mon, 17 Aug 2026 18:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787018064; x=1787622864; darn=vger.kernel.org; h=content-type:mime-version:references:message-id:in-reply-to:subject :cc:to:date:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yJZh+9l79XGTk+91Ew764dkcvMu0Rffrs34mLTeW4hs=; b=Nkr1enCNZMvJVXjB0dsev47dtpwoeWgVUkVswIdenYDAJ8iOqeSm3hW2rm6bQa2cqG RtlKvjgkFrJaBbYkt7A2IgPrf5tIFPsoGKdUKmjow8JoeM131sclnh5OQYGr1hUAoUgq AiQ+MXiXeymHWEhLtj8h9RnNhzbwCw1OABXlgTCqZJjCYVzhJgmok9RdYdAaKeiZH4q1 5DtqZlZFiEmErt+KTB/vK3qybVwsVDns/ZL4AcXLQiyTZha+sLHiuRIpBhyWULd+4rLQ isHmEQoDJ1dzmPbrMd2NfJ+UlxFEvjWlIivIFAasl/vrOWJHIc1mgujDCc50nrnBm+jq IkYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787018064; x=1787622864; h=content-type:mime-version:references:message-id:in-reply-to:subject :cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yJZh+9l79XGTk+91Ew764dkcvMu0Rffrs34mLTeW4hs=; b=pUsVM8rOcdqiIOObUn20G+gx4Tred+TCjFDNFd83+Je6jzrRBpR0/S6Y3/mfqmEoKJ IbnBiescZ7jTTT0/QuZ8e46IienbnXA+wjLHpkFYU62AAcTItz6jOdxCBNwJ8NFgp67i xqoZ6mjgN5fjnJ6rv7Tqwi4yMvuvKGIhYMcQeUG6ik9soMY0PWomiqHuLcgk61XhMt46 w26T4wsawseEyeHa5sIjUFoNUPibYidgdC+ErRASUX0TXOCBfddGZeSNx/jKoP7Pfc/7 S/E4u98/+CCXpuRz55ilc+ugmVGtyByGa3hk18SaCFNXgLd3nR0f9BQ6XTbLwOdUx8v8 NwNg== X-Forwarded-Encrypted: i=1; AHgh+Rq0afdLhEK/ecNMfM5X9j1uYvxAha3g/NuFAqVBcGBrQ+vc2zqkV8yqJ3FdXtdqX+0TZ4qkq+rwNkL5IJg=@vger.kernel.org X-Gm-Message-State: AOJu0YyzoLoanRy20bx2QD5cyhbV8KHD3Wr9hHktGxwKWC11Dry9ksj8 OOTBT+hufxmSBxwO7Ddw5olT12UW0yno2fi2k+H9N6UKCo5wQoViNQENrdlJedOT X-Gm-Gg: AR+sD120V9vPmGsNTUc0bzM97n4CGtclTkmp+2KXAn16eUP5dprXyq4c/bMNURR4Qij tUcHbXpN22AkkRk5Unwbn++oYUpFacZ6sDt2PDBRviBGCB498h1PHvgED/oSb7Llf1G+U9aT4jA ufxkACeUPX0389/UZbS5zhPJvlWHbgGJETOi4AD+xdpipoAfCb2JZY7h0BowMivz/pYBEv9I3lP rbH0SxVtrwA0g5HbfKFmOnOBaDKjuY1foSNbK/FIpZsob+1TGYDrAc244ICq27VbACW2/5Pm+9m EjZtJndDUofXPI2+4jiQouedhxM4730aZ/NaQu7dlgyIxmjRTFMJVmXNW/gGHuMvA06EzhT0sk1 5XkyRv2O5N7hgs3QK75aSsFr4voIAAPWRkbFosJ/fddIVt2ul+GczY4vdJq/ITm4tEYYJJ8wN9g Mi3bcVbiafyI9rMVB4t9sPdVbas7FcpVDqOVBgvmHpPJzeeoWbYDWwWYz+ X-Received: by 2002:a05:6a21:4cca:b0:3cc:45cc:c401 with SMTP id adf61e73a8af0-3cc71a256bfmr32917617637.13.1787018063762; Mon, 17 Aug 2026 18:54:23 -0700 (PDT) Received: from 192.168.1.6 ([140.213.202.182]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327af7934cbsm558584eec.6.2026.08.17.18.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 18:54:22 -0700 (PDT) From: Foxie Flakey X-Google-Original-From: Foxie Flakey Date: Tue, 18 Aug 2026 08:54:19 +0700 (WIB) To: Andrew Morton , Mike Rapoport , Peter Xu , Suren Baghdasaryan cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] userfaultfd: reset err to be 0 when move_pages_ptes succeeded In-Reply-To: <79cbfe54-41f2-9041-89f3-a96e9fb80066@gmail.com> Message-ID: <9fb6acbc-19cf-eef5-b877-3bf798767ffa@gmail.com> References: <79cbfe54-41f2-9041-89f3-a96e9fb80066@gmail.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 Not sure where I put text that is not the patch description and not in changes. I put this on seperate mail reply. On Tue, 18 Aug 2026, Foxie Flakey wrote: > During move_pages() operation, when move_pages_ptes() returns EAGAIN, > the error code is not cleared even after we processed it. This leads > to a successful retry but then the same pages are retried again due to > the stale error code. This time move fails because pages are already > moved, loop is terminated and move_pages() reports a failure. > Clear the error code once we processes EAGAIN. > > Fixes: 50944692052b ("userfaultfd: opportunistic TLB-flush batching for present pages in MOVE") > Assisted-by: ChatGPT:GPT-5.6-Luna > Signed-off-by: Foxie Flakey I'll delay figuring what to do with Signed-off-by, I'd rather keep Foxie Flakey because that what is my "known identity" on internet at various places like GitHub, Alpine's GitLab and now here in Linux kernel development. Would be nice if I can keep Foxie Flakey, like again policy is policy not a suggestion if Foxie Flakey is not allowed. > --- > Changes in v2: > - Updated on description to be easier to understood > - Reset err before retrying, instead of fixing right at the move_pages_ptes > branch. > - Added Assisted-by, received an answer few days ago from linux-newbies IRC > that even I just used AI/LLM as "fast path" of git bisect. I still need > to add it following > https://docs.kernel.org/process/coding-assistants.html doc. Would be nice to not have to add this Assisted-by. Mainly because I just used ChatGPT as "fast path" of git bisect to avoid needing recompiling kernels during bisect if ChatGPT found result first before I finished git bisect. I feel like my effort trying to understand how to mail, write patches is undermined, but policy is policy so I don't mind if it has to stay. > --- > mm/userfaultfd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c > index c3adedaaf7d5..ec5d511bd179 100644 > --- a/mm/userfaultfd.c > +++ b/mm/userfaultfd.c > @@ -2085,8 +2085,10 @@ static ssize_t move_pages(struct userfaultfd_ctx *ctx, unsigned long dst_start, > } > > if (err) { > - if (err == -EAGAIN) > + if (err == -EAGAIN) { > + err = 0; > continue; > + } > break; > } > > > base-commit: 62cc90241548d5570ee68e01aaba6506964e9811 > -- > 2.55.0 > >