Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp425512lqo; Fri, 10 May 2024 04:23:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWE8IabFQc8fIVw4Edp0rmM0eh3bma1LSponrGewOs0zMEDss9EI7InzRdLqbGQ34vZIvriXE/5P2bBBm72Vu8aVp9lXxyqTY7pGWvxGw== X-Google-Smtp-Source: AGHT+IHlxfYHHQeedOm5LWOsvqvPmZkH6ce/y9mNPxkHpf4JV4zgOGvDTi5WA96XaQDir3mSur/K X-Received: by 2002:a05:6870:b149:b0:23d:8e24:7234 with SMTP id 586e51a60fabf-24172fb6251mr2712562fac.54.1715340181637; Fri, 10 May 2024 04:23:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715340181; cv=pass; d=google.com; s=arc-20160816; b=KzPbpyZldt69LZzZNbfNRdBa2gtQkCRYCvQgYrPgTDuRWtnd7xl6dauzxaYzT6GRps yjXh5pbcXSQsAvm0SFUeyExIsD6ybRQhsnXDzhjkW1l5rL2V7pyYvHFhyM2faEXb0N2m JsN99nCUroTBILRacV/MivE9l9S0q2TX3l/KhlOMqERYwUiID8E2no/BCLrndHgDfl4m jxcNnII067ikofg173PSu/otiKfx5x4Rhuwa2NMNOITdqpFKdT/UZmW+s9IEaOi1Q2UN 12Pr7DdAQWV4tKrKlEUwIgNU5drnsAdsCEpJD+DpX/5dt0IGbyVf9rRRaqw33OrHM+x1 Nh7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=Zy8QCTGPTpb3aG4PVo2SX/wAY2HiJVOT9XtEi8yTZs8=; fh=8lxkgfURo+bxELhudNWmXf+qbM4jXr6fcUho14z1Ng0=; b=q2ctMVPEQ9Duw6yvtzugcMY+sr/rNjVuZNswK01L/iT4K2ViK7fzz57smvjPakPGBA qtgeZLGF793/t8/8k1I30AosRezY0MUV1jjdiehoDF73HaWG3FEyxWAK81nwmhO81Qj7 Eo9KGEaaG+zZWwuD5IoASVUqKdDe2AyzJ04Crl1FXmtG6QUiUWAuxq/idFlFfp96Tvw5 mCW2PfMojJz3xAD/Gc1MPaszoppuyButXkXVT6kTxF8AiFTK0ktsTbsO5sZwKzxNnoOa p4mYQGOIi5SqMXr+j1GgYv8ytuzr20RYJAqeeTOl4aHcdbF6kwabGSrRibmNUcU/BYp3 l/mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=ZbcdF7iu; arc=pass (i=1 spf=pass spfdomain=szeredi.hu dkim=pass dkdomain=szeredi.hu dmarc=pass fromdomain=szeredi.hu); spf=pass (google.com: domain of linux-kernel+bounces-175647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175647-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2aeeda4si3509416b3a.189.2024.05.10.04.23.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 04:23:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=ZbcdF7iu; arc=pass (i=1 spf=pass spfdomain=szeredi.hu dkim=pass dkdomain=szeredi.hu dmarc=pass fromdomain=szeredi.hu); spf=pass (google.com: domain of linux-kernel+bounces-175647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175647-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7AE06B20F44 for ; Fri, 10 May 2024 11:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C1E917332A; Fri, 10 May 2024 11:19:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="ZbcdF7iu" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 B6815172BC8 for ; Fri, 10 May 2024 11:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339965; cv=none; b=k9zUxyeDupXFSLLNzQxkDPGVaSL8mHgHLpMUqnE/DXLboqumyvmWahwd9RTsi8EbyrngTvrhzpVJ8+Q/WgVR/oTogAHM6rhueuFLrCi0TiIpsUMBGpl2TqdzAB6g66D+iZjXR+zi2sen1gwTH+/C3sLMSO87j3x9WC9wj+vCw4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715339965; c=relaxed/simple; bh=Zy8QCTGPTpb3aG4PVo2SX/wAY2HiJVOT9XtEi8yTZs8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DkDhcguxZSvwBtHhBG6lFMfOPpcqVnrkXUpqwFY5sPjVihJfpcgTQGSjFGrraqmtuKu01GI7Uj3ZEbtqhbDiUY8rzGezlBHJ6PuiFaK/TjVuFFR4Scv2bM9rQYO/5eoWV0604ph/0hGI7rZALWse70SjhSxFtwCvHff8tOm7qLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu; spf=pass smtp.mailfrom=szeredi.hu; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b=ZbcdF7iu; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=szeredi.hu Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a59a9d66a51so437291066b.2 for ; Fri, 10 May 2024 04:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1715339962; x=1715944762; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zy8QCTGPTpb3aG4PVo2SX/wAY2HiJVOT9XtEi8yTZs8=; b=ZbcdF7iu8bIrvgMLOQta4T9Y+U5I9JgVINUWO0XB2M7Z4L4P++obh44eLEeNM4yyP9 +c6xBt9h0d2hchQ2TWMNJ2EYsLlgKwQo+35mnG1vrWys6b3fksHJwoR4d7Dfbg3alOnK qmkqPbcLg8Sc4wV7P6j4h8UIQAlE/xxU7Ae2g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715339962; x=1715944762; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zy8QCTGPTpb3aG4PVo2SX/wAY2HiJVOT9XtEi8yTZs8=; b=ZbvXfxuTbcjja3vMbP0M8/ZwXf/JKLzJKQnXJNFx0/PVNd3f+WgB3iTooPIEkgX7LJ OjlVawVwO6K4CF3ij4aFWRXI/ytZRWCmtTjtzG6eZN+FVsuOx7sU5y9a0V+9xxYL5YpB ujn45j5bsEMUXXTyy8VBgj7Z1AcZC2u+ts+0iNs8VqUoEEcgQqlc2vv9MaJxj0jHyjHe odksaZhL1IFV4bXTsqS0t75gpxdjilfxVOkOOWbMj2KE1XKMJf6UBlCUS6ToIFprg+so NHuqp57xFDRbSPPiQbhWsg1lTIbhS4cxOWVGgP1sMEdvlUi1v14nTrwool+2fgM+37Qu Om6Q== X-Forwarded-Encrypted: i=1; AJvYcCVAb5yTTDuNiqIWHiH5EybwiqF7DF93piP+R9LKMcsfGbzZZzXCgscN3+lhpBCVXuKWjbJ+JXzDBOwOvcK1YNeK4GmJ6K0o7GXPkoR0 X-Gm-Message-State: AOJu0YwIEOLHr4YTV9yjqWSg2RWYRGrfNGJQOX/S/YpLWU1zvj/3jgXC heFswZ6JztyGafH0EQQ1vb4+TWZ7JwktjxkYWCgcJ7uj1Nuz0nOAR2ictKYiHlSSB86qYrc3p6u NCmS4F9r81uSmqTlqpm3wVbKVWb6rSZRhzx2vZQ== X-Received: by 2002:a17:906:f592:b0:a5a:1562:518d with SMTP id a640c23a62f3a-a5a2d53b998mr199022566b.14.1715339961830; Fri, 10 May 2024 04:19:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240426143903.1305919-1-houtao@huaweicloud.com> <20240426143903.1305919-3-houtao@huaweicloud.com> In-Reply-To: <20240426143903.1305919-3-houtao@huaweicloud.com> From: Miklos Szeredi Date: Fri, 10 May 2024 13:19:10 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] virtiofs: use GFP_NOFS when enqueuing request through kworker To: Hou Tao Cc: linux-fsdevel@vger.kernel.org, Vivek Goyal , Stefan Hajnoczi , Bernd Schubert , "Michael S . Tsirkin" , Matthew Wilcox , Benjamin Coddington , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, houtao1@huawei.com Content-Type: text/plain; charset="UTF-8" On Fri, 26 Apr 2024 at 16:38, 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 the sg array may be greater than PAGE_SIZE, use > GFP_NOFS instead of GFP_ATOMIC to lower the possibility of memory > allocation failure and to avoid unnecessarily depleting the atomic > reserves. GFP_NOFS is not passed to virtio_fs_enqueue_req() directly, > GFP_KERNEL and memalloc_nofs_{save|restore} helpers are used instead. Makes sense. However, I don't understand why the GFP_NOFS behavior is optional. It should work when queuing the request for the first time as well, no? Thanks, Miklos