From nobody Sat Feb 7 20:41:05 2026 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 4BB6C17C79 for ; Fri, 7 Mar 2025 02:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741313237; cv=none; b=h59VtAHQpqMvcvE7fDcxTwIhJhuvllv1pzuvmAfBfu6C0m4zIghl8HFM8+QGPDnScb19U/de9JbuqTsAr+QjhtBtyl8jP5YlFvuGVwURH6bg0I12u38GLI01C526hrTM702M8A6CGZXcyJaP4cpFZ5rbGVgyhGXOe55MZJVhNmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741313237; c=relaxed/simple; bh=8J9wxNA7crG84L16NbrsOSIHJ9ghYcToW1qbyvhcyVY=; h=From:To:Cc:In-Reply-To:Subject:Date:Message-ID:MIME-Version: Content-Type:References; b=Lhq7/0VOxMeTeOTLpqkoFM4nkn3e7Vhvaro714c0/chaYvAZwjqjxYdBpm9PxPt6VA9B64rUD63Mr/xjN5bAmiSHYcmBYd7aAR9IeaiJSaqOaTtK0k8QPw6CaPJoj8YVs260Ych/vtWRklpFHTK0XDUDnUjayk6nB0bwImbgII8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=EgKwB7ma; arc=none smtp.client-ip=203.254.224.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="EgKwB7ma" Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20250307020710epoutp01f3a9db02ee9861468f3e158324e41f78~qYyhOF_gf2345423454epoutp014 for ; Fri, 7 Mar 2025 02:07:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20250307020710epoutp01f3a9db02ee9861468f3e158324e41f78~qYyhOF_gf2345423454epoutp014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1741313230; bh=8J9wxNA7crG84L16NbrsOSIHJ9ghYcToW1qbyvhcyVY=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=EgKwB7mas9u0v/QY6QyIHME9s9NrVdS8cOcmCQQW4nI6vo2ultjDub8A1/1SfN+AQ xvwPPC1N7iteevtdXvR/T/rWnvc+Imei1KPLXm85cpu5fB65RADI0GQGqfxrwIL8dI lAuVs6tUYzRdQpXU8e/x0NTG34FLCjtBOzog3Tuo= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20250307020710epcas1p2169879cbccba3210581dd5cc2c5494f0~qYygsj-wy0300003000epcas1p2h; Fri, 7 Mar 2025 02:07:10 +0000 (GMT) Received: from epsmgec1p1.samsung.com (unknown [182.195.36.223]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Z88ms5KFfz4x9Q2; Fri, 7 Mar 2025 02:07:09 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmgec1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 68.28.23253.DC45AC76; Fri, 7 Mar 2025 11:07:09 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20250307020709epcas1p4f7dbc7989988c32674ca79d7a4cf757a~qYyf-smuY1591415914epcas1p4g; Fri, 7 Mar 2025 02:07:09 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20250307020709epsmtrp1f246c0161cdecf6e660696025c4f0786~qYyf4ej2s2858928589epsmtrp1Q; Fri, 7 Mar 2025 02:07:09 +0000 (GMT) X-AuditID: b6c32a33-5a18170000005ad5-2b-67ca54cd474c Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 08.F1.18729.DC45AC76; Fri, 7 Mar 2025 11:07:09 +0900 (KST) Received: from ssuk04 (unknown [10.253.104.229]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250307020708epsmtip109d190634692605b936976f3bbff9bb4~qYyfpNT5c0429604296epsmtip1K; Fri, 7 Mar 2025 02:07:08 +0000 (GMT) From: "Sooyong Suk" To: "'Jaewon Kim'" , "'Christoph Hellwig'" Cc: , , , , , , , , In-Reply-To: Subject: RE: [RFC PATCH] block, fs: use FOLL_LONGTERM as gup_flags for direct IO Date: Fri, 7 Mar 2025 11:07:08 +0900 Message-ID: <848301db8f05$a1d79430$e586bc90$@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHaiiw9LXrMK4mioaI0ilN2PEwZlQJfPoLQAkXgmoQCszXN9rMuMbSQ Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCJsWRmVeSWpSXmKPExsWy7bCmru7ZkFPpBm/aNC3mrF/DZrH6bj+b xaH5SRanJyxisujePJPRYu8tbYvLu+awWdxb85/V4t7dBnaLyZcWsFmc/3uc1YHbY+esu+we CzaVemxeoeVx+Wypx6ZPk9g9Tsz4zeLxeZOcx6Ynb5kCOKKybTJSE1NSixRS85LzUzLz0m2V vIPjneN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7989988c32674ca79d7a4cf757a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250306074101epcas1p4b24ac546f93df2c7fe3176607b20e47f References: <20250306074056.246582-1-s.suk@samsung.com> > On Fri, Mar 7, 2025 at 12:26=E2=80=AFAM Christoph Hellwig > wrote: > > > > On Thu, Mar 06, 2025 at 04:40:56PM +0900, Sooyong Suk wrote: > > > There are GUP references to pages that are serving as direct IO > buffers. > > > Those pages can be allocated from CMA pageblocks despite they can be > > > pinned until the DIO is completed. > > > > direct I/O is eactly the case that is not FOLL_LONGTERM and one of the > > reasons to even have the flag. So big fat no to this. > > >=20 Understood. > Hello, thank you for your comment. > We, Sooyong and I, wanted to get some opinions about this FOLL_LONGTERM > for direct I/O as CMA memory got pinned pages which had been pinned from > direct io. >=20 > > You also completely failed to address the relevant mailinglist and > > maintainers. >=20 > I added block maintainer Jens Axboe and the block layer maillinst here, > and added Suren and Sandeep, too. Then, what do you think of using PF_MEMALLOC_PIN for this context as below? This will only remove __GFP_MOVABLE from its allocation flag. Since __bio_iov_iter_get_pages() indicates that it will pin user or kernel = pages, there seems to be no reason not to use this process flag. block/bio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/bio.c b/block/bio.c index 65c796ecb..671e28966 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1248,6 +1248,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, = struct iov_iter *iter) unsigned len, i =3D 0; size_t offset; int ret =3D 0; + unsigned int flags; =20 /* * Move page array up in the allocated memory for the bio vecs as far as @@ -1267,9 +1268,11 @@ static int __bio_iov_iter_get_pages(struct bio *bio,= struct iov_iter *iter) * result to ensure the bio's total size is correct. The remainder of * the iov data will be picked up in the next bio iteration. */ + flags =3D memalloc_pin_save(); size =3D iov_iter_extract_pages(iter, &pages, UINT_MAX - bio->bi_iter.bi_size, nr_pages, extraction_flags, &offset); + memalloc_pin_restore(flags); if (unlikely(size <=3D 0)) return size ? size : -EFAULT;