From patchwork Fri Feb 11 02:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5pOO?= X-Patchwork-Id: 12742710 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9602DC43219 for ; Fri, 11 Feb 2022 02:31:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.270024.464202 (Exim 4.92) (envelope-from ) id 1nILiQ-0004Mh-6E; Fri, 11 Feb 2022 02:31:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 270024.464202; Fri, 11 Feb 2022 02:31:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nILiQ-0004Ma-2m; Fri, 11 Feb 2022 02:31:18 +0000 Received: by outflank-mailman (input) for mailman id 270024; Fri, 11 Feb 2022 02:31:16 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nILiO-00046f-Gk for xen-devel@lists.xenproject.org; Fri, 11 Feb 2022 02:31:16 +0000 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20702.outbound.protection.outlook.com [2a01:111:f400:feae::702]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id af2e3b17-8ae2-11ec-8f75-fffcc8bd4f1a; Fri, 11 Feb 2022 03:31:15 +0100 (CET) Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by PU1PR06MB2326.apcprd06.prod.outlook.com (2603:1096:803:39::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Fri, 11 Feb 2022 02:31:12 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb%4]) with mapi id 15.20.4975.014; Fri, 11 Feb 2022 02:31:12 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: af2e3b17-8ae2-11ec-8f75-fffcc8bd4f1a ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=npH1iPy/cK2EfovjDDJ0g29/nvaBE85BtC0SCeJi8J5FXnq1JoPf3PNTYZLFlsfZyI4fw9w9+8IaUCg0QaGXRvDKRzfylathGXdfBJv8apiCyrU7Cru9sXOqq11hXbhNJXaUSBchllWj2ZX4WAXkVXC1DPtdGjIxKIuqTGL1ApaoG/4orO4TAgzlxYmMMsHgjKxOGlDKeFAhg30ESkSkM6xZYv7NwZUZqn7sFhVvhltmGwjOY99V+yIJaASXFJ8zzdpNgq8XBFHmWCl8at/EpTFdJAlA/6XuGhyCUL2Xe7+1f3VghJ0uxxoD9qw1hzwrl1K095OLWU3tUshRY6m9mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IYuRSWgY6HaeljgNbxaZaf003O9SNKziTfmoexXwmbA=; b=Ff/TaPCh2f00LsjtWP+09mBSTE0lytvDFZ3xbkS4jw+/a5T3odWlRplg3MUYR5thE/TuBAOi29OWXNPdvEFfhhAxm5GjVBYCw+E00LFfpNrHK+QpZ56c2liJJ349UpZNQZ1saGtI7uB8GpZ/koSlMrOh4FXOglVIRfkxMXXaxiWIzF0bBtXGkv4CY6e/J+4T7GbpJGQHMblgAnW9aItBuwk5QMqEvmc/EDATSyaCNXO2E9e0rjDqba+fZJpeuWv0IcxHKnzWBywITvYK0Cfcn0GvZwZgml9a2e9M9ahEC9PAvNMPdp+Zncb+AI9kWnA0wLdmPUOpl6zNQVipOEM6ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IYuRSWgY6HaeljgNbxaZaf003O9SNKziTfmoexXwmbA=; b=DahaCz8LcBl4s4N93+t6hpH9V0D76QtWgLDSv/Ttcuazd59HNa8GR4q9vUL78daNMYKu3C9NuRFOCOANhI9z9aGVHZjLH+FxTNt8gvf7YM8+wsEiP/4KT9ZK6Dtn9VlMWYOWEZd1xJEHTtwkYou9gsfNcZsP0LmmireP0VMWUZ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; From: Qing Wang To: Konrad Rzeszutek Wilk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= , Jens Axboe , Michael Turquette , Stephen Boyd , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , Dmitry Torokhov , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Mauro Carvalho Chehab , Hans Verkuil , xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org Cc: Wang Qing Subject: [PATCH V2 1/13] block: xen: use time_is_before_eq_jiffies() instead of jiffies judgment Date: Thu, 10 Feb 2022 18:30:24 -0800 Message-Id: <1644546640-23283-2-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644546640-23283-1-git-send-email-wangqing@vivo.com> References: <1644546640-23283-1-git-send-email-wangqing@vivo.com> X-ClientProxiedBy: HK2PR02CA0178.apcprd02.prod.outlook.com (2603:1096:201:21::14) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4453172d-1062-40a4-51ed-08d9ed0691c8 X-MS-TrafficTypeDiagnostic: PU1PR06MB2326:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1284; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eP6YOw4R3jawIEQSMCI45OGmHyly8vyYqkhdazwPrzt/6mtGuIm71LmjFaxy3UVdqYDII6o/y/paR4ORUrg8wMyGV160gfTUQz9n5XwUATSstX5nu22RuE2sZxAZB23/YiAyCv1OX+HuegZUDD5lOEVEc6CekrE4Mal29dnB95X5fbrQGJzYk+XIKdNtt96nwEhHDxQjy4pj7d3pE5VaX9eMSCBhCBEC9iCFkRuzLfGtk9gZnwXMRJlKor3LLtrfA7CBwianCeTo+bpELFXyvu9LJCw03dF7F50eEcA3DuXkoWw9dTLPwjG7mJqa+r9u5D9eBQZBUce22QKwLgyhPcuGXa2kshtC5V81ojRl8eyt0yUNosYZ42KOeUp6toEG3uLD+4nhVSuloqdJKU1VCcpABn0f+LE8zMftaja2FIfzdD27fEwVQxdpD24upmy6rqVLvEi1/2cnacV7YSVU3Igmo40bsXSHClkLZTCPsdZ962221FDY+1pc9yTSlYoahyWqjc/mm81tDPEWnMhlXTZ2KNVr/4IjVUkk4ij26KtXBJmtGzwp4zB4wl2rxr/xyLgmDzs2mW/16icoCVHomtTT7manT7c5fGBM35UA3KKs6k/BugqXbMBiBWWGdWFybPoeG3iZNsOqhVoWWxweotu2czABYRfNcH9FwTUX/zuSKqjfnbW7lQXTJZET+ole3DBOvRqdwg90WVQaBtLlGExMPrX6cUf7lH669g2bGWAQP1QdDWoZoiSLsJ379vAG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR06MB3082.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6486002)(316002)(508600001)(110136005)(2616005)(52116002)(86362001)(6506007)(6666004)(6512007)(186003)(26005)(2906002)(36756003)(66476007)(66556008)(66946007)(921005)(8936002)(7416002)(5660300002)(7406005)(4326008)(83380400001)(38350700002)(38100700002)(8676002)(107886003)(21314003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MPOxFWmB5E2Pt/1C2XrNteRXkmz8Srv8O1WeQjdRIJU6rqpIOUQ5pVdAGRBzikiVLOKIG/bsksxsxLXa93yDiSqxXJ2QAMm2lSXohTG0XKgY/DT/HRrbdMgo3eW5tUsoS9yKaWiHtelJ11se6jPYZyL4GXtGZ/ugyMCK1H6QXVu2q0n2VqSOmOZudoKGdD8HPLpn+yYFL9B0KRLO9T1629z1rr1KDv7WgxJ6KwKZwzwjOwONhz7QhC9lX8MBPJT+NuaMNgfnykBSYwV8efbX/Bq35XKgjEF1NVac34OxTqiXEt2rMv4di+3kp4C7gIfqwRyqUNPWmQY/F2Qf+GG0d9b+4nLSI3F5YDGaxm38SoZ9PQPJVtzh4lfpYCmt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odG5FlLPNgrh5De+m5iJ28Qmzop2+kX5ID2mg7VNVs8sBvz229JrioWKIYj6I3fLCdLGvXugW6XB8fYTeviA+/f3V30Gu+/IsVQP83eIvKFHYM5YoGHYg60uf5f8oGOUHibrx427WqgVH/KWJehbpv/NF2OxBzaHu2DUpQ8CuTrvr9xfXwhLiC3Xf0CZXHIM= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4453172d-1062-40a4-51ed-08d9ed0691c8 X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 02:31:12.3078 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R/uacg7VVuyGzwc6yT/Jpc+2vpb5IQkWzzzmvRWJ3i/mySH8q4yB1L+ZwI8D+kW90tZHy4eG/bm1/t4R1NkkIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1PR06MB2326 From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/block/xen-blkback/blkback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index d1e2646..aecc1f4 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -134,8 +135,8 @@ module_param(log_stats, int, 0644); static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt) { - return pgrant_timeout && (jiffies - persistent_gnt->last_used >= - HZ * pgrant_timeout); + return pgrant_timeout && time_is_before_eq_jiffies( + persistent_gnt->last_used + HZ * pgrant_timeout); } #define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))