Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp318209rwb; Thu, 1 Dec 2022 02:35:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ZsrJxHsALVwczoVfGvLW9hNsM9WTpXlF5AJB/70tQUM47sf5Yof4E6bnD+LTR632/5xUx X-Received: by 2002:a17:906:5ad1:b0:7b2:b15e:3242 with SMTP id x17-20020a1709065ad100b007b2b15e3242mr52864193ejs.672.1669890925282; Thu, 01 Dec 2022 02:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669890925; cv=none; d=google.com; s=arc-20160816; b=NOi6Q6mKwh+HHujNis//LHcCgJomWJO07tBVB7zTG8wOKwd/r49QI9oCQ1g8MJEKZS /GemLIYuWI+rJzRS4wKkU2w+5kSsd5iAKV5E6o/1W8vcmhinb45sf7T1nrXGJBarJ2PM ujwmDJDuQU4gK1ZvbWxcr6iN7taw3IvS9yextuA7UYwbilu8sXE0bpELZ7oDuJ0+xMRC oF3csEv5/wxVnR7PpdDxN3sAtShnSxYFlycTo/Ls6P5PW5bJ6LE9rIJnml5Zv4CCnSSS dfukU9XWk/GsigmCxc4zuQ9gmmyNz0lXbVSQEdZVTcuXzAzQtRNRQwKPj+51G4KAnCGC 5sYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=RvAcF4yt3U38ulka5v5lZO8tAA6N2kN/9W8fhnuQ3DA=; b=cJUinLAmSaqWu37r9hWlO3gOp/Yuar1cKugizkRLGBqMjcQQr4xQJWnPz4Cb69459x h7tKMACS9ukoIntn1pKkfXy3EtR7ZlUWtS4w9p5cp/i5SwYWj4P+ZExqkSKkWMiFMfAc D77NdstmQxdo8n8jqSWiLv7MRD1hiyZA4b1XxkLEX3MCQ6t+t3pC9qBCVxx2roGgNwtk hbkmMlI/b6uGeZP/4wM5b04IusXj+NePvB8B46fQ19XqnkRuTN5nQsP0Pmq1Jrz0nJFM ioHTuzDvuC9sCLx1LtrAoa/ujR6k+/i7vwZWHnwWmoI9Dxnxavz0PRAxaEiSZq0fB+L/ wQIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PthsZ+Q8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a056402269200b00469496d3bb0si4082570edd.208.2022.12.01.02.35.05; Thu, 01 Dec 2022 02:35:25 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PthsZ+Q8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiLAKAq (ORCPT + 82 others); Thu, 1 Dec 2022 05:00:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiLAKAo (ORCPT ); Thu, 1 Dec 2022 05:00:44 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C50B1D1; Thu, 1 Dec 2022 02:00:42 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id o5-20020a17090a678500b00218cd5a21c9so1485970pjj.4; Thu, 01 Dec 2022 02:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=RvAcF4yt3U38ulka5v5lZO8tAA6N2kN/9W8fhnuQ3DA=; b=PthsZ+Q8Y6NJRwPCIBP8MuFSXijY5REyP5RtsSO9OPxZiWTEKKwFMOos6DjWLQvBKM 9+68aLFA2KJibeLzcXKW+TRr0f8kBeVJPCy/2qKzfHy90Fie4M+cp5nPkc4pk11SeAia jH57uge2Q/jZXwDKyyUdiowPc6qMj7ayVGHpMarZsh6DN2oGN8wu5NKo3Iqfpk4ydUIY gmi0PquZQL7ahFmfCvPlElkpeJ25wvgTILpt2DQBpdv8azUNSn4Cu5/LBB5hDW8mQ6bU yoe5DDNTuabeiXazVGv43j+CRYcNSOCynorXMDyO4wEWc21G3Ob/mnt/+/tlpaqSP8bC 8inw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RvAcF4yt3U38ulka5v5lZO8tAA6N2kN/9W8fhnuQ3DA=; b=KGQeTFmVefap1I1F7sL06aLc30TWe4O2+9GFZ9OinTb9IwPYT8SAkPFZubmSnEPpGK CeLVcsJTp3yhFsVJNdRk5un3j+iz2LK0ehiOpmPnjcX0kZ9fh8JHMDO2nR+MiIL4DI0N GCCCKH94/wsD5w7gs6hVIP+WK70ox5kqyuioagD6Y4zjf0bLgFy9yTNj0W6JrXVlYAtO GIoLO94QtXwsc3W97n61SAmBgyL/r3d/HlRM/Kj5VQAit5IjM+5YTqQSaJv6760K1OTR r5HxasWm9ZgfPtnRq3TBoH+entgf7FMoeVNgvVTG78QRDsal2ET3BYA8M9OVU2vR930n f/Gw== X-Gm-Message-State: ANoB5pmjI+OwdBzoqBeuyxqsKdA4sVfPZ8/duxEhcAdtMqPV98kgT5Ju qe1eMc1ZnDnTNrxeNaWj85M= X-Received: by 2002:a17:902:ab89:b0:185:3659:1ce9 with SMTP id f9-20020a170902ab8900b0018536591ce9mr44744790plr.26.1669888841580; Thu, 01 Dec 2022 02:00:41 -0800 (PST) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id m13-20020a170902f64d00b001891ea4d133sm3185378plg.12.2022.12.01.02.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:00:41 -0800 (PST) Sender: Tejun Heo Date: Thu, 1 Dec 2022 00:00:39 -1000 From: Tejun Heo To: Yu Kuai Cc: Li Nan , josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, "yukuai (C)" Subject: Re: [PATCH -next v2 9/9] blk-iocost: fix walk_list corruption Message-ID: References: <20221130132156.2836184-1-linan122@huawei.com> <20221130132156.2836184-10-linan122@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS 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 On Thu, Dec 01, 2022 at 09:19:54AM +0800, Yu Kuai wrote: > > > diff --git a/block/blk-iocost.c b/block/blk-iocost.c > > > index 710cf63a1643..d2b873908f88 100644 > > > --- a/block/blk-iocost.c > > > +++ b/block/blk-iocost.c > > > @@ -2813,13 +2813,14 @@ static void ioc_rqos_exit(struct rq_qos *rqos) > > > { > > > struct ioc *ioc = rqos_to_ioc(rqos); > > > + del_timer_sync(&ioc->timer); > > > + > > > blkcg_deactivate_policy(rqos->q, &blkcg_policy_iocost); > > > spin_lock_irq(&ioc->lock); > > > ioc->running = IOC_STOP; > > > spin_unlock_irq(&ioc->lock); > > > - del_timer_sync(&ioc->timer); > > > > I don't about this workaround. Let's fix properly? > > Ok, and by the way, is there any reason to delete timer after > deactivate policy? This seems a litter wreid to me. ioc->running is what controls whether the timer gets rescheduled or not. If we don't shut that down, the timer may as well get rescheduled after being deleted. Here, the only extra activation point is IO issue which shouldn't trigger during rq_qos_exit, so the ordering shouldn't matter but this is the right order for anything which can get restarted. Thanks. -- tejun