From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756675AbcHVVRs (ORCPT ); Mon, 22 Aug 2016 17:17:48 -0400 Received: from mout.web.de ([212.227.17.11]:56017 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753239AbcHVVRq (ORCPT ); Mon, 22 Aug 2016 17:17:46 -0400 Subject: Re: [PATCH 3/4] KVM-S390: Less function calls in kvm_s390_import_bp_data() after error detection To: Cornelia Huck References: <82b84c9c-38a4-4d17-910f-312668dbae01@users.sourceforge.net> <47f88a11-b949-28ed-5589-925888a37574@users.sourceforge.net> <20160822150048.309a3e10.cornelia.huck@de.ibm.com> <20160822213736.62f1ae29.cornelia.huck@de.ibm.com> Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, =?UTF-8?Q?Christian_Borntr=c3=a4ger?= , David Hildenbrand , Heiko Carstens , Martin Schwidefsky , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5da7978a-922b-8ccc-fce4-2bffffca888f@users.sourceforge.net> Date: Mon, 22 Aug 2016 23:17:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <20160822213736.62f1ae29.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:CiV0bpFJGGXfO6C5L1gBlVt85Yr0kgvE6braE8vdpK0oJKyr51x WFa4t1VPgNyLK04K6en9AzFDb2GGq7E8/vZdXzSzxByVALOj9TgXKLheEon2mMgVmHHbstS jzBC21iSCXfiR1/taIL6kIv/zWPt6nqX7b58c9VJEc5y2sNcZ64aAROoRv0ral7WrJfKB6e tSLyjVRJPKKiW/63nFJ9w== X-UI-Out-Filterresults: notjunk:1;V01:K0:CFp6OJHtimA=:V3dAdca5899e4uETDyEi5+ VZbqQ3k0uyVQ4VDxSgbSGPay/FliTjlhZpQAwxnAzXPKEKWO+VJ7LcBjOigUQQH0GNGDSEi36 Ub/1R0M8GXt5Az2FTu2vv6YQN7BxtfL5MAPw1Y11c6CTW9FWjhd8WtUiwvLwTjJp8o52WXVwc QfMoG0XN1RuU2YYUr+JV+lEibV5XjdQnvgtn7m41wKFdDES4TD71C8bp1BMN39EVcXzwl1d8x Tpy2QijlCKHGpytJGhidM8F6uETbiA1Zw94gf3j0St8fuHq5I7bJTMmW//m0OxeuKylN8+WqY VXlMclL2/5zMMKR3TkVmQ/gmYFoHYfiQHDtz7TW0WDiIJyIdTVnPBYxkyhwUyJECjUtUJGVFF CdkFOHYnJl7KVPqmUxShjdRRPeXa6qxi8200Q61j04+7CozngOcvlX/44lcC91PhTTwZG1/0v 3/ZeqKZEbvfIzXVAgEx8DksEzksmA73TI1Esx2Nm8pld9dpEYISJhUr0VVqFStc6wvNqe3rZJ eBDCEoGGfQZSCA11UX+EySEsBu35tzv3fz32HeDNqJ8+qrWdr3UbX3GVTOx4ghUNLf88cFgGv I4Csl8rc9o8qTNzmY3oqdIyw1gAiPtMfEsIHtmJRGGMOmEmtsJ4VbEdDKCNIOZOqaE/6Kh7E6 HO1mNF8ifxwlMrdbADsIihL7WiNkp0wqGkMQ68Ymdv3JTskcb0S+hxPN9vwtQHJOibTOJFzNJ bbdqZCT4X3xiHHuZt8UWyaNXXK9NQC8DBMIMdTw7tVQ6Mpg4X081RQ7U+OGVQl2ypYfin3MDh +LEWOn+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>> @@ -273,10 +273,12 @@ int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu, >>>> vcpu->arch.guestdbg.nr_hw_wp = nr_wp; >>>> vcpu->arch.guestdbg.hw_wp_info = wp_info; >>>> return 0; >>>> -error: >>>> - kfree(bp_data); >>>> - kfree(wp_info); >>>> +free_bp_info: >>>> kfree(bp_info); >>>> +free_wp_info: >>>> + kfree(wp_info); >>>> +free_bp_data: >>>> + kfree(bp_data); >>>> return ret; >>>> } >>>> >>> >>> This replaces a perfectly fine fallthrough >> >> The usage of a single goto label like "error" seems to be convenient. >> But how do these habits fit to the current Linux coding style convention? >> >> >>> with some horrible labels. >> >> Do they explain better which processing steps should be performed >> for an efficient exception handling in this function implementation? > > *sigh* > > It's _exception handling_. It does not need to be "efficient", I imagine that run time situations could evolve where software efficiency will also matter for this purpose. > it needs to be easily parsable by humans. I guess that we have got different preferences for this detail. > If in doubt, the compiler will be _much_ better at optimizing > that kind of stuff anyway. Which compiler (or optimizer) implementation is capable to restructure the jump targets for you automatically in the way I propose here? Regards, Markus From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Mon, 22 Aug 2016 21:17:26 +0000 Subject: Re: [PATCH 3/4] KVM-S390: Less function calls in kvm_s390_import_bp_data() after error detection Message-Id: <5da7978a-922b-8ccc-fce4-2bffffca888f@users.sourceforge.net> List-Id: References: <82b84c9c-38a4-4d17-910f-312668dbae01@users.sourceforge.net> <47f88a11-b949-28ed-5589-925888a37574@users.sourceforge.net> <20160822150048.309a3e10.cornelia.huck@de.ibm.com> <20160822213736.62f1ae29.cornelia.huck@de.ibm.com> In-Reply-To: <20160822213736.62f1ae29.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Cornelia Huck Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, =?UTF-8?Q?Christian_Borntr=c3=a4ger?= , David Hildenbrand , Heiko Carstens , Martin Schwidefsky , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kernel-janitors@vger.kernel.org, Julia Lawall >>>> @@ -273,10 +273,12 @@ int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu, >>>> vcpu->arch.guestdbg.nr_hw_wp = nr_wp; >>>> vcpu->arch.guestdbg.hw_wp_info = wp_info; >>>> return 0; >>>> -error: >>>> - kfree(bp_data); >>>> - kfree(wp_info); >>>> +free_bp_info: >>>> kfree(bp_info); >>>> +free_wp_info: >>>> + kfree(wp_info); >>>> +free_bp_data: >>>> + kfree(bp_data); >>>> return ret; >>>> } >>>> >>> >>> This replaces a perfectly fine fallthrough >> >> The usage of a single goto label like "error" seems to be convenient. >> But how do these habits fit to the current Linux coding style convention? >> >> >>> with some horrible labels. >> >> Do they explain better which processing steps should be performed >> for an efficient exception handling in this function implementation? > > *sigh* > > It's _exception handling_. It does not need to be "efficient", I imagine that run time situations could evolve where software efficiency will also matter for this purpose. > it needs to be easily parsable by humans. I guess that we have got different preferences for this detail. > If in doubt, the compiler will be _much_ better at optimizing > that kind of stuff anyway. Which compiler (or optimizer) implementation is capable to restructure the jump targets for you automatically in the way I propose here? Regards, Markus