Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp448485lqs; Thu, 13 Jun 2024 15:20:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXv8pn6FWwpURgerXEDS9RTEWcYPLlFFt7J8vbPd1PO1S/Xti5lDW7VRrjuOqJ2mVCaU1L3ie4l00b1X68Rq3CTpDH90l7el/Oud3JgHg== X-Google-Smtp-Source: AGHT+IH1MKxa1y7fdw8JQXptorkmGR68KP/pI++VVOy2i6cRkmLWsPbBoWEEwNTf2BIqr+fn6DBU X-Received: by 2002:a17:906:3853:b0:a6f:5192:6f4d with SMTP id a640c23a62f3a-a6f60cefd46mr68554766b.8.1718317239495; Thu, 13 Jun 2024 15:20:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718317239; cv=pass; d=google.com; s=arc-20160816; b=CHLuduan92cV6a7SVkMTEJe9oz6HL5pG0YsC/c0/u9p4TgO8d5nwovBXXdbaW7++nO r4SWmw/77UuLX/Ztkn2pIAYnVseHgFmHfN2oS/LuClDUd6hWIctsQ5b7eQbCjT8llzMF ELDhLvAOFAVfDbVb3fpLf9I2YqKpnkxFP8EqS7FQ9rWOyCRfvtmwMo5WKIv/b/pP5fS8 uk+MnnGtkKRsfiPPFkuzlELmDZ+p6hIm9DsZHMzY+9gBi1ChmCElSZwC61Hn6Ee65Zmt JDINvGzKYYSafcNKD+bOIWDKE/C9iHeW94nDobL/UBadXP/DHOoJRaokZGvQBwf6GEbD urOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=1jg4v2BGp1MDHKNEcJnr9qjZmB+J5b1qf8nu8looBk0=; fh=PF0lNDws6jTJA6GQMCUaL11g7O8L67u+/TfsU023grY=; b=jXBsXgxdMm6j3qhCq62R98ONA7K+eEH4wBt5aTJnSTY95qWCEQTsZM9vDO09Laah7z VCL45OU3ODSXMkb55rhcewk6xmUydwXqEWRsZNQDy9Ll0jVCCbzMLc5BLQ3Hz908Re6+ 1FfJiAMzZIsw2w5oCWD9eydMn2LP7kISzc8WfUuGi+8roy5iiM0IjzBnYw1idzhqtV0H UjzSU8FtngeVXIptEsyWBApRw77FmM3YxOb3hAIt7PZVIXVjB087ZsINXyBXsqepK2U1 ybjzXtGXjWjvMteExKwfQwkuzNpRVAddYphQzCNYJBXANEgy/9YeiSeA/MeS9QhpMMem 54uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=I4RqPMse; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-214056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e26dadsi103708166b.761.2024.06.13.15.20.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 15:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=I4RqPMse; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-214056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3554A1F225C6 for ; Thu, 13 Jun 2024 22:20:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CACE14C5A7; Thu, 13 Jun 2024 22:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I4RqPMse" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB38E13B580; Thu, 13 Jun 2024 22:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718317228; cv=none; b=juij93oDJQd7p8NU+dS30LmHg7p2j2KXTPnmoleSHtV4gMzBAMradiskL/BjlvsTjdrEsBIk2vN34J9AE5JpTMHe8MTPukc5g+Fq6TyMi7Ue7ahIDid85da3/VbLI6YaubEaLHrQydwzdXAE8ULv9NGAnRciYd4B1JjGy8vmYHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718317228; c=relaxed/simple; bh=HDqW2DtKDteM+/7uZVEBB2l511EH5+IAceScCpt/bvc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X+oVbV/LU3jGzj1TBcywb4fB/SYhmDR+uDo4DtrEZ3Uqpq2c5KCKYiE6YbVtk4n7S2ocDOeb2tVslB+RtJzDvoLDY6UtKk6Eiy1Di/PrJ2qrSP4rEufeKlkfp78Qe26aeWrFGQ2lHuP8dmRgFo4f5TsTHxfotLkOwGa7vectd84= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I4RqPMse; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-705c739b878so1571330b3a.1; Thu, 13 Jun 2024 15:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718317226; x=1718922026; darn=vger.kernel.org; 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=1jg4v2BGp1MDHKNEcJnr9qjZmB+J5b1qf8nu8looBk0=; b=I4RqPMsePEsUO1SJxJmB1y+a8SxX99/B67F3xd1s08zlIrOQm7WUUhrATqQxenX1LS ZYloNvtQ36KNz3ThYB3uQhoULXyvTAn+hQfmiVE+T/Uh+pFlVn+BS1V0PKNYr44dZ3ts zKfaVZbbtJXpe/bYqJYovIAneRyNxlFQFSrEWi/C2iVZRwlpK/LgOyCdtLL+oSQ4rhDs 2l6hedls0B7AA1JyYsADRXGbj4oW9eJgykmvV3ch+onvw7QgwmtdmZKIRBJZfhlDH/C4 iTWML/EUqY82BZUEfgnmm8DwkKIMRQmBxpQ0soYg3nK08uavxJ4qErStAr4lomonCt6Y pu3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718317226; x=1718922026; 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=1jg4v2BGp1MDHKNEcJnr9qjZmB+J5b1qf8nu8looBk0=; b=FQotnma/NNvi/vJghKfRUC5ekEtVVhIWy8tTXbJ3XQfdL7LMUMhmGbIM02VbZ5BIpD YcyKTogeZLs5FNCJH109Pq23fCd3Uxup0hufIveBURZVMIN06A5GfP7aMuahvfdDc7ec bTdoyZr90SF2BIQ9EF++1//hdhrS6pxRTjNDpicC/FoQ2jMjoYScKFtygAyMHENdbkj3 07N4GMK5ytfF4dcW6MszE3DPoCrbUhyATl0SEpbVKcmbYgrYCczJAaYOYCL/MXOurCuA Q3Ox9YnofAgvWh7oC9eYbgKPI8W3LY0Ig659SfOIzBxY6E/veFsu0TYNS2z7MouwMzAV y/cg== X-Forwarded-Encrypted: i=1; AJvYcCXB3ffMg+DCAjEfi5gc5zJBaYPEApd+8paei+fHdmlmmW9Iuojjv0ijzJ1NdrmobIJqk04VQdiIrYjvXa/c/a1vrEFQBkOL8lYZ6+q1WPSd1GPLdiIk4NdgW3MQ1npfiu3ZN+ooXj/W0q7myW8Qpl9Ebb5gUXtYS+JoaZLNybuXfeE+ X-Gm-Message-State: AOJu0YwtRMVw96ukBIuURhEoB/ki1RgFTztvdjeEgqg68y9N+KygCxBV vZd68+Utuyzwc4H6TmY1yDX22xs7wS2btAsCWxpyxKMNqm/QREcnzdkyhQ== X-Received: by 2002:a05:6a21:2790:b0:1b4:b4af:6052 with SMTP id adf61e73a8af0-1bae7f93cd1mr1244172637.23.1718317225962; Thu, 13 Jun 2024 15:20:25 -0700 (PDT) Received: from localhost (dhcp-141-239-159-203.hawaiiantel.net. [141.239.159.203]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc98915esm1897860b3a.96.2024.06.13.15.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 15:20:25 -0700 (PDT) Sender: Tejun Heo Date: Thu, 13 Jun 2024 12:20:24 -1000 From: Tejun Heo To: John Garry Cc: axboe@kernel.dk, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, newella@fb.com, hch@lst.de Subject: Re: [PATCH 12/27] blk-iocost: grab ioc->lock for debt handling Message-ID: References: <20200901185257.645114-1-tj@kernel.org> <20200901185257.645114-13-tj@kernel.org> <45603be5-65ae-4d45-bfbe-22c3c1e22280@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45603be5-65ae-4d45-bfbe-22c3c1e22280@oracle.com> Hello, On Wed, Jun 12, 2024 at 12:33:19PM +0100, John Garry wrote: ... > This generates the following sparse warnings on mainline today: > > CHECK block/blk-iocost.c > block/blk-iocost.c:685:9: warning: context imbalance in 'iocg_lock' - > wrong count at exit > block/blk-iocost.c:696:28: warning: context imbalance in 'iocg_unlock' > - unexpected unlock > > If we try to break iocg_lock() into one version for lock_ioc set and another > for lock_ioc unset, we can solve the sparse issues for those functions, but > then we get another sparse issue from the callsites for those functions: > > block/blk-iocost.c:2679:17: warning: context imbalance in > 'ioc_rqos_throttle' - different lock contexts for basic block > > I tried to solve with a total ioc_rqos_throttle() re-org and much code > duplication by calling the different lock and unlock versions from > effectively 2x separate copies of ioc_rqos_throttle(), as sparse seems > confused with how we call these functions. It's a total no-go. > > Any simpler idea to solve these? Or just something to live with? I kinda gave up on sparse lock checking as there's not much it can do that lockdep can't and the annotations are too awkward and inconsistent throughout the code base. So, my tendency is just to ignore it. Thanks. -- tejun