Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6878467rwr; Tue, 25 Apr 2023 05:19:41 -0700 (PDT) X-Google-Smtp-Source: AKy350a+rz0gd4npltPAQheyKcf9JPgd5LKWNFyPey4U5YKSxKadvDYPVkwZUpuXZ+GtjvxfpLNH X-Received: by 2002:a17:902:fac4:b0:1a5:f36:ae09 with SMTP id ld4-20020a170902fac400b001a50f36ae09mr15248239plb.7.1682425180979; Tue, 25 Apr 2023 05:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682425180; cv=none; d=google.com; s=arc-20160816; b=VUlMxSglO2ml5QEMGDVpAqF4p3tOy5pTGr3LpAR6fm/BgRjLK0OzD4av4Ttb0a5P2u ZGut+yfnZU78j0fdSCHX7wUD1EPUUShbocAYY++mjr/AO3aa1e5KwAIZna5k/SH7DZ06 fVhEegWaDlNH8Old7i9WFUyLqKOS2fdkso2ZMbIhCYMRBI4wOglNmoGxKz1Um+K48fyz Od5ItHRKstNCx9B5vxMJL0ZDSTI5AqauLdSeiVnY9lP69JdpMpeV+DI7opLtIjhtjE/S 0aRh6wA8wR3BFy3mn8nPfKo7xiIz1V9yUYAbMtrjdWgrRr4dOqRRUoq3dxw3uGhKAMhj SZMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JrWdyQb6nj+oJYwEMIPPSV/sDaymRPsGQfhbAVSA2K8=; b=JACHXPRNydbwnBvN/V++JmVQ/AvX4MKJv/I9vGXO5gMV/yCBuKkVepypmV67aW37do Di4A9W+PcHnvRFzoEHUWAeFatac3FP/wgXS9aUfDWERB0NQd5D9KRInR+BvdgO2LtouY A18CkO8hq6ubExMjTJcb4UBjWORUWSh5lLjvWo4FTOfASv82crBUfnKhQfgk6/y89NvG ZqQCcuZ9oKeOwFHsXGbrlvhNCY57Ovsd7o4Y4qTZrIiJavSU2WxMtt0hz2KSWoP5r69M WQ3SVoXds0sby07e146g3EPMJptBtegu80iCUKaZBflsAlqIEgCwdJrh5Cifk/Z/qoIi YNVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a17090301c100b001a221acb462si14859211plh.73.2023.04.25.05.19.27; Tue, 25 Apr 2023 05:19:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbjDYLzJ (ORCPT + 99 others); Tue, 25 Apr 2023 07:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233942AbjDYLzA (ORCPT ); Tue, 25 Apr 2023 07:55:00 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C484EFC; Tue, 25 Apr 2023 04:54:44 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Q5L5X06btz4f3smL; Tue, 25 Apr 2023 19:54:40 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgBnHbF+v0dkGEZ+IA--.20559S7; Tue, 25 Apr 2023 19:54:41 +0800 (CST) From: Yu Kuai To: logang@deltatee.com, axboe@kernel.dk, song@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next v7 3/5] md/bitmap: always wake up md_thread in timeout_store Date: Tue, 25 Apr 2023 19:52:54 +0800 Message-Id: <20230425115256.3663932-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425115256.3663932-1-yukuai1@huaweicloud.com> References: <20230425115256.3663932-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBnHbF+v0dkGEZ+IA--.20559S7 X-Coremail-Antispam: 1UD129KBjvdXoWrZrW3Wr13ArW7tF4fGr4rZrb_yoWkurcEga nYg3s3JrZrCFy3Kw42yw40vryUtF15u3WkWF92grWIvw17K3ykWry0vr1qv3Z7uFZrCryr ArW8Wr4UWw1YkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb6AFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUWwA2048vs2IY02 0Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2IY04 v7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_ Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x 0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8 JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIx AIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbJ73DUUUUU= = X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai md_wakeup_thread() can handle the case that pass in md_thread is NULL, the only difference is that md_wakeup_thread() will be called when current timeout is 'MAX_SCHEDULE_TIMEOUT', this should not matter because timeout_store() is not hot path, and the daemon process is woke up more than demand from other context already. This patch prepare to factor out a helper to set timeout. Signed-off-by: Yu Kuai --- drivers/md/md-bitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 920bb68156d2..06b980f71a6b 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -2475,11 +2475,11 @@ timeout_store(struct mddev *mddev, const char *buf, size_t len) * the bitmap is all clean and we don't need to * adjust the timeout right now */ - if (mddev->thread->timeout < MAX_SCHEDULE_TIMEOUT) { + if (mddev->thread->timeout < MAX_SCHEDULE_TIMEOUT) mddev->thread->timeout = timeout; - md_wakeup_thread(mddev->thread); - } } + + md_wakeup_thread(mddev->thread); return len; } -- 2.39.2