Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1345283lqm; Thu, 2 May 2024 11:45:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhauGF7CyGxpkZloxpEScj+9YhOVN4IUKJt92FPSKwGRSzeVUc7Qf15O20I7M1FCp/Ow3D4rfZvs/FPwx/thfUo/xjaoZ7vwT6TLiJyw== X-Google-Smtp-Source: AGHT+IEOZaGjW9n6SJTQb9ObozGiPADpruDyvLEazVXr1ll9u412FFKZ/U8Xea38U93XOxcltEeo X-Received: by 2002:a17:906:e292:b0:a58:e4df:4d1 with SMTP id gg18-20020a170906e29200b00a58e4df04d1mr2780933ejb.13.1714675523640; Thu, 02 May 2024 11:45:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714675523; cv=pass; d=google.com; s=arc-20160816; b=HrOclaXAwmGms6r58oiPF/aWBiQFOtMSuYdqob/z9xU1Ad1emffQZdQ3FwRrC5WEtq vX69MOPschfdoHE9DY6xq3nFo2u7h9qdXJVK1bHmvxzY4ZxSwTPzAEYjXXq5g9f0lOfJ wv+1p6857YK/rJHapVANRE8OQNyO0F2CDrZ7vL7JHhWLIrXv9wSO6qEYSKztzp1JTnWO DidwMxVdo1H55ZMVnMDbFAYOqPBERCKF2xYx3y7fj0ioSlu00510e7rWvFF8VBPZ65O0 slWsYyoOFL0A4LVZmkKdLo6yMzaVEFuW4/ImycudnsYhUM3lh1yBM4gMUndrpX0gpbvT wW+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ChA4JiEO8+pzbEqPjZaxipmruWijlKLZwUNT6NFeTP4=; fh=rXlQsUPEwzHoaVifGf0FvzHNb0zIDFXCXXb7Ox5tFIs=; b=LC5UFOS8z0S+vv8VUVsJK1liRqvR7SlxhSV9TUyrqSPfLbcYO8JemiTMwETu2z3ZWV BbA+cjyEGsA0GWHn5sisGPfoibdwM3LRb3JpWs0svLhDAvOy0yVlLKQhGIXd7fBVEUB7 CM0uPWl5EgYx9XCAif2QKcn3+5KMHY28nJq+lv+HOtBN4hgZSVcz3KXWANDnIX6ohGKf +eLDuuKookuDqUyEa+MFn4cXVzfUNic7r9pSdhLdKHjyduPhe5EnD1cDEuEVqH244LbQ 7AZjGBw36IAvixFu/Wc9NgefTk6pYCJcXlDfdrrm/f7Wrv57boiETpouZZGqNTHAo485 8fNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bHjgbdAO; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166843-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166843-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m17-20020a170906259100b00a5741ed9690si733885ejb.541.2024.05.02.11.45.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 11:45:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166843-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bHjgbdAO; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166843-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166843-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C6101F22AFE for ; Thu, 2 May 2024 18:45:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C360C17557C; Thu, 2 May 2024 18:45:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bHjgbdAO" 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 6FD79FBF6; Thu, 2 May 2024 18:45:10 +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=1714675513; cv=none; b=i1qseFC/D1FLkU8kQVhOv6CE0KH9ymmDk/LW+LM9gWJLQdrAspPUES+UPx0YeW5Ao62xCGWKHCHc9GgMQs0x5HUpZpST27bjHyKB6xDA12sL6G2hGKe8TxY4Oh4/VhYLVUVDb8EQ3ZLprQtVpMRo4ObtjJuomWwz+dh3yfXGRFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714675513; c=relaxed/simple; bh=FWuYteWtRFhnZWyLGHxZuWlcSYRlHBcV1uBe1wn/qeA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AGV5fk549COC6msk6YSC6Nca90PfK4Y3gOz75QfNOThn/3lB6U6BWS/mFFGmpSjL4zEs/+UbdSqWTj9Wjl33mVsRJRk5wltexkZFiG8n0uZcfl+7+JXhYa4tvbIZGJqKAlWyuwi9vDdo8pog8lXn0xjES4MRKpOekz1L1ndIc3k= 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=bHjgbdAO; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ChA4JiEO8+pzbEqPjZaxipmruWijlKLZwUNT6NFeTP4=; b=bHjgbdAO2OtVI/QsIEAZ+xE7sA piqclsNY80fgYK6rkYvkCmKZ3W0yraJRf1lRVTQq9A/vuaburmAoHPkGeD/72zEo1oxBmIQSxd2pQ bLKa9/ENfAW7x2Mfv0zF7UR0yfahZ4B2cEF0yh1+Zc6ZevwLc98DeQMrbKKeYSg0xSh+dzZpvT1Cl P6Hjb+YNg8nguEe2VUCajZmwTK6ocR9Zbkl2Kb4pDiHMyJ5eOyJFhdMqLzDw5sKu4B+fVjtSf7AP7 67itKBXCrbv3RO7mu2GsaUu8rI1xV7wiTwjS+NcwgqBzvqfPvuJHgIppQBjg0UePiR0Fe6SzwQsM4 6VKgpgWw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2bQQ-00000002Ezr-38HW; Thu, 02 May 2024 18:44:58 +0000 Date: Thu, 2 May 2024 19:44:58 +0100 From: Matthew Wilcox To: Jason Gunthorpe Cc: John Hubbard , David Hildenbrand , Alistair Popple , Christoph Hellwig , Andrew Morton , LKML , linux-rdma@vger.kernel.org, linux-mm@kvack.org, Mike Marciniszyn , Leon Romanovsky , Artemy Kovalyov , Michael Guralnik , Pak Markthub Subject: Re: [RFC] RDMA/umem: pin_user_pages*() can temporarily fail due to migration glitches Message-ID: References: <20240501003117.257735-1-jhubbard@nvidia.com> <20240501121032.GA941030@nvidia.com> <87r0el3tfi.fsf@nvdebian.thelocal> <92289167-5655-4c51-8dfc-df7ae53fdb7b@redhat.com> <20240502183408.GC3341011@nvidia.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 Content-Disposition: inline In-Reply-To: <20240502183408.GC3341011@nvidia.com> On Thu, May 02, 2024 at 03:34:08PM -0300, Jason Gunthorpe wrote: > IMHO pin_user_pages() should sleep and spin in an interruptable sleep killable, not interruptible. Otherwise SIGWINCH and SIGALRM can result an early return. > until we get all the migrations done. Not sure how hard it would be to > add some kind of proper waiting event sleep? ummmmm. We have a "has waiters" bit in the folio. So on every call to folio_put(), we could check that bit and wake up any waiters. I need to think about that; right now, we only use it for unlock and end_writeback. Making folio_put() heavier is, well, quite a lot of call-sites.