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 C669836093; Fri, 5 Jan 2024 20:21:15 +0000 (UTC) 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="nBEhS1X6" 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=GH2fUIxY3jgbl3dQw34A+7ZL3ZN4Y5y8qZthX19vE/I=; b=nBEhS1X6OjPHGFrcdFWKaXU2uc C/HyQD9hBggzIqKhTy1YwhypPjHB7wzqgdQnrZ3YXLX1S8gLkE8VwdmjCFsl1DJrdJRZk67hVbJ6O h/jvKKuolffwxQxmk/g6O6NnxaHP204q4GxCoX9u33CJzOh2G1JxSb67Op6YDEwjuTsqjLoPYixEl 2E2uVQC0SrTTvYUpzPQfpL4Ah5+xwfyQOAXKqP6lSuXpEwQGd2mEfNGNTrFF2cVmfsMlZ6SzX7qIB VUTA7n96aXJPmJN0T+SJLj1MlWjHh/jKm0BAEX3Hgr6wkHqtOG7n3/tLchQ3hwvZ25JZVbiKkpHAT ZmGBHcoQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rLqge-0017Fs-P6; Fri, 05 Jan 2024 20:21:00 +0000 Date: Fri, 5 Jan 2024 20:21:00 +0000 From: Matthew Wilcox To: Vivek Goyal Cc: Hou Tao , linux-fsdevel@vger.kernel.org, Miklos Szeredi , Stefan Hajnoczi , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, houtao1@huawei.com Subject: Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker Message-ID: References: <20240105105305.4052672-1-houtao@huaweicloud.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: On Fri, Jan 05, 2024 at 03:17:19PM -0500, Vivek Goyal wrote: > On Fri, Jan 05, 2024 at 06:53:05PM +0800, Hou Tao wrote: > > From: Hou Tao > > > > When invoking virtio_fs_enqueue_req() through kworker, both the > > allocation of the sg array and the bounce buffer still use GFP_ATOMIC. > > Considering the size of both the sg array and the bounce buffer may be > > greater than PAGE_SIZE, use GFP_NOFS instead of GFP_ATOMIC to lower the > > possibility of memory allocation failure. > > > > What's the practical benefit of this patch. Looks like if memory > allocation fails, we keep retrying at interval of 1ms and don't > return error to user space. You don't deplete the atomic reserves unnecessarily?