From patchwork Thu Sep 19 11:29:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qun-Wei Lin X-Patchwork-Id: 13807650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D438ECE8D78 for ; Thu, 19 Sep 2024 11:30:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 609D16B00A2; Thu, 19 Sep 2024 07:30:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BACA6B00A3; Thu, 19 Sep 2024 07:30:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 347CA6B00A4; Thu, 19 Sep 2024 07:30:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0FBF06B00A2 for ; Thu, 19 Sep 2024 07:30:28 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AD3D140C61 for ; Thu, 19 Sep 2024 11:30:27 +0000 (UTC) X-FDA: 82581269694.13.0FA1D17 Received: from mailgw01.mediatek.com (mailgw01.mediatek.com [216.200.240.184]) by imf21.hostedemail.com (Postfix) with ESMTP id 322A41C0014 for ; Thu, 19 Sep 2024 11:30:24 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=f+gsnbtG; spf=pass (imf21.hostedemail.com: domain of qun-wei.lin@mediatek.com designates 216.200.240.184 as permitted sender) smtp.mailfrom=qun-wei.lin@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726745313; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=pFtDBXloIcerwPHPWpyl2alet9mKUnrBwiIRPJMroSA=; b=IIrVJvGAenQM8ZonFajpAnzSdrilYSD1oCLSWEO1HlfoYmuz07csmcMPmjJR3PC7k9C4/l n1+3tCsAycgCkUPiTnV16cVGlC217KHW/X/7ErmKIeDXO3kh4G5xr2RB8ccIhRS9f74n4U lLrt9kbS+iyVj+Tu492GVWuMkJFtlG4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726745313; a=rsa-sha256; cv=none; b=EC6tiBfRivS3hy/59pqTMRzcnUXrPb1tI0F1P2v1tLbPArMUZZspQSbjtZcKfNz8LYm2Cy Vr3I03X23yMKvXoXQicja5gHJMCVCcf0SiahTucgqpRz2GRIl99KfwxVKcGlPmVAhfl5AF Ypcs4X7XAqFVdosfb7rarQ91R37y8VA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=f+gsnbtG; spf=pass (imf21.hostedemail.com: domain of qun-wei.lin@mediatek.com designates 216.200.240.184 as permitted sender) smtp.mailfrom=qun-wei.lin@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com X-UUID: 8a8715ec767a11efb3adad29d29602c1-20240919 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=pFtDBXloIcerwPHPWpyl2alet9mKUnrBwiIRPJMroSA=; b=f+gsnbtGned9LkWJWc5NbYauoXN3t+I+B8r4NjplArVdmHSzRv8ml7tuNqPBcjEleuZBvJcEc7x/DdJSmnUoKjYJHtTizVLH01mqp0w6vDQrz+gEhjtEoum6xezrvN6cpBTVZw5kPv9kNxDBR7lniBr8+8A1yQmW+Zbw2VIgqQ0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:96634d60-0bd6-4ea4-8fd4-e17ba12fd980,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6dc6a47,CLOUDID:e5f03d9e-8e9a-4ac1-b510-390a86b53c0a,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 8a8715ec767a11efb3adad29d29602c1-20240919 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1765836027; Thu, 19 Sep 2024 04:30:15 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 19 Sep 2024 19:30:10 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 19 Sep 2024 19:30:10 +0800 From: Qun-Wei Lin To: Andrew Morton , Matthias Brugger , AngeloGioacchino Del Regno , Ryan Roberts , "Huang, Ying" , "David Hildenbrand" , Chris Li , "Matthew Wilcox (Oracle)" , Al Viro , "Dan Schatzberg" , Kairui Song , Barry Song , Jens Axboe CC: , , , , , Casper Li , "Chinwen Chang" , Andrew Yang , John Hsu , , Qun-Wei Lin Subject: [PATCH 0/2] Add BLK_FEAT_READ_SYNCHRONOUS and SWP_READ_SYNCHRONOUS_IO Date: Thu, 19 Sep 2024 19:29:50 +0800 Message-ID: <20240919112952.981-1-qun-wei.lin@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--2.319100-8.000000 X-TMASE-MatchedRID: y/MOm6ldwRLxEHpzyfiYCrCvlllU7Dl1u56wFPSkMVFsmSfP7d/dpYhK asDlRLg0PMCTxZ0FhhdYo3G+rvxrNUkjllSXrjtQFEUknJ/kEl5q8/xv2Um1avoLR4+zsDTttrr TuahHzlGpp01G3uBXtb0XhwlNA8MHofnMcDO+aeBJiBkhcxr75pWf1beiAmbTHliXM5eW2aacaV HiDzvLgZJWAqw/Km95o4s7o73brFxJmt82E/eyBQGH0CAFIQWsmb5gmylW+PbGS+seVPx64j6Qr n3xh/cy X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.319100-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 934E8F1C009F82DA8C65E157967D6F7A839701E4510113EE88E9F19DE3C52A232000:8 X-MTK: N X-Rspamd-Queue-Id: 322A41C0014 X-Stat-Signature: u3i3oobac7fy159exgngs13igpsp5gu3 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1726745424-646347 X-HE-Meta: U2FsdGVkX1/wAb5G6k+krV7QPv0XbhIpLAGaCtIl4tHTw+NhrS4juaktIcuYyBfqAWaYZLJzOimxf56MHz2BBvr13D7XsRFc6+UYjm5HaZKaAAjVonYSEI5/7PMLEFRTRyq+oPKLbhHaxSAyPvWphWj8YDFiQpRqMx7lOD0p2DXlMFX70cEy/rTAVRaRmzCnI1hfkKZPAIXDTdXx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-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This patchset introduces 2 new feature flags, BLK_FEAT_READ_SYNCHRONOUS and SWP_READ_SYNCHRONOUS_IO. These changes are motivated by the need to better accommodate certain swap devices that support synchronous read operations but asynchronous write operations. The existing BLK_FEAT_SYNCHRONOUS and SWP_SYNCHRONOUS_IO flags are not sufficient for these devices, as they enforce synchronous behavior for both read and write operations. Patch 1: - introduce BLK_FEAT_READ_SYNCHRONOUS Patch 2: - introduce SWP_READ_SYNCHRONOUS_IO Qun-Wei Lin (2): block: add BLK_FEAT_READ_SYNCHRONOUS feature for synchronous read mm, swap: introduce SWP_READ_SYNCHRONOUS_IO include/linux/blkdev.h | 8 ++++++++ include/linux/swap.h | 31 ++++++++++++++++--------------- mm/memory.c | 3 ++- mm/page_io.c | 2 +- mm/swapfile.c | 3 +++ 5 files changed, 30 insertions(+), 17 deletions(-)