From patchwork Fri Nov 18 12:09:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 1905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp158519wrr; Fri, 18 Nov 2022 04:13:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4SehnMxCcet1ZIQdzSFb6BFHO6cU8Yx8XyvUMGla5fes7wjSGHvcvt4kdXUzVEEIVWvmVz X-Received: by 2002:a63:ce0e:0:b0:457:dced:8ba9 with SMTP id y14-20020a63ce0e000000b00457dced8ba9mr6415695pgf.221.1668773621430; Fri, 18 Nov 2022 04:13:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668773621; cv=none; d=google.com; s=arc-20160816; b=s/1xQCSOeDNgdpHjYg5Y+iyDJ40nnX5/eau9TKnvnhnIlqwywh1nIRwefVGVq9zKYE ibzWu8RDOdyrttPcMwaEONUjFzYfAUDwYVKkxmK4VxULWFkfEPaT6+SvBxBPTRqZZrB/ vOxU6BMh7o0G6J1brOOkzy0hUB4/9UcJTCxLhYRHEwVLaTjkSLV4l4xI65/GJoyEFD1J d8lytThpztPbOtBSrG/dQGhYFECZ3eM6PoBhrLvxMFEJPB4fRh6ArMFSC6cmUSjp+ssI 0qRu7RAwgbE3myfrxgbUjTPdkHV1gjfsWSwhivVSLTQ+jtPDviTG7xGtKFlnLPHhPzYB GcVA== 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 :message-id:date:subject:cc:to:from; bh=nSGaQiOqdVUeB2mc9qgsaBLXm1WpOv8GryOtPGoWMTY=; b=eNGeg0lAR2wmHzzKLgDXWfUBiljOilCCp/aMQ3WTwepB/vS5Pn9Tksum+48ihOrlTH PF9pdMqBpds0O9w9SnPnSVt9bzqHl1QX2y+qGCJ929PrMXzseNhbqFv7blHBiGSLvAuF bfeXB5u+4x6PpuIPcrnjEVU8evgVgmLu8my8bdMoyaZwFATteqryOpKON5zyAsGrmR/I DvYIZKz2XRMGU4RUUMj3sPWOHG+/a8Wo0pLUuA9olh8CQxcLRWaw9hsjwQ7d7KWKCDJf /MQjDeJmrQz4/2RJSVRxqWq4LE0qsZ557cBn9zowJe0Tj+6o/JRECTfaqmVfGZvejdKk dr2A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a6542c5000000b004700981177dsi3788966pgp.528.2022.11.18.04.13.27; Fri, 18 Nov 2022 04:13:41 -0800 (PST) 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 S241522AbiKRMKS (ORCPT + 99 others); Fri, 18 Nov 2022 07:10:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241432AbiKRMKP (ORCPT ); Fri, 18 Nov 2022 07:10:15 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E7518FF93; Fri, 18 Nov 2022 04:10:10 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.251]) by mail-app4 (Coremail) with SMTP id cS_KCgDX2MwUdndjSIwaCA--.39489S2; Fri, 18 Nov 2022 20:10:07 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [RFC PATCH 0/2] elevator: restore old io scheduler on failure in elevator_switch Date: Fri, 18 Nov 2022 20:09:52 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: cS_KCgDX2MwUdndjSIwaCA--.39489S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtFWxCw4xJFyktFWxKw4Durg_yoWDKrb_W3 yrta4DJw4UXFsrtF93KrZ0vrWxWayxGryDAan7tr1UJ3s5Aa45Gr4UCFy7ur12gw45Aa43 Crnxt3W8ZrnFgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E 87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1lnxkEFVAIw20F6c xK64vIFxWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1l42xK82IYc2Ij 64vIr41l42xK82IY6x8ErcxFaVAv8VW8uw4UJr1UMxC20s026xCaFVCjc4AY6r1j6r4UMI 8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AK xVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI 8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280 aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyT uYvjfUOlksUUUUU X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgAPB1ZdtcbINgAEsI X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749835968879270058?= X-GMAIL-MSGID: =?utf-8?q?1749835968879270058?= Hi! These two patches bring back the fallback feature in elevator_switch if switching to the new io scheduler failed. elevator_switch contains the fallback logic in sq era, but it was removed when moving to mq (commit: a1ce35fa49852db60fc6e268038530be533c5b15), leaving the document mismatched with the behavior. As far as I can see, restoring the old io scheduler is more reasonable than just leaving the scheduler none, hence there is the series. However, now it's hard to keep the old io scheduler untouched. We can only re-initialize the old scheduler if we want to restore it, and the statistics the old scheduler collected would be lost. Besides, the restoration itself might fail too. I have no idea whether the two problems matter. Any comments are welcomed. Jinlong Chen (2): elevator: add a helper for applying scheduler to request_queue elevator: restore the old io scheduler if failed to switch to the new one block/elevator.c | 49 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-)