From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: Re: [RFC][PATCH] reduce KVM stack usage Date: Thu, 17 Jul 2008 16:02:10 -0700 Message-ID: References: <1216308735.9161.3.camel@nimitz> <1216315391.9311.3.camel@nimitz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel , Anthony Liguori To: Dave Hansen Return-path: Received: from sj-iport-3.cisco.com ([171.71.176.72]:37070 "EHLO sj-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbYGQXCM (ORCPT ); Thu, 17 Jul 2008 19:02:12 -0400 In-Reply-To: <1216315391.9311.3.camel@nimitz> (Dave Hansen's message of "Thu, 17 Jul 2008 10:23:11 -0700") Sender: kvm-owner@vger.kernel.org List-ID: > > > + kmalloc(GFP_KERNEL, sizeof(struct kvm_pv_mmu_op_buffer)); > > Surely this produces a warning? kmalloc takes (size, flags) -- you have > > them reversed here. > Heh. It actually doesn't. Yeah, I guess you need sparse to catch the gfp_t mismatch. > > kfree(NULL) is fine, so you can remove the if()s here. > I know it is fine, but I kinda like putting the if()s, just to let > people know that we don't always *expect* something to be in there. > But, it doesn't matter to me too much either way. It's not really a big deal, but "if (x) kfree(x);" does bloat the object code with the extra test of 'x'. I guess you could put a comment like /* free any temp structures we allocated */ or something like that. - R.