Received: by 10.223.164.202 with SMTP id h10csp195146wrb; Wed, 29 Nov 2017 20:05:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMZKBZ3Dt9q+OX6vevCWkw22EYNP1k7IVk3nHSMuElCG5X89FFts8+Hn9yRS0Oz5LgByUcqd X-Received: by 10.99.96.87 with SMTP id u84mr1104169pgb.407.1512014705924; Wed, 29 Nov 2017 20:05:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512014705; cv=none; d=google.com; s=arc-20160816; b=J12MKJEwiTMFk3UzfvTqb8jPqWi4ymsieYVUf7ysueCl56lgSci1AdBSKa3AurZ/eL 9eb5srZEzdLLZh3r2zlhC9h2a5iYLuTcXqvOpUv1SOMTyXwS5QGysCmW8YYjQCVSOjo6 Av6tdJAlrIEgOPOjdCldg5bJj1gQGuRcTVyfes73jyl9sn+7TnaWjmgrYYMtVSlDW2nB /Uy/FbQcE184PMMWXadk2P+GlZ8YNCZWAev37rWw2dXmaht54wlpPJhZqgT2lPxs8hY3 QRL6rRo9IUmZAFjKIt0CBobSFUpQ5XjuRB95+3E3AbJDqK3ptNQPSV+ZrJcqOC9RD9u8 WhNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3vx22wDgJBjvf7dvtqxdm2o8qmvleQN8ao3bKvkrN3g=; b=fx89mnh8h8mvqu9B6cKmd+NEAW6QxpAATQmmSqdDQ+W+aX+tR1ISK73Cm4DPq85avN 3bMKpfFYmxxpWAtVM5EA0j0ZwCLZoVb1WTDbNaiy4KyXqEAbnfeERbsdW42GopFige8l MZRAg6qe8f8DBYkOrgtdVOFwLdbfg9Nk10PFKl6yZd43dZ6/RK/8DGOOaIrmdWXVV84F 9DmQVLjFBfbbDD9qfuL0T4hkzG4CwTLEh+5jbEKKtlOx83rO0yrsUrfIX+bLD/rtULLM KgN7Q9RjGQCgaBla6Xeeef9vha6tKOeRNUOGX8VZLqOcLHu6GunGX/0sUY6RlPH97fiD 7clQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=XPuYPtUV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si2311155pgs.817.2017.11.29.20.04.53; Wed, 29 Nov 2017 20:05:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=XPuYPtUV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753609AbdK3EDt (ORCPT + 99 others); Wed, 29 Nov 2017 23:03:49 -0500 Received: from ozlabs.org ([103.22.144.67]:57629 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753639AbdK3EDD (ORCPT ); Wed, 29 Nov 2017 23:03:03 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3ynNzV1kkbz9t2c; Thu, 30 Nov 2017 15:03:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1512014582; bh=s/A32RnGIsyXLHV37n7rv1PuzAojXxr1pkb5kQ88PtA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XPuYPtUVq8HPeIGFFLcs+EVEDUJlA7tRuZnMgDP9VlladY/eRJgcfBJcS2fX/2vg7 JP2Ru6yLpIZiUWaihIrP6FhEf/1nekkObBFkSHQbnelZTDRH7VW6gaIS1d5+NyvuhS OurAlDXdKNs2KGOjETvtaznZcQJS/DTGlhvgyrX0= Date: Thu, 30 Nov 2017 14:53:31 +1100 From: David Gibson To: Serhii Popovych Cc: linux-kernel@vger.kernel.org, michael@ellerman.id.au, paulus@samba.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org Subject: Re: [PATCH 4/4] KVM: PPC: Book3S HV: Remove redundant parameter from resize_hpt_release() Message-ID: <20171130035331.GR3023@umbus.fritz.box> References: <1511973506-65683-1-git-send-email-spopovyc@redhat.com> <1511973506-65683-5-git-send-email-spopovyc@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LkYZvX65tyO4RZtj" Content-Disposition: inline In-Reply-To: <1511973506-65683-5-git-send-email-spopovyc@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LkYZvX65tyO4RZtj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 29, 2017 at 11:38:26AM -0500, Serhii Popovych wrote: > There is no need to pass it explicitly from the caller: > struct kvm_resize_hpt already contains it. >=20 > Additional benefit from this change is that BUG_ON() > assertion now checks that mutex is held on kvm instance > associated with resize structure we going to release. >=20 > Also kill check for resize being NULL to make code > simpler and we called with resize !=3D NULL in all > places except kvm_vm_ioctl_resize_hpt_commit(). >=20 > Signed-off-by: Serhii Popovych Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3= s_64_mmu_hv.c > index 690f061..a74a0ad 100644 > --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c > +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c > @@ -1415,12 +1415,11 @@ static void resize_hpt_pivot(struct kvm_resize_hp= t *resize) > resize_hpt_debug(resize, "resize_hpt_pivot() done\n"); > } > =20 > -static void resize_hpt_release(struct kvm *kvm, struct kvm_resize_hpt *r= esize) > +static void resize_hpt_release(struct kvm_resize_hpt *resize) > { > - BUG_ON(!mutex_is_locked(&kvm->lock)); > + struct kvm *kvm =3D resize->kvm; > =20 > - if (!resize) > - return; > + BUG_ON(!mutex_is_locked(&kvm->lock)); > =20 > if (resize->error !=3D -EBUSY) { > kvmppc_free_hpt(&resize->hpt); > @@ -1469,7 +1468,7 @@ static void resize_hpt_prepare_work(struct work_str= uct *work) > resize->error =3D err; > =20 > if (kvm->arch.resize_hpt !=3D resize) > - resize_hpt_release(kvm, resize); > + resize_hpt_release(resize); > =20 > mutex_unlock(&kvm->lock); > } > @@ -1499,13 +1498,13 @@ long kvm_vm_ioctl_resize_hpt_prepare(struct kvm *= kvm, > if (ret =3D=3D -EBUSY) > ret =3D 100; /* estimated time in ms */ > else if (ret) > - resize_hpt_release(kvm, resize); > + resize_hpt_release(resize); > =20 > goto out; > } > =20 > /* not suitable, cancel it */ > - resize_hpt_release(kvm, resize); > + resize_hpt_release(resize); > } > =20 > ret =3D 0; > @@ -1590,7 +1589,8 @@ long kvm_vm_ioctl_resize_hpt_commit(struct kvm *kvm, > kvm->arch.mmu_ready =3D 1; > smp_mb(); > out_no_hpt: > - resize_hpt_release(kvm, resize); > + if (resize) > + resize_hpt_release(resize); > mutex_unlock(&kvm->lock); > return ret; > } --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --LkYZvX65tyO4RZtj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlofgLsACgkQbDjKyiDZ s5JXMg//bzzqrVwhIs182eCxXRY2ydIB3H7KAvTzWM1lBK8L8wZ+1kfTTIaUg8Mn r4DcKi1dwIgl9gLPvzqOTmx+feLIhQ/xqKWPud3OV/0IZ7dwNM61yMVzsFKzV8J8 yXbWauquctw0LHMuAp/mUseSylCLpxxofPDg5pDmMwklFeABxsXcYwXbszHGXgpN VEsK7zOK5UWvK0jdEqo3HyfuANhPbeaTbydHIUm3VOp5uM0aPPdB7D1jE5P4iPrr h2Uga9nE/Vj04O+Xka5hZj+d5InGIUVTUqGx7KTRfkOlm3/Q21VuWecEbnknfLKa 0xY/VHF17PT1G4+nrIV2io2TDxp4SmkhJMoyHCnUNkRP/GL67FCEtJfPOZLF+aeh 4h+XQ6CQai3TDbd9SLxTvaIQpghxzUO/fJhW0VR3Z2vJQ0V61cW0Bd7ZBher1I5k r7XnZv1OIa7A+z3BkQtIrkuUzaDo6A/PHQRbmdGuWsz3NWJX55DPO+D+A6725NJ4 vPtup5AarS9AdR4ei3revYMRxrYcJdSyi0Z+3DgOB/LRUlzXMzQljbs5wp1RYhTX 4K8pMPGMSufuyztQAeCgLX+EKACmIqDM/Cd4If4xjjpYFUFbMotVF9I/H1FHham2 n1/3duptRrvGJXqp50ZdPORWyhMX4t71NUCWnWlfENnD0sqzdz0= =1hbw -----END PGP SIGNATURE----- --LkYZvX65tyO4RZtj-- From 1585425700141575484@xxx Wed Nov 29 18:22:50 +0000 2017 X-GM-THRID: 1585425700141575484 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread