From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 C4C1E79D0 for ; Wed, 26 Feb 2025 16:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740586600; cv=none; b=VyBc8kKtM8VbDfeIG7XSYNoBDXhRpe3btn3uGuXlqNuvBJZutMLu00mqpdQMlP4p1HfFDIrVxlGWVbRmyQYWA4ehVXHv0uiOx3sYZ5psnOlAa8F3u/NVpc5d2T455J3rV9tp0ooWwEyCosKOm3vLkdKeM0M4wsNiYPqZf956g9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740586600; c=relaxed/simple; bh=sW0i/xtxEO2r06WYVbW9NDSc8uk+SJncYr/zTsA21bY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ctotLf+anqNLGv9GirDfhyjs0dPXPSPiC3p+MTIyHz1Zcl6xE55FiAqoT2wOPsZ8MD8KW0NwBi5wrXfizO84W+Nj4arQAqAyPj+mmAZfqPB5oNrLYviDCjuUsbAdLLKHENSxdmwBncziBFXU4wG30Mm/+ZkJ/SMAZ/wCva/rJDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=M32g03qz; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="M32g03qz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=KibP9ZXbVPA77tsDBIt7YejKy8jux7lGMAtKocjYqYo=; b=M32g03qz5Dfjn8teCFxFB+oxGB qpPSIAy3TukZOOIh8d8oJy65f5eXvPNL0sZQ5mCUm8oevnsWkg8BCriGClhX0mUrrzKPeATgtJTmG jcfMDkuoBf5u4kHmszo36IQK11Z+DBTv/TV2/g8j17zV89SdSvkdlGjESNrODNTd6MvGeAYWULo1p GYsLpWNeEtX/A2oOX5MkO1Sf/wz2qI7FfF7ta3aRph0FpSKkmgeAq6zIDQJiKxnhf3VVYwp1h8z1j kIueEgRrYjNaO/bZWT+WLZ7HczMPQDtjIuaG3NpPpOJWnH7gM2oGKE+yXtGujO+06LdY9qQT3cJ/A tz1XP+3w==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tnK5J-0000000Fu3E-2JPE; Wed, 26 Feb 2025 16:16:33 +0000 Date: Wed, 26 Feb 2025 16:16:33 +0000 From: Matthew Wilcox To: Suren Baghdasaryan Cc: "Liam R. Howlett" , akpm@linux-foundation.org, lokeshgidra@google.com, aarcange@redhat.com, 21cnbao@gmail.com, v-songbaohua@oppo.com, david@redhat.com, peterx@redhat.com, lorenzo.stoakes@oracle.com, hughd@google.com, jannh@google.com, kaleshsingh@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] userfaultfd: do not block on locking a large folio with raised refcount Message-ID: References: <20250225204613.2316092-1-surenb@google.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 26, 2025 at 08:11:25AM -0800, Suren Baghdasaryan wrote: > On Wed, Feb 26, 2025 at 6:59 AM Liam R. Howlett wrote: > > Reversing the locking/folio_get() is okay because of the src_ptl spin > > lock, right? It might be worth saying something about it in the > > comment? > > That is correct. We take both folio lock and refcount before we drop > PTL. I'll add a comment. Thanks! In the commit message, not in the code, please.