Message ID | cover.1668772991.git.nickyc975@zju.edu.cn |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;kkmonlee@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <nickyc975@zju.edu.cn> 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: <cover.1668772991.git.nickyc975@zju.edu.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
elevator: restore old io scheduler on failure in elevator_switch
|
|
Message
Jinlong Chen
Nov. 18, 2022, 12:09 p.m. UTC
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(-)
Comments
On Fri, Nov 18, 2022 at 08:09:52PM +0800, Jinlong Chen wrote: > 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. What failure scenariou can you think off where switching to the intended schedule fails, but switching back to the previous one will succeed?
> On Fri, Nov 18, 2022 at 08:09:52PM +0800, Jinlong Chen wrote: > > 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. > > What failure scenariou can you think off where switching to the intended > schedule fails, but switching back to the previous one will succeed? Mostly failures specific to the intended io scheduler, like consuming more resources than the old one that the system can not afford. But sure it's rare, so do you think I should just correct the outdated document? Thanks! Jinlong Chen
On Tue, Nov 22, 2022 at 08:14:30PM +0800, Jinlong Chen wrote: > Mostly failures specific to the intended io scheduler, like consuming more > resources than the old one that the system can not afford. But sure it's > rare, so do you think I should just correct the outdated document? I'd be tempted to just documented the behavior, because I think the chances are high that if switching to one schedule will fail that switching back to the old one will fail as well. I've done a quick audit of all three schedulers, and unless I missed something there are no other failure cases except for running out of memory. Maybe a printk to document that switching the scheduler failed are we aren't using any scheduler now might be useful, though.
> On Tue, Nov 22, 2022 at 08:14:30PM +0800, Jinlong Chen wrote: > > Mostly failures specific to the intended io scheduler, like consuming more > > resources than the old one that the system can not afford. But sure it's > > rare, so do you think I should just correct the outdated document? > > I'd be tempted to just documented the behavior, because I think the > chances are high that if switching to one schedule will fail that > switching back to the old one will fail as well. I've done a quick > audit of all three schedulers, and unless I missed something there > are no other failure cases except for running out of memory. > > Maybe a printk to document that switching the scheduler failed are > we aren't using any scheduler now might be useful, though. Ok, then I'll send two patches with the document updated and the printk added. Thanks! Jinlong Chen