[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 1/3] xen/spinlock: add explicit non-recursive locking functions


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 14 Dec 2022 11:21:19 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eTUGgviKbTddHLQh/4IWDvQPPFqEPSjZ9Pgapw5bwX8=; b=L2iQrBQ1c6dTrrw+qN/SjbBhCLHF+cLvlSuPciluBnpH2wjIuY3CdDaAhSJEGq4qWA3Pkrs3Oh3loBNHAZsILaZZ2kLmipLZ3HBoLPTlpg65n/tG/P2oiMMCgUrdCPtXYdhE274469UdK+lqnfmlk64a/8yfKKuWKHfgqb5EYE8aPj2hJvkgLmq7ySSBRemKoKrFIfzJKIuR+dww5X/YHcVNHWtLPCYYQDMQUViGGbeGzac89oy7UYiMFrquC2io2ybN0y1tm9huKv2ImVYr6iPf2g2NTr6GdWywRuR9xXee6AEK1q2Sfc2OdLRGC3mrHpKuvppspro4++/H0x87oA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XLh/wcqNnYJMX7ZEFbgkH555dYT12GRlpNQi4SiNW5f+yvPFcBEvgwM+vI7ZUDhfLCtSKcvgKmnAStuRwU2yMf5l17Sgdva9XdrXoRwaPXEN8KLC12jof96O+m12Kin/b9d9XjfyCxHZuSNEsQCIPo8u9wYdcgztQqKrvBkYvGYzPx6Jo5jV0u/15wasbvaquXv+G9e00fak3Ng3PigzBdKW3HdYgcgTCJrVeaBA6bD7VmQ6d4chjholQMNYJCZdYtpjhXJg34mEmpNHF5AWYUBHKjzxHRfnZXYUKar/K7HmSHt7SRWc5HaqVjfR766gfx3L13MQZj5YzBs78D9rQA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Lukasz Hawrylko <lukasz@xxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Mateusz Mówka <mateusz.mowka@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 14 Dec 2022 10:21:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.09.2022 17:49, Juergen Gross wrote:
> In order to prepare a type-safe recursive spinlock structure, add
> explicitly non-recursive locking functions to be used for non-recursive
> locking of spinlocks, which are use recursively, too.

While I can see that something needs doing, a function name like
spin_unlock_nonrecursive_irqrestore() is really unwieldy, imo.

Just one minor further remark:

> @@ -64,7 +64,7 @@ void pcidevs_unlock(void)
>  
>  bool_t pcidevs_locked(void)
>  {
> -    return !!spin_is_locked(&_pcidevs_lock);
> +    return !!spin_recursive_is_locked(&_pcidevs_lock);
>  }

While touching this line, could you please also get rid of the !! ?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.