Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1421253rwo; Wed, 2 Aug 2023 13:55:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlFAy6N60R/rs1+D9d3zI2vulAt3j52dfEiJFXvIIzvjAK2K7gzXKFEe93gnxqlnSVHO0QNf X-Received: by 2002:aa7:d95a:0:b0:51d:9db8:8257 with SMTP id l26-20020aa7d95a000000b0051d9db88257mr6699926eds.30.1691009756587; Wed, 02 Aug 2023 13:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691009756; cv=none; d=google.com; s=arc-20160816; b=eMdUcKkYt024ek/H1AfJYpxdIG+TXMlwAK/q8TJ63ETVAsz6dybN0NCHlWwu8z7oqm oe8y4PXdCfHrT5Xv7b3kJx9zPh0jK+J+xuj9BQOb2UnM1VNV7Vg1AVKVmeJqerfEYAqv ijGKjKen9zWI05nYjQeDTy+mY9YLPk+VyNTblYY7d4LhHJUK+/HBCqdWbKtDoBh4Yy5O eygfXU2XzI89ZPefF2tydQMY9ZTOaNTPGKTndFiGz4cYntPlu3BLqIp+44VdjLYkh6KL I0G3c717TsnyJYgemM8Cp20Tku8J81ok//92wrYcxJ+h1Kw6gPtmCalNw6fEnOlegQXM Amzg== 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:dkim-signature; bh=acrSt/0dfnAuOYA3kr0V0TFcrwCk8zPYsNK8t3sQlW8=; fh=d2OcaJdR9gQQN7jphxOYoglRWd+i9FgLbhwadg4y1oA=; b=kzePNkLUgkEIk+fAhH20G3dmvfYNTtiXUGg2jUnKFsz4Xete9xzNTkz+3QIyT2M/5c kZx1x6sjMDNVSs2cDufxH4KIon88r8yPQAVFAeXLtgCwlIJeHosdoOVhff9NglWQTvP8 YlwGrSyGG7OPfxG9jLUlL6GtQqGi28HpNzE3fH1RiG/ReM04xvWtPb2a+68yMo0rWXaz C72dpGdBI1OvzGKpmUtV1a5zJYVXJQ8rlNghT7+9mPRbFSyiXOipkI0Ay6kmNHQVMVW6 IzlNi8iTlHC1p2lFw36vsz+6OOgbqM5Y7wy7ZXS2Lp7clNRVaMTi7GsBRSu5KkVPs72o 3ZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=M9iRT6l1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r10-20020aa7d14a000000b00521e533adaasi10468163edo.408.2023.08.02.13.55.31; Wed, 02 Aug 2023 13:55:56 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b=M9iRT6l1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232764AbjHBT3F (ORCPT + 99 others); Wed, 2 Aug 2023 15:29:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232505AbjHBT3A (ORCPT ); Wed, 2 Aug 2023 15:29:00 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1CA198B; Wed, 2 Aug 2023 12:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=acrSt/0dfnAuOYA3kr0V0TFcrwCk8zPYsNK8t3sQlW8=; b=M9iRT6l1WDQ2oHfc8NOUYhjj0k EHrmUwz67ebhDUJoYo6yWFtN+TEM7WXojgWr3pPgqhQK7XbG3T7zaFZxsNFm+7a1UughFihwrrZZk Tk5WQJiJFRyU/UqXalr+qV/O1PchsHiro4jcRJewG/QAjawsTNB5WHxzjuMRQ+FhuxWERR55AAZmF qm7eBIuuyiEfKChuHfPE/u4ePgt1fvy6Mwr0R0EGBhg3hl9rct+u8QBWwm0ElUfTijPbFwxrkSCIk Aeh6HojJFfITTAmATtIa4k8mW0hiGVVpstwTU4I262f88uny6Zluv9NMxVOGIjuxeS21Dj171YKZ2 yXupdwKA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qRHWS-00GkwV-BR; Wed, 02 Aug 2023 19:28:40 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F2294300301; Wed, 2 Aug 2023 21:28:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D9226210FEE66; Wed, 2 Aug 2023 21:28:39 +0200 (CEST) Date: Wed, 2 Aug 2023 21:28:39 +0200 From: Peter Zijlstra To: "Michael Kelley (LINUX)" Cc: "levymitchell0@gmail.com" , KY Srinivasan , Haiyang Zhang , Wei Liu , Dexuan Cui , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mikelly@microsoft.com" , Boqun Feng Subject: Re: [PATCH] hv_balloon: Update the balloon driver to use the SBRM API Message-ID: <20230802192839.GB231007@hirez.programming.kicks-ass.net> References: <20230726-master-v1-1-b2ce6a4538db@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Wed, Aug 02, 2023 at 05:47:55PM +0000, Michael Kelley (LINUX) wrote: > From: Mitchell Levy via B4 Relay Sent: Tuesday, July 25, 2023 5:24 PM > > > > This patch is intended as a proof-of-concept for the new SBRM > > machinery[1]. For some brief background, the idea behind SBRM is using > > the __cleanup__ attribute to automatically unlock locks (or otherwise > > release resources) when they go out of scope, similar to C++ style RAII. > > This promises some benefits such as making code simpler (particularly > > where you have lots of goto fail; type constructs) as well as reducing > > the surface area for certain kinds of bugs. > > > > The changes in this patch should not result in any difference in how the > > code actually runs (i.e., it's purely an exercise in this new syntax > > sugar). In one instance SBRM was not appropriate, so I left that part > > alone, but all other locking/unlocking is handled automatically in this > > patch. > > > > Link: https://lore.kernel.org/all/20230626125726.GU4253@hirez.programming.kicks-ass.net/ [1] > > I haven't previously seen the "[1]" footnote-style identifier used with the > Link: tag. Usually the "[1]" goes at the beginning of the line with the > additional information, but that conflicts with the Link: tag. Maybe I'm > wrong, but you might either omit the footnote-style identifier, or the Link: > tag, instead of trying to use them together. > > Separately, have you built a kernel for ARM64 with these changes in > place? The Hyper-V balloon driver is used on both x86 and ARM64 > architectures. There's nothing obviously architecture specific here, > but given that SBRM is new, it might be wise to verify that all is good > when building and running on ARM64. The only issue that has popped up so far is that __cleanup__ and asm-goto don't interact nicely. GCC will silently mis-compile but clang will issue a compile error/warning. Specifically, GCC seems to have implemented asm-goto like the 'labels as values' extention and loose the source context of the edge or something. With result that the actual goto does not pass through the __cleanup__. Other than that, it seems to work as expected across the platforms. A brief look through the patch didn't show me anything odd, should be ok. Although my primary purpose was to get rid of 'unlock' labels and error handling, simple usage like this is perfectly fine too.