From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (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 C79193C1D54 for ; Wed, 19 Aug 2026 03:42:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787110973; cv=none; b=Vhxy3S86zXQeJNUOA1GjanZFVuoAVHHZfrzYaQhk9FfVj5gjJsw2XjpKXiWiMZuDATMrcIo3s/Nc7uQ0/m9jGT2UQHh71ZoXG3Q55pz/Oubp3ulkFsgkbkKQZaj+5hNik56mFgsdXsVdqNSxHthbzkUwTW/eq+M0y5f5jSQw/GM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787110973; c=relaxed/simple; bh=O/EuW7RHb9TDYK3szC6r5XpcTuvkz7a2icpZLBYTNSQ=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=EBTxcTbd3eVzGI0nGenf3M2ZG1KLOC9w8Emud+xDCT4ADii5DdAYR1t2PmP+8rls+WRgTLLkljiDBahfuZd8yBxjJIXaO06J0fZwsOHSxc44LhERA3TmK0Tz1OurbtQwsdn/xnWClFxqUNmMQYcP+o57hXn45y7faFm+Xkj2t8M= 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=DgoHpsD3; arc=none smtp.client-ip=209.85.214.193 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="DgoHpsD3" Received: by mail-pl1-f193.google.com with SMTP id d9443c01a7336-2cf452def93so15264495ad.1 for ; Tue, 18 Aug 2026 20:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787110971; x=1787715771; 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=CkLkEuOXHhSmUN/BJBFx0Z7g8/lyDpALhd4qEk1ARU4=; b=DgoHpsD3I67H/sak7VwxIcN/SUiNRw7l05eYbggELQUSDm5KCWkhgpM5d61tREv3lc FBTPp/x2KYSmamYYWW3hqHprpy5d+F7Lj9IwHSjjr/5Xd2rB/Bd6FLhQ4Dk3vlQFGE9G CCfvQn0+pXOauIh1VGTjZCvWfN8JaRpk6s8RlF/pQ2/A5xRVAjh+f0oL4e/ZBDh9adhO zj6PJP9BsYSljF9hSGhCa4c5JWir0zZGXTbZYTOz5Oe9KdxvJovhDkKdfUpbKkuOlsob lLk7KtA5cKJbC6yx25Cssg/nGkC0LSz5ZtVb3eQq1ZZWSG+AilqmRthjMSPbTrBSqsPs R8MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787110971; x=1787715771; 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=CkLkEuOXHhSmUN/BJBFx0Z7g8/lyDpALhd4qEk1ARU4=; b=Jqu8vTsmS3OoJiWZsmMYt4fgodD7H9Qg7JJqFnY8qplR0Vsl5eEDoJo3xcWvZPIcqh 8PXFxoAj6VUyVcwNDUHBXvsUCbHBBdvsB6hxx3uiR4rUAkLBtgT2blEM5E7k8kP6g2yE ELsPl68xTB1Xob9bfY4Cx1ocQHv6iCxUQBaR0UteMl70UvHLjKNn00Ye72pq9HGGuc13 +RaxUcXZRQOuMLkPkwC53EC86kfqFtLM/Oni2e5DhRBFYsxpQCYl5kvb/VNM9WCVUaKf tFh2JQg29D1BBNcd4lbcKzs5rrx05gLwzWpMELqjZ8LGlmVvjgjvYIK4kUE96SMW2lPQ mG2g== X-Forwarded-Encrypted: i=1; AHgh+Rpxagrvna7G6pIffdvBDPnYmxDTExQMneqAFFetS2oXJo0f2grx4PmYF4Jh+NsqQG4RQQGEurOBai+VneQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyamhwqakrhDZ0yuOFEo6qGrok4Ws1ad+PrWz7xysbOXZ6vMyAA ri29zBBZenylR4DPcD15C7x1+xSW9wkgtbSsn+C318aKzQxCaQ6t2oMSIi0V8YcC X-Gm-Gg: AR+sD12VLMooBQNhyCD2UK8q2TSu1riDaj614hn6xzoKx60ucsM1hlI0Pdy3yZLqTiO 1QTgOnQnWASDE/uYU55afdIU1lwFZhlSALpFvTF7C4TQTCY67MLtAdnDpCDnBcM7xb+UNVQDB9h KJtr9N0BjvEObROvtHX1YFpGMU3p3ux1B6EqMBEB1amKZOTj/SvCNjBglP0R6rwfg2aFC8QJhjZ az2YZDpsJILqfugvChyKH7FDaFxqviEAIdKAJDxSWBKsUZOAkr7ZDP4nyZbPVmU7dft+toCaqEI +vEwvyUGt/C1f76UmA986Cb1J3jgkk4zDL8kT3rvTFhVXvbFvPQ1vdXXPNzlXolu72Ht3jqUl3w yLCfqZ4n7pIFbSLPsAkCrXtsUz2dUHO3879NSO0sWcXk48iMdgPxzy/Sr8wA7k8QlVd9o116mFG Tq17cD7euvQ361gDT34JoKH9S9uWmJphBY3ONDsO9+WSAWiqoXuUqM/jXG X-Received: by 2002:a17:902:ef02:b0:2cc:db7a:251 with SMTP id d9443c01a7336-2d5fc84bad1mr25854625ad.2.1787110970799; Tue, 18 Aug 2026 20:42:50 -0700 (PDT) Received: from 192.168.1.6 ([140.213.202.182]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef7a0easm2081197eec.12.2026.08.18.20.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 20:42:50 -0700 (PDT) From: Foxie Flakey X-Google-Original-From: Foxie Flakey Date: Wed, 19 Aug 2026 10:42:46 +0700 (WIB) To: Andrew Morton cc: Mike Rapoport , Peter Xu , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] userfaultfd: reset err to be 0 when move_pages_ptes succeeded In-Reply-To: <20260818202656.f7a248b33f6130d06b4cf83e@linux-foundation.org> Message-ID: References: <20260818202656.f7a248b33f6130d06b4cf83e@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 On Tue, 18 Aug 2026, Andrew Morton wrote: > On Wed, 19 Aug 2026 10:08:24 +0700 (WIB) 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: Bryan Lim > > Thanks, Bryan. No, problem. Thank you for your time. If you don't mind this, I would prefer keep to be called as Foxie unless its required to be Bryan Lim like the sign off. Sorry, if it took a while for me to understand. > More paperwork: the signoff is supposed to match the Author:. The way > to do this is to add an explicit From: line at start-of-changelog. If > this is not present, we fall back to the email envelope's From:. Noted. I'll keep that in mind for my future patches. > > --- 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; > > } > > I'll queue it, with an adjusted From:, as above. Thank you! > Could reviewers please advise on whether we should backport this into > -stable kernels? > >