From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA74FCDB465 for ; Thu, 19 Oct 2023 11:05:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.619190.963860 (Exim 4.92) (envelope-from ) id 1qtQqH-0003Tu-J6; Thu, 19 Oct 2023 11:05:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 619190.963860; Thu, 19 Oct 2023 11:05:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtQqH-0003Tn-Fa; Thu, 19 Oct 2023 11:05:29 +0000 Received: by outflank-mailman (input) for mailman id 619190; Thu, 19 Oct 2023 11:05:28 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtQqG-0003Oa-By for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 11:05:28 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 67f354ba-6e6f-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 13:05:26 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4083f61312eso12638535e9.3 for ; Thu, 19 Oct 2023 04:05:26 -0700 (PDT) Received: from [192.168.1.10] (host-92-26-107-252.as13285.net. [92.26.107.252]) by smtp.gmail.com with ESMTPSA id bs30-20020a056000071e00b0032d9a1f2ec3sm4307639wrb.27.2023.10.19.04.05.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 04:05:25 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 67f354ba-6e6f-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1697713525; x=1698318325; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :content-language:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=XmMJwa3l2soeLn6+XFCad/sSs5sDXHRJpXU8N66IEO0=; b=iMLVAQx4iuiNYb7Ir0t1o0VULJBINrdFNxaL8LbF3ELOffz2FsWEry05o3FPdOCwJc Os87WvTsSxcZVMojpgfjkIL3oWS9S2MQ3jKV0cm1qoMMSmmpexYfiGOmsjoTo067GYn2 jiUpu+LUomwCPkAbkRn01t++qdDb34lWii7oo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697713525; x=1698318325; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :content-language:subject:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XmMJwa3l2soeLn6+XFCad/sSs5sDXHRJpXU8N66IEO0=; b=UiD7Odoi2zcvC5CdoIsGb/P40BjlOwTsJ2tzEVs6P2k+BJiNRnQmEXuScg6D5G92aD kvJvVixmzXPSAih833ojKGwWUteZy0wRDucb7URZabDCO0nQDuJVamJd2dhRJ6fY50N7 auSkmQFB8uIgVVoqtyrBvQRsDn1IBo8A+H0W4WCnF3UJxe1RDlfjCtKufZ31XohSFydS +3tJkgEdS4Q9W6gzc74iirwn6tP58XhfI62T1jQ5rHK6IQbMzKHDLfqxFHASwtp+Xh5X 1ROYKzjbMqrCSy9pahx3Fb7Pwt8XBo743BbYu+osClBvtSo7LbJpBDMcXplk6mzKJaYb BLKQ== X-Gm-Message-State: AOJu0Ywt4CYZZWbe8qwWfJyV+ZWfphwfYpfxztYb/6qQT/FWqsdUs+hH DFcjRdfRsfkcos8KuTQyytAkGRaaGAWasSYGQhJHDA== X-Google-Smtp-Source: AGHT+IE0Q6mp18bxn9XUItuHyG4rdZsGlSmIjOok2gydJhs9avcMVJEZJDoRIQSNJ/NvuU+C4LmLOA== X-Received: by 2002:adf:cd83:0:b0:329:6be4:e199 with SMTP id q3-20020adfcd83000000b003296be4e199mr1324005wrj.13.1697713525430; Thu, 19 Oct 2023 04:05:25 -0700 (PDT) Message-ID: <72f65a40-1875-45a4-a265-f4111e02150e@citrix.com> Date: Thu, 19 Oct 2023 12:05:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Andrew Cooper Subject: Re: [PATCH v2 00/13] xen/spinlock: make recursive spinlocks a dedicated type Content-Language: en-GB To: Jan Beulich Cc: javi.merino@cloud.com, George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Paul Durrant , Bertrand Marquis , Volodymyr Babchuk , Tamas K Lengyel , Lukasz Hawrylko , "Daniel P. Smith" , =?UTF-8?Q?Mateusz_M=C3=B3wka?= , xen-devel@lists.xenproject.org, Juergen Gross References: <20231013094224.7060-1-jgross@suse.com> <5f0cecef-8600-40b7-8e59-77d8e33750a7@citrix.com> <2efe4ba4-e94c-a5fd-008c-df8e0dc661b5@suse.com> Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOK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EACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== In-Reply-To: <2efe4ba4-e94c-a5fd-008c-df8e0dc661b5@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 19/10/2023 10:39 am, Jan Beulich wrote: > On 19.10.2023 11:35, Andrew Cooper wrote: >> On 19/10/2023 8:48 am, Jan Beulich wrote: >>> On 13.10.2023 11:42, Juergen Gross wrote: >>>> Instead of being able to use normal spinlocks as recursive ones, too, >>>> make recursive spinlocks a special lock type. >>>> >>>> This will make the spinlock structure smaller in production builds and >>>> add type-safety. >>>> >>>> This allows to increase the maximum number of physical cpus from 8191 >>>> to 65535 without increasing the size of the lock structure in production >>>> builds (the size of recursive spinlocks in debug builds will grow to >>>> 12 bytes due to that change). >>>> >>>> Changes in V2: >>>> - addressed comments by Jan Beulich >>>> - lots of additional cleanups >>>> - reorganized complete series >>>> >>>> Juergen Gross (13): >>>> xen/spinlock: fix coding style issues >>>> xen/spinlock: reduce lock profile ifdefs >>>> xen/spinlock: make spinlock initializers more readable >>>> xen/spinlock: introduce new type for recursive spinlocks >>>> xen/spinlock: rename recursive lock functions >>>> xen/spinlock: add rspin_[un]lock_irq[save|restore]() >>>> xen/spinlock: make struct lock_profile rspinlock_t aware >>>> xen/spinlock: add explicit non-recursive locking functions >>>> xen/spinlock: add another function level >>>> xen/spinlock: add missing rspin_is_locked() and rspin_barrier() >>>> xen/spinlock: split recursive spinlocks from normal ones >>>> xen/spinlock: remove indirection through macros for spin_*() functions >>>> xen/spinlock: support higher number of cpus >>> Before looking at patches 4 and onwards, I'd like us to settle on the future >>> of recursive locking in Xen, considering in particular Andrew's objections >>> to their use in the code base. If the plan was to eliminate them, I'd see >>> little point in reworking the infrastructure. I'd like to suggest that one >>> of us tries to remember to put this up as an agenda item for the next >>> Community Call. But of course the discussion can also happen right here; I >>> merely expect there might not be much of a reaction. >> Actually, I consider this series an improvement.  The CPU limit is the >> most urgent problem to fix. >> >> XenServer has just jumped to NR_CPUS=2k in order to support 2024's range >> of hardware, and it's only going to be a couple of years more before >> we're stuck given the current spinlocks. >> >> I do genuinely think the code and logic would be better without >> recursive locks, but making that happen is going to be very invasive and >> complicated. >> >> But in the meantime with spinlocks properly separated from recursive >> locks, it becomes easier IMO to dissuade the introduction of new cases >> while we unpick the existing ones. >> >> And so what if we do end up deleting recursive locks in a few years >> time?  That's not an argument against doing this untangling now. > Of course if that was happening only in a few years time, the series > here is still worthwhile to have. My question was rather towards us > possibly eliminating recursive locks in the next release cycle. I find it unlikely that we'd manage to do it in the next release cycle, even if we did dedicate a significant portion of effort to it.  There are more urgent things too. But the same argument works with several years substituted for months.  ~Andrew