public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
To: Joe Perches <joe@perches.com>
Cc: Jiri Kosina <trivial@kernel.org>, Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 49/49] virt/kvm/kvm_main.c: Use vzalloc
Date: Fri, 05 Nov 2010 13:25:07 +0900	[thread overview]
Message-ID: <4CD38723.5000303@oss.ntt.co.jp> (raw)
In-Reply-To: <e57b4ed114851004b2839cb449937fc657634362.1288925425.git.joe@perches.com>

(2010/11/05 12:08), Joe Perches wrote:
> Signed-off-by: Joe Perches<joe@perches.com>
> ---
>   virt/kvm/kvm_main.c |   13 +++----------
>   1 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

Already changed to vzalloc(), see kvm.git.

Takuya


> index 5225052..c2a08e6e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -604,13 +604,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
>   	/* Allocate if a slot is being created */
>   #ifndef CONFIG_S390
>   	if (npages&&  !new.rmap) {
> -		new.rmap = vmalloc(npages * sizeof(*new.rmap));
> -
> +		new.rmap = vzalloc(npages * sizeof(*new.rmap));
>   		if (!new.rmap)
>   			goto out_free;
> 
> -		memset(new.rmap, 0, npages * sizeof(*new.rmap));
> -
>   		new.user_alloc = user_alloc;
>   		new.userspace_addr = mem->userspace_addr;
>   	}
> @@ -633,14 +630,11 @@ int __kvm_set_memory_region(struct kvm *kvm,
>   			>>  KVM_HPAGE_GFN_SHIFT(level));
>   		lpages -= base_gfn>>  KVM_HPAGE_GFN_SHIFT(level);
> 
> -		new.lpage_info[i] = vmalloc(lpages * sizeof(*new.lpage_info[i]));
> +		new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i]));
> 
>   		if (!new.lpage_info[i])
>   			goto out_free;
> 
> -		memset(new.lpage_info[i], 0,
> -		       lpages * sizeof(*new.lpage_info[i]));
> -
>   		if (base_gfn&  (KVM_PAGES_PER_HPAGE(level) - 1))
>   			new.lpage_info[i][0].write_count = 1;
>   		if ((base_gfn+npages)&  (KVM_PAGES_PER_HPAGE(level) - 1))
> @@ -663,10 +657,9 @@ skip_lpage:
>   	if ((new.flags&  KVM_MEM_LOG_DIRTY_PAGES)&&  !new.dirty_bitmap) {
>   		unsigned long dirty_bytes = kvm_dirty_bitmap_bytes(&new);
> 
> -		new.dirty_bitmap = vmalloc(dirty_bytes);
> +		new.dirty_bitmap = vzalloc(dirty_bytes);
>   		if (!new.dirty_bitmap)
>   			goto out_free;
> -		memset(new.dirty_bitmap, 0, dirty_bytes);
>   		/* destroy any largepage mappings for dirty tracking */
>   		if (old.npages)
>   			flush_shadow = 1;


  reply	other threads:[~2010-11-05  4:23 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 21:35 [PATCH] cgroup: Avoid a memset by using vzalloc Jesper Juhl
2010-10-30 23:34 ` Minchan Kim
2010-10-31 17:33   ` Balbir Singh
2010-11-01  5:40     ` Jesper Juhl
2010-11-03 14:38       ` Christoph Lameter
2010-11-03 15:20         ` jovi zhang
2010-11-03 15:31           ` Christoph Lameter
2010-11-03 15:48           ` Joe Perches
2010-11-03 16:10             ` Christoph Lameter
2010-11-04 21:43               ` Jesper Juhl
     [not found]               ` <cover.1288925424.git.joe@perches.com>
2010-11-05  3:07                 ` [PATCH 01/49] arch/ia64: Use vzalloc Joe Perches
2010-11-05  3:07                 ` [PATCH 02/49] arch/mips: " Joe Perches
2010-11-05 10:51                   ` Ralf Baechle
2010-11-05  3:07                 ` [PATCH 03/49] arch/powerpc: " Joe Perches
2010-11-05 13:08                   ` [Cbe-oss-dev] " Jeremy Kerr
2010-11-05  3:07                 ` [PATCH 04/49] arch/s390: " Joe Perches
2010-11-05  3:07                 ` [PATCH 05/49] arch/x86: " Joe Perches
2010-11-05  4:22                   ` Takuya Yoshikawa
2010-11-05  3:07                 ` [PATCH 06/49] crypto: " Joe Perches
2010-11-27  8:31                   ` Herbert Xu
2010-11-05  3:07                 ` [PATCH 07/49] drivers/atm: " Joe Perches
2010-11-05  3:07                 ` [PATCH 08/49] drivers/block: " Joe Perches
2010-11-05  3:07                 ` [PATCH 09/49] drivers/char: " Joe Perches
2010-11-05  3:07                 ` [PATCH 10/49] drivers/gpu: " Joe Perches
2010-11-05  9:29                   ` Thomas Hellstrom
2010-11-05  3:07                 ` [PATCH 11/49] drivers/hid: " Joe Perches
2010-11-05  3:07                 ` [PATCH 12/49] drivers/infiniband: " Joe Perches
2011-01-12 19:12                   ` Roland Dreier
2010-11-05  3:07                 ` [PATCH 13/49] drivers/isdn: " Joe Perches
2010-11-05  3:07                 ` [PATCH 14/49] drivers/md: " Joe Perches
2010-11-05  3:07                 ` [PATCH 15/49] drivers/media: " Joe Perches
2010-11-05  3:07                 ` [PATCH 16/49] drivers/mtd: " Joe Perches
2010-11-13 11:19                   ` Artem Bityutskiy
2010-11-05  3:07                 ` [PATCH 17/49] drivers/net/cxgb3: " Joe Perches
2010-11-05  3:07                 ` [PATCH 18/49] drivers/net/cxgb4: " Joe Perches
2010-11-05  3:07                 ` [PATCH 19/49] drivers/net/e1000: " Joe Perches
2010-11-05  3:07                 ` [PATCH 20/49] drivers/net/e1000e: " Joe Perches
2010-11-05  3:07                 ` [PATCH 21/49] drivers/net/ehea: " Joe Perches
2010-11-05  3:07                 ` [PATCH 22/49] drivers/net/igb: " Joe Perches
2010-11-05  3:07                 ` [PATCH 23/49] drivers/net/igbvf: " Joe Perches
2010-11-05 11:58                   ` Rose, Gregory V
2010-11-05  3:07                 ` [PATCH 24/49] drivers/net/ixgb: " Joe Perches
2010-11-05  3:07                 ` [PATCH 25/49] drivers/net/ixgbe: " Joe Perches
2010-11-05  3:07                 ` [PATCH 26/49] drivers/net/ixgbevf: " Joe Perches
2010-11-05 11:59                   ` Rose, Gregory V
2010-11-05  3:07                 ` [PATCH 27/49] drivers/net/netxen: " Joe Perches
2010-11-05  5:18                   ` Amit Salecha
2010-11-05  3:07                 ` [PATCH 28/49] drivers/net/pch_gbe: " Joe Perches
2010-11-05  3:07                 ` [PATCH 29/49] drivers/net/qlcnic: " Joe Perches
2010-11-05  3:07                 ` [PATCH 30/49] drivers/net/sfc: " Joe Perches
2010-11-05  3:07                 ` [PATCH 31/49] drivers/net/vxge: " Joe Perches
2010-11-05  3:07                 ` [PATCH 32/49] drivers/net/bnx2.c: " Joe Perches
2010-11-05  3:07                 ` [PATCH 33/49] drivers/s390: " Joe Perches
2010-11-05  3:07                 ` [PATCH 34/49] drivers/scsi: " Joe Perches
2010-11-05  3:07                 ` [PATCH 35/49] drivers/staging: " Joe Perches
2010-11-05  3:08                 ` [PATCH 36/49] drivers/video: " Joe Perches
2010-11-05  5:27                   ` Dave Young
2010-11-05  5:31                     ` Joe Perches
2010-11-08 16:43                   ` Konrad Rzeszutek Wilk
2010-11-05  3:08                 ` [PATCH 37/49] fs/ext4: " Joe Perches
     [not found]                   ` <F35C793E-7CBA-4631-8928-C34D5B39F148@dilger.ca>
2010-11-05  7:18                     ` [PATCH V2 " Joe Perches
2010-12-20  3:22                       ` Ted Ts'o
2010-11-05  3:08                 ` [PATCH 38/49] fs/jffs2: " Joe Perches
2010-11-13 11:19                   ` Artem Bityutskiy
2010-11-05  3:08                 ` [PATCH 39/49] fs/reiserfs: " Joe Perches
2010-11-05  3:08                 ` [PATCH 40/49] fs/udf: " Joe Perches
2010-11-05  9:11                   ` Jan Kara
2010-11-05  9:15                     ` Peter Bortas
2010-11-05  9:30                       ` Jan Kara
2010-11-05  3:08                 ` [PATCH 41/49] fs/xfs: " Joe Perches
2010-11-05 17:09                   ` Alex Elder
2010-11-05  3:08                 ` [PATCH 42/49] include/linux/coda_linux.h: " Joe Perches
2010-11-05  3:08                 ` [PATCH 43/49] kernel: " Joe Perches
2010-11-05  3:08                 ` [PATCH 44/49] mm: " Joe Perches
2010-11-05  3:08                 ` [PATCH 45/49] net/core/pktgen.c: " Joe Perches
2010-11-05  3:08                 ` [PATCH 46/49] net/netfilter: " Joe Perches
2010-11-05  6:30                   ` Eric Dumazet
2010-11-05  6:55                     ` Joe Perches
2010-11-05  7:16                       ` Eric Dumazet
2010-11-05 17:01                         ` Jesper Juhl
2010-11-05 15:10                       ` Jiri Kosina
2010-11-05 15:25                         ` Joe Perches
2010-11-05  3:08                 ` [PATCH 47/49] net/rds: " Joe Perches
2010-11-05  3:08                 ` [PATCH 48/49] sound/oss/dev_table.c: " Joe Perches
2010-11-22  6:59                   ` Takashi Iwai
2010-11-05  3:08                 ` [PATCH 49/49] virt/kvm/kvm_main.c: " Joe Perches
2010-11-05  4:25                   ` Takuya Yoshikawa [this message]
2010-11-05  4:44                     ` Joe Perches
2010-11-05  5:31                 ` [PATCH V2 36/49] drivers/video: " Joe Perches
2010-11-03 16:37           ` [PATCH] cgroup: Avoid a memset by using vzalloc Américo Wang
2010-11-01 22:00 ` Paul Menage

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CD38723.5000303@oss.ntt.co.jp \
    --to=yoshikawa.takuya@oss.ntt.co.jp \
    --cc=avi@redhat.com \
    --cc=joe@perches.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox