Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2385088lqz; Tue, 2 Apr 2024 16:20:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3ScHqEf/B0BELeon9oQHgNdnLxM80AYz+stm80b7LsJmFkfhhtF64Uhudkq5W5bEyRF+JdhBiLFqaKgBmSYaby/nVhi7lfpuXRSGUkA== X-Google-Smtp-Source: AGHT+IFpkr/DpS1UgJ34LVfNFl6/W1NnlKlPwfS4r1sNGuFS25cZBmEwIBvjN3ANnb3jvY8B2zSs X-Received: by 2002:a05:6358:248e:b0:17e:7c50:40b5 with SMTP id m14-20020a056358248e00b0017e7c5040b5mr17929138rwc.17.1712100046551; Tue, 02 Apr 2024 16:20:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712100046; cv=pass; d=google.com; s=arc-20160816; b=tOzK7UwTrUvuCPVtkaYYBQLRr5LZbnsDTQuj7gvZjGoGpDe2mRuBVRkCqLrSWn0Kc/ Kdd6appfUnLL/m+Ayun6gn47bo0zWoNIq5EVgLY6ELyw3DocLw6/MV1Vmn0I4ZXQQyPX ThBqJ7Ujcg8W5DCBc/1/SEPHDp7vinh4J9Ud9ObHrPra4pnKsAc/bMhwKiPUTkFPKfCd MdGWyVsFZgaVXpExX1x/l/PRsNhU20lZcBND/8b41FTjZotunBsJ5GYuvKJMZqrIeCjR qQqU7CDIGnlKoouzMmfMm9Tx6JyYtki7BhELN3zwzdYqC8MZ5ZOZIMfJc35Vv35BQRvv moGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=mNK0VmkJz6J6xiyneJZ80sBKQSOoXTWzA0U3O29ARB0=; fh=nrcNDmL+3DVfy0thtgT1AnADL935+gqrAOqoYfcfokc=; b=i7vKjPUGDDKYDo5sgymbuRqLqb0m9BL/3wCTBwzs7u94H+oaM4SmLAkxocqU1BEGmq GBx1GdWjktc1JMf3D2kplYExnCufp52sC7Q0R8uCUyggDIaLQGwoxiSYdDBhx2DVJQmy +5uyMdW2X2B4LDdlrIxFWCdUDmFZXhwPBnzIATChcXzG2aICAP6/Ymbl2TwLNYsQkqBK Z6ulTWvKoinXYYrgTLpp1zyuek4pUXtqPdgnbKVUC3f5op5kKwomsvc2eMX4+/JMBQBH 8QxogfZ92pqcd3jwRRj47YG4FNEPTdFUqCOhLKzpvSkkCfCSHaYYK6z88re8gSXVnmlx IrYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b="lBdxX7h/"; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-128824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z9-20020a63e549000000b005dc8a259903si11495741pgj.453.2024.04.02.16.20.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 16:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b="lBdxX7h/"; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-128824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 25D542842C8 for ; Tue, 2 Apr 2024 23:20:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15E304501E; Tue, 2 Apr 2024 23:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="lBdxX7h/" Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 958434205F; Tue, 2 Apr 2024 23:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712100039; cv=none; b=lyF9xBUIf11x1XhLQeak90mMIcZoBTG5l7jp/kIl0b+GFCFMK0OCFt2ZaxWX5N6mmkMp2+Lt1EQRwGKrItCdRbHyKLrrnPBOUsNSyDGyEjJz9JAC4eRX/lS1vofCrdPvlcCFM3UGzWwSqPY8Qcd4ltmNx9YzAaMTJhgUQuzMd7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712100039; c=relaxed/simple; bh=rNRsMENYdMf0E/dZdciD6PG8aHTONVFr4fPxjmhlAOc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gFgLvzRTO+vpt5FfgPQ135SBIw4oLHBLO59X9qtzX5NCUNKpopsRe0mmV1R53YgHc/RnPWXHaWt+PKoa7J979XVPd6bShp1qu1xKw77tNUCdUlk9nxXMSgzrLChUAcyk5edCa7z6QurzijjDOobhuZo9c8LH03y+y7IKJcAX5oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=lBdxX7h/; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4V8P4Z6wr8z6Cnk8s; Tue, 2 Apr 2024 23:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1712100027; x=1714692028; bh=mNK0VmkJz6J6xiyneJZ80sBK QSOoXTWzA0U3O29ARB0=; b=lBdxX7h/BB4QtMNRc4va8Uo6qo/F8h/EvnOIBy0I qq/1TKKJJx+t6Ur6lOCKNwtMEFq0g8OWA9JIy2UnvpRZxNYklgyYA33wxnNTVB19 Ad5TPGnvK649+u9p2nBWA/zK/g/gjaLVuZZR2viqnWH4KlyoPGT6lAN6A6F3aDXr SzOg9PHlRuyj8383HTYDM8zc2JD2kFYEkaB3n5ukBIyIA6/EggID1w0rFXbZULVE W+kAN9s743TqWTlv9sKa9uOfbOxzoqrZaZnM1lkyIHNGl7QbGe6QpjdgLAGm7Lwe Eeiv9r1h/TyKX2t4SQ+CVbdIayXlU8zBk28w6wOLaYQMaw== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id pRb1OrAT1Uhl; Tue, 2 Apr 2024 23:20:27 +0000 (UTC) Received: from [192.168.3.219] (c-73-231-117-72.hsd1.ca.comcast.net [73.231.117.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4V8P4S6SlGz6Cnk8m; Tue, 2 Apr 2024 23:20:24 +0000 (UTC) Message-ID: Date: Tue, 2 Apr 2024 16:20:22 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] block/mq-deadline: Fix WARN when set async_depth by sysfs To: Zhiguo Niu Cc: Zhiguo Niu , axboe@kernel.dk, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, ke.wang@unisoc.com, hongyu.jin@unisoc.com, Damien Le Moal References: <1711680261-5789-1-git-send-email-zhiguo.niu@unisoc.com> <890bd06d-2a94-4138-9854-4a7ed74e0e51@acm.org> <92e45c93-e2ff-4d34-b70f-7772f0596e68@acm.org> Content-Language: en-US From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 4/1/24 10:44 PM, Zhiguo Niu wrote: > On Tue, Apr 2, 2024 at 5:23=E2=80=AFAM Bart Van Assche wrote: >> Oops, I misread your patch. After having taken another look, my >> conclusions are as follows: >> * sbitmap_queue_min_shallow_depth() is called. This causes >> sbq->wake_batch to be modified but I don't think that it is a prop= er >> fix for dd_limit_depth(). > yes, it will affect sbq->wake_batch, But judging from the following co= de: > [ ... ] If we want to allow small values of dd->async_depth, min_shallow_depth must be 1. The BFQ I/O scheduler also follows this approach. >> * dd_limit_depth() still assigns a number in the range 1..nr_requests = to >> data->shallow_depth while a number in the range 1..(1<sb.shif= t) >> should be assigned. > yes, In order to avoid the performance regression problem that Harshit > Mogalapalli reported, this patch will not directly modify > dd->async_depth, > but user can modify dd->async_depth from sysfs according to user's > request. which will modify data->shallow_depth after user modify it by > sysfs. It seems like there is no other option than keeping the current default depth limit for async requests ... > My personal opinion is to keep the current dd->aync_depth unchanged to > avoid causing performance regression, > but it should allow users to set it by sysfs, and the WARN mentioned > best to be solved. > and just only change this part? > - sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, dd->async= _depth); > + sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, 1); > thanks! The above change will suppress the kernel warning. I think the other changes from patch 2/2 are also necessary. Otherwise the unit of "async_depth" will depend on sbitmap word shift parameter. I don't think that users should have to worry about which shift value has been chosen by the sbitmap implementation. Thanks, Bart.