Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1708208rdb; Mon, 8 Jan 2024 07:51:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjp85jJT3qumn82nsns68m72fYjtSrhC9Y9h2hXhe/O4IUwo5AyIwuxPmZu+z9OKFeIQCf X-Received: by 2002:a05:6e02:1523:b0:360:74af:d9a0 with SMTP id i3-20020a056e02152300b0036074afd9a0mr5808224ilu.39.1704729065623; Mon, 08 Jan 2024 07:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704729065; cv=none; d=google.com; s=arc-20160816; b=gpAlUda5AgZKsa2ZozzKRvGjzBSNtGInkXmQmXx/AyX1dAqcThkly7l6M660SCsMjK hCG1kWsPs6+sDBZuGe25lKcFIcM6SqAeq9/C3x9qItHDrAHWax7dt8Yq189t0mPa4mc4 hkOqEU+9d8MfUlT86chYf7+lX5LSyJpZqUIyuduzxsHXYuN82z/etxKX8C7IAlGqbydN Hy2oka3YScKNz0IWgP3lgma5Smhq1VrzisHfHQrV3/JqkEDuTEEamk/vTEhVczWsOORV yDi1MVpaTySnmSMIN533EUo1M0TXIFQxwPEXJTAkcPHasf6aR1MAnhrle30jgLOF9J82 ISiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LXzSdb2GMelu2RY7M9wBwnEHadZ8ZB5xT40HRRNlufA=; fh=OAUFOVXXi7Rv/hmB1Tac131fHoXThccac2h/qAjxwZ4=; b=va1JXyJokYMWJLS+Y1t5TJrNa7uj+JcXmwkF457xK6n/MD90r+hB9WweH7rPLXJirZ Y+RcMTTeDG3cv2QVf7TlP8Znzc4iUqZouMGG0kAbvwb77HwXtzZHiO3QL7okYDFecuh7 /I+wAXM9LzwnJ/y21iDDTAAvxhhm6b120GMDuWGWf1/fUmHKnG5mrKrJLecuVqhjjHW6 UdP59PYwfu9TWHLhN/qrxb1iezMW3AOu3+HNlFHyJKZZe0bhWDsj9EHH/JAEkbHcb8oL zSkGpX/XPHo9k3OUjfBOqVWyElr2vO1Wx7yEklZOGSpxAh31wH1Eh4UrUDgW6tGP/grV ed4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jE41wOS4; spf=pass (google.com: domain of linux-kernel+bounces-19803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h26-20020a63385a000000b005ce13c996fasi20953pgn.354.2024.01.08.07.51.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:51:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19803-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=@redhat.com header.s=mimecast20190719 header.b=jE41wOS4; spf=pass (google.com: domain of linux-kernel+bounces-19803-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 78B1EB22E5E for ; Mon, 8 Jan 2024 15:48:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4860F524A1; Mon, 8 Jan 2024 15:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jE41wOS4" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 065A05103E for ; Mon, 8 Jan 2024 15:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704728913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LXzSdb2GMelu2RY7M9wBwnEHadZ8ZB5xT40HRRNlufA=; b=jE41wOS4sayDryxZ+P2NDNbSrKn7KY+/PDT05ysW5vubCm1WsWL4VU0ZoVPDq+JtluoIaL WYoBAuYxeYHwVuj/5U14iDy8xduy9iaDNHJoy37JU3cVHvAbw2J2ZLcmoyRZphhsiYX+Qq mGBWEerfikf8VoqV+mk4dS1iQCQpz+g= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-82-5TVjKgI4NYCMEu1t82eQcQ-1; Mon, 08 Jan 2024 10:48:28 -0500 X-MC-Unique: 5TVjKgI4NYCMEu1t82eQcQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DEDDD3C025AC; Mon, 8 Jan 2024 15:48:27 +0000 (UTC) Received: from [100.85.132.103] (ovpn-0-5.rdu2.redhat.com [10.22.0.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C07A8492BC7; Mon, 8 Jan 2024 15:48:25 +0000 (UTC) From: Benjamin Coddington To: Hou Tao Cc: linux-fsdevel@vger.kernel.org, Miklos Szeredi , Vivek Goyal , Stefan Hajnoczi , Matthew Wilcox , 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 Date: Mon, 08 Jan 2024 10:48:24 -0500 Message-ID: In-Reply-To: <20240105105305.4052672-1-houtao@huaweicloud.com> 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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 On 5 Jan 2024, at 5:53, 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. Perhaps not appropriate for this case, but are you aware of memalloc_nofs_save/restore? NFS has been converting over and cleaning out our GFP_NOFS usage: Documentation/core-api/gfp_mask-from-fs-io.rst Ben