Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp362638rdb; Fri, 5 Jan 2024 12:21:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpUHrR0MCrAPblX/bI/XEaxW1O9mxfNB02W8a/0qWT8KNgxG9zhOi6cRSNf9xeHnKfuopY X-Received: by 2002:a5b:7d0:0:b0:dbd:58aa:4a7 with SMTP id t16-20020a5b07d0000000b00dbd58aa04a7mr2145668ybq.76.1704486101274; Fri, 05 Jan 2024 12:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704486101; cv=none; d=google.com; s=arc-20160816; b=TXAy1HfD8oSWwvdrag6BbSo5j/8aL1OP1gRqvsM+RQp1t03iXxTZ6uvG31WVgdxpmP Pam2iQzh06EJxuClPB502PcaglJoY4sIUIo9FpoZ0kf82DgfcGN7jVbFC9cbHW/y7Sa1 5c/ZyKprHEFLuhYmr3OMMr4yJuEeXFQG9Lx72FvtXYrutCm4a5/fcqbZl4apkGY7cLiQ f1NBTNN5XS3rwMMP8178M4JYhoK24GjaLo4aEPPC6SB0V7LXzDTlMGRm0mc2KMzOjiMB ck/LARjLOCCXfv44k+2sYXrFW6Axrp3U/ONi6AMKUIm8QtxoUG5jimvnp+3Cc3mWsmJn EmHw== ARC-Message-Signature: i=1; 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=GH2fUIxY3jgbl3dQw34A+7ZL3ZN4Y5y8qZthX19vE/I=; fh=v3nbYGjL6GkiMc1PnuPIjI9v4orT3rlj9Wr/xOgpxl4=; b=B0MAG11L/Oe8UDW89PYILtIKl0+eEpK5kXrYf0fE0kw8qRT8SR4kFtNH40yK5zmxy+ Fxo4jSXRUns/6OCZVANG2YLAquh7ewueHKPWhsy4Lt5xSFtfVCblUYGiNYRNjNlavaQT 2guqAAzBnVnGbJxxQ4fIbLJpUkG1hfkDpN8Q2a0j7zlM8CyX7SaPNa2pibiwkKjl2WMd b6Pah2oiPqYxHmAuN9usORaC6Qv2RXc+ntdcM9twHPf6+ZGtgPddQb4KymC9Xi7x8Hr2 9OCCM62tgw33XCmfv4R6DKQwFCJtrk8+MWwgfk57f7ESHsuO6ndtkN0OT05rV9o+2S8p pDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nBEhS1X6; spf=pass (google.com: domain of linux-kernel+bounces-18321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18321-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v13-20020a0cdd8d000000b0067f9d0c7fedsi2549611qvk.360.2024.01.05.12.21.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 12:21:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nBEhS1X6; spf=pass (google.com: domain of linux-kernel+bounces-18321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18321-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0C6841C233B7 for ; Fri, 5 Jan 2024 20:21:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 865513608F; Fri, 5 Jan 2024 20:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nBEhS1X6" X-Original-To: linux-kernel@vger.kernel.org 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 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?