Message ID | 1644890154-64915-9-git-send-email-wangqing@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-input-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3B9EC433EF for <linux-input@archiver.kernel.org>; Tue, 15 Feb 2022 01:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233324AbiBOB7M (ORCPT <rfc822;linux-input@archiver.kernel.org>); Mon, 14 Feb 2022 20:59:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbiBOB5b (ORCPT <rfc822;linux-input@vger.kernel.org>); Mon, 14 Feb 2022 20:57:31 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2109.outbound.protection.outlook.com [40.107.215.109]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F14E11451C1; Mon, 14 Feb 2022 17:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kpP2y20MYGOxSEPc0GcMSozyevJPDMsBxdqncEMYFHZUXIqHOQUm3U6zc6bX08gaWINByP0mgLWcyEolNUIbMZUeVR96jnNGOS+3qKNK+yAFcoz0I0QHsQ1q3zhvUWmGVn08pviy2JxcOgV1kSzDnz/WcGizMamgwuDG40BMa3sE3Lg0eqG7lojfUpm0W0DBqkxn5Z1byrPwJmzkfXPTcQHaoea4iNsETG6/gzEI59iABrXLCsIUODhVzFT6LRDzqTqLCxNgijfHbaF7okxJiNSs5Lztfkk2abY0vsd/odOXWeDhGEffamBtN1iKHJ6cwpUJtnUhFbyxfzLRfI6RRA== 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=vnUOhbL312WydrIZGtqkVI+fDJEpdEbLKHZMp2nzkhA=; b=D1RYtJG1lkD9GW/NYymXmdEiW2jdSVEIIn2KMRY/hA9qYrNP4vgCeZ3xhQBGhmojpAzoA6x9EFUv4Bs6XcTekRDrjf1WRc9M+k2zLsIVwP75PQbukCQMn78Vye1NOShtL4PVSzb1IK2Z9iSsGYo5kYd3DZbCvqlXZScvpo2BVVmYAG0J+RGE987ZbCA7MuZ5iM7Frn/ooh0HA/wgjoELLQ8JC+qric+6xM9d+AxioqQhehszvk4X3VBEdaBP1prb3KnVuadVjhlVNbsE3w78LWOlsqguietVUT1TlxU1TEypxwGQZ4UnQ8yn7P8p0i2uXVdYwnE/j3LEjCTKeJMZZg== 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=vnUOhbL312WydrIZGtqkVI+fDJEpdEbLKHZMp2nzkhA=; b=GqIiQDLhuwcAXjWmqE+Zqk8WJ6EWQNe17U22epLF/Taq6SR7LyNVqeiDYrifXWhE6Kih08KhndBdwUzfXFhvo2gzZ2wdYFnC9f9GnNpVgKYxMKR+TjXg5wVlAHteb+FZKYnYOeU5tE/AuGwA8p5TUuuJ9ha81r51sD0n38p/J1Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by HK0PR06MB2771.apcprd06.prod.outlook.com (2603:1096:203:58::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 15 Feb 2022 01:56:50 +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.019; Tue, 15 Feb 2022 01:56:50 +0000 From: Qing Wang <wangqing@vivo.com> To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= <roger.pau@citrix.com>, Jens Axboe <axboe@kernel.dk>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Alex Deucher <alexander.deucher@amd.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <benjamin.tissoires@redhat.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@redhat.com>, dm-devel@redhat.com, Mauro Carvalho Chehab <mchehab@kernel.org>, Hans Verkuil <hverkuil@xs4all.nl>, 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 <wangqing@vivo.com> Subject: [PATCH V3 10/13] md: use time_is_before_eq_jiffies() instead of open coding it Date: Mon, 14 Feb 2022 17:55:45 -0800 Message-Id: <1644890154-64915-9-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644890154-64915-1-git-send-email-wangqing@vivo.com> References: <1644890154-64915-1-git-send-email-wangqing@vivo.com> Content-Type: text/plain X-ClientProxiedBy: HK2PR06CA0012.apcprd06.prod.outlook.com (2603:1096:202:2e::24) 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: bc486b2e-0c4b-42c7-dbe7-08d9f0266e9e X-MS-TrafficTypeDiagnostic: HK0PR06MB2771:EE_ X-Microsoft-Antispam-PRVS: <HK0PR06MB2771BEC0CF4E3EFFBC004F06BD349@HK0PR06MB2771.apcprd06.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QCWO2F/w7eHbPOL0e0e9xQNZ3K7Xw38kdf5QuAOps+fk4Qcyo4C93c+aP8pDzbFZqheTj3ekgZGi/KEmlKhO2hsT4HRpBrVAuDZtGAA/7+AhyggclMFAiPWcNsA85irQz1bxTwY4PAmsNiAwaQ7U5Spvdh/RaA08wsakr0eXNmjSl0CdZH2L7u52GJYQ+dB8pnl1cXqlAAk5se8p/5iZHmzeUUX1/TPuhcLcqUzRk2Eeo16YhX3yIkbFJ99sKMhYD2+1kDbpuUZct0ntXKZAy7BcLIGijpcXw0Y6emoKi4BJDB5WcD0wrbuEmvkgfGgyFwom4EhwUeuFZTyP1kHt35Ik673k2CMg80JKoPspYnxTcI2o5Xik5vtOOMqx/eT9W/9H8SZvl2hIT0dF3Wq5m0q+k7tNOi24kWszEVv9suEW8przc+tNA6lbAigv+gB8vbkfrg7QqsER7o9iPLvqpJTmdX2gUoNzdjHT6tCUiyLZQAvPLNgteDYd1Dzkg4eTX70lexMX35irUPEM2RmPi0t2FAljly1zKbkzhvyAl36WulZgHESjauZzgep/bb5v/rCPUyHKd8bgsMfHtFUXthTtzyD9BWd4ajwAsRRZbgQU05R+VhaLX38K/km+TYJ0bayJRFx9pzwfXH1M8z9nUyxmTz21Ial9TeG9T4gHHsfvkQSskZ4H6FJ81jCQZ9P6/CoG+ox2E6Dwdcz2v2DYxiJtDjHnbDQrDqcOOvtT8h4= 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)(6666004)(8936002)(83380400001)(26005)(186003)(6486002)(508600001)(107886003)(5660300002)(2906002)(7416002)(7406005)(921005)(110136005)(316002)(66476007)(8676002)(36756003)(66946007)(4326008)(66556008)(6506007)(6512007)(52116002)(86362001)(2616005)(38100700002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OcTsoEukQ+WkoN81aeNCUVTtA/p+y9SYnPvIhqVkCOJ9JSD22yIhnJ75M5XEn1Q4ZkQbaUON6f4JhZ5u52/RF/0lL9DGkR2VdAFmwZ7gbTKvT7PynwlXP0SjvYMWATYITfIVvjjwBQs+QxLhR0zB8XQ/iq78eCj4TYCPdttxNVqr8S4J5KrtL9Zxsj0cXdrtrvCIcr46hltG7mlz+KPHoF2zHRCFoLDMr52n6gbLaF8wzJ3K2InTyLh+JIhF+HH28Pr1pKUvCFwooMpQxcfalNpV/gPowcgYE5jmr9mk2nE5ilzdTc0KFh5COYqtoWV0rBnOlNbOtrOJEIlV6QM8D8TU0UZpUZxmQkC2jd9PAfL2IeaLgjV3AwyMjvD25DjleeiAC/CxM2g8KGW+4ExcNLMEgvFVVMPEZ+KCKhLpNU+/05zcGqmMhuSBLgb19vIqEsQy0QxKp2Tb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qo5JtSAi38QA2b9HhMJjY63jsfbOhvCrzqV5bsjbSeml63n/PoRUV1knUfBzS+nz/JcBuzxJoW2O4wAS2s9D37807mfgId4FgCldTVMHQ74= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc486b2e-0c4b-42c7-dbe7-08d9f0266e9e X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 01:56:50.7151 (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: zDKERJZpmV9cVwhCSBeq6+6IG4Ar72+JGr5GCs+hxdBhDvlX4ABHT2cnopQws+WWqunLrTbVc5vaE8NzrOjsrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0PR06MB2771 Precedence: bulk List-ID: <linux-input.vger.kernel.org> X-Mailing-List: linux-input@vger.kernel.org |
Series |
use time_is_{before,after}_jiffies() instead of open coding it
|
expand
|
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 5630b47..125bb5d --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -16,6 +16,7 @@ #include <linux/pfn_t.h> #include <linux/libnvdimm.h> #include <linux/delay.h> +#include <linux/jiffies.h> #include "dm-io-tracker.h" #define DM_MSG_PREFIX "writecache" @@ -1971,8 +1972,8 @@ static void writecache_writeback(struct work_struct *work) while (!list_empty(&wc->lru) && (wc->writeback_all || wc->freelist_size + wc->writeback_size <= wc->freelist_low_watermark || - (jiffies - container_of(wc->lru.prev, struct wc_entry, lru)->age >= - wc->max_age - wc->max_age / MAX_AGE_DIV))) { + time_is_before_eq_jiffies(container_of(wc->lru.prev, struct wc_entry, lru)->age + + wc->max_age - wc->max_age / MAX_AGE_DIV)) { n_walked++; if (unlikely(n_walked > WRITEBACK_LATENCY) &&