From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 11296331EB5 for ; Mon, 13 Jul 2026 16:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783961777; cv=none; b=UnUDOcs0irv3CVClfE6DE1n8KayOCzz/u5n3EnmB+PKg8bpVF4pghWmHGQACr2BjWefE4SDuRAVFk/nNSo81rkBFH3+A7gbIiK1WyFMEE2px++wyBIQ2VV0Cldp28gQ+0IfAS3pbO4YiLOMZNidtugPW+CEEwxPl/Tlj7FRZhWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783961777; c=relaxed/simple; bh=wYe7kym3kczWr73lptfB1bTj81zD5wvAqQaXYZ4DW5M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IwpLszAuZcRowUgzyIkDfyO4/Fw730uR1YlbVnUHkUv4rlkVr8VcF0aAhpjcT7zQgCjGNPUtZmz8+TIFf/wPwjs+ODhzMoskYRu6dl11X48iOh410zLlYUMyXqSz5x35WY7fK9qaeZ6tNVZXzw0goHE4EAcjrktbzqqttxxxsDo= 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=pZ6p7Hie; arc=none smtp.client-ip=209.85.216.48 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="pZ6p7Hie" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-38dd55ad76cso78966a91.1 for ; Mon, 13 Jul 2026 09:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783961775; x=1784566575; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+wyTThpzWI663yfCX7yR0ohXV0bj+fwjL2+oCBrswHw=; b=pZ6p7Hie+ZuMyCjYswdbNFYtHYwpTiPQJeBxQDgIy7EmtqA3YwrisiUmulxHWcgh7p mSzANG/LXXobjGulyTi2kSjzBvp+JDDbq1wXipDZgrSJWUj1crZjkt2sxlTMK/zueLf7 5yPmfr75fWWklrWpWcDCcHrcGG157arPtZtcY2FARd/IaVTlv1jRZfHH+eqHXs12qk3G A1xBemqKnmwrdUlPtwZs8SH4WDWAbkeFi8shvGawPWatfrORXtRU+Zq89GODYbZc/wYa 2Pe75HEhtpy9RKIUzBPRBHmH6bodAKIQlnOkVGuH4YWIkHJyDGjDsclp+F/R+JU8qqkD UxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783961775; x=1784566575; h=in-reply-to:content-transfer-encoding:content-disposition :content-type: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:content-type; bh=+wyTThpzWI663yfCX7yR0ohXV0bj+fwjL2+oCBrswHw=; b=TNzmK7W0KCGSAEBuBpJNrL8hzYu/xcTJB5bCsL5gxoiNA6iU+/vMdug7dXaZN2QeG9 jmr4KmOR0lppFgG9S7Qd4vOmn2549OWkLgvHnJe6RBmG62Q8Od6QHhbZLY5fwQbegxcA 7Ivw7Mg9vz/KjVP3ptQuspuZKuVQ5CYX7WLr+Da5T6mRXb6VAhWj9Kzj5yyWe6x7Rrg3 k68OPK901OECl7OwC6vKQ4HSI4T2rSileXnCZuLYTRYUe3MJZfj0p+XaISUpZR+Y3la+ 9zIOtHVLFmRKD98u/VcOpVe9o5xZdMUieJGlnLzPrdclzKQq26+HoVKv3+gazY3EmK04 6kDw== X-Forwarded-Encrypted: i=1; AHgh+RpT7KpHZwfBcg1n4SUuI1nR6qw57h+x9xhjUNifDovG+5Cdv62cTJmi3nWr5uRpd/hacQIh9CF//I3yLmM=@vger.kernel.org X-Gm-Message-State: AOJu0YwtJL15ntE7Q7zAY53PwgZ2ko+ztbH5OFZTMkTxFN6Q5cgAzIHN i8e0JqIqD0F4jk8Mmk5RprMC+6BWLyxDHr02U2DkZnbGe0CAjgOzTMtG X-Gm-Gg: AfdE7clLtpdeoa7i8h7DzGg1z8Bi8ydp3fvyEMbfP/VhB3kQOuQnVi59T/D6WjZIIUT Rwk9+ZbaCeVCwHWDACGS9AGZdNnwCmJoDxHKv6q8e/24iVbETTBJnltv6g8Wxk6e0gkjkVCvlkU OaE0BKgxQyZrtt67cPrHmYvBhoQD8rUHpcPZc7wkbOR8rJBVLb3NmkljR3rIRqkj20At1GESmwW p0RplS2Q+1HSVE+5hAvRvKegi24gWqk8aJz73xr7raD+IPKzrqyUwRKY2zI9oAvPhufiiOxr4me t/UQQhOVb+uGDU6UpLw5IiCKplDfkbPH3UY6TDQzBvOxY5gLApE04vCT4JO5KgUjj2m8UyysViX Pm8Yi/UuV1eMPj0ycsskxhY7Ld/ZA38r4APGsyUmBIkKixd7Z6so10ssUKBz3gWWSZARwkcBp6r ryY67jEtMkqqrQU5Z2JYT2lg0VhPLOCLOTLSWDuq/FhD9UxWkmFFayZkQ= X-Received: by 2002:a17:90b:57cb:b0:36b:769c:c037 with SMTP id 98e67ed59e1d1-38dc81978ecmr7351194a91.5.1783961775319; Mon, 13 Jul 2026 09:56:15 -0700 (PDT) Received: from skinsburskii (c-98-225-44-182.hsd1.wa.comcast.net. [98.225.44.182]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38e1745a596sm180718a91.15.2026.07.13.09.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 09:56:14 -0700 (PDT) Date: Mon, 13 Jul 2026 09:56:12 -0700 From: Stanislav Kinsburskii To: Andrew Morton Cc: airlied@gmail.com, akhilesh@ee.iitb.ac.in, corbet@lwn.net, dakr@kernel.org, david@kernel.org, decui@microsoft.com, haiyangz@microsoft.com, jgg@ziepe.ca, kees@kernel.org, kys@microsoft.com, leon@kernel.org, liam@infradead.org, lizhi.hou@amd.com, ljs@kernel.org, longli@microsoft.com, lyude@redhat.com, maarten.lankhorst@linux.intel.com, mamin506@gmail.com, mhocko@suse.com, mripard@kernel.org, nouveau@lists.freedesktop.org, ogabbay@kernel.org, oleg@redhat.com, rppt@kernel.org, shuah@kernel.org, simona@ffwll.ch, skhan@linuxfoundation.org, surenb@google.com, tzimmermann@suse.de, vbabka@kernel.org, wei.liu@kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH v8 4/8] mshv: Use hmm_range_fault_unlocked_timeout() for region faults Message-ID: References: <178371866223.900500.12312667138651735591.stgit@skinsburskii> <178371881034.900500.5214601525971121683.stgit@skinsburskii> <20260710151216.0397a6f9ac5c7b4ccd274cc1@linux-foundation.org> <20260710224606.69235ab5c49b5987fd33e924@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260710224606.69235ab5c49b5987fd33e924@linux-foundation.org> On Fri, Jul 10, 2026 at 10:46:06PM -0700, Andrew Morton wrote: > On Fri, 10 Jul 2026 20:14:47 -0700 Stanislav Kinsburskii wrote: > > > > > + mutex_lock(®ion->mreg_mutex); > > > > + > > > > + if (mmu_interval_read_retry(range.notifier, range.notifier_seq)) { > > > > + mutex_unlock(®ion->mreg_mutex); > > > > + cond_resched(); > > > > + goto again; > > > > + } > > > > + > > > > > > If the calling process has realtime scheduling policy and either a) > > > we're uniprocessor or b) this process and the holder of > > > interval_sub->invalidate_seq are both pinned to the same CPU then > > > cond_resched() won't do anything, and this might be an infinite loop? > > > > Yes, looks like it might. > > What can be done to prevent this? > > Well the best way is remove the polling loop and use a proper sleep/wakeup > mechanism - mutex_lock()/prepare_to_wait()/etc. > > If the polling loop is to be retained then maybe msleep(1) or > usleep_range()? Well, running MSHV - or, I suppose, any other VM - on a uniprocessor host would not be very efficient. I’m not sure whether this corner case needs to be handled explicitly. But even if it does, supporting or explicitly forbidding it would be a separate change. As Jason noted, this is not a regression introduced by this series. Thanks, Stanislav