From patchwork Tue Apr 9 17:00:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10891807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BA9417E6 for ; Tue, 9 Apr 2019 17:03:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0472228928 for ; Tue, 9 Apr 2019 17:03:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECF692892D; Tue, 9 Apr 2019 17:03:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 419722892B for ; Tue, 9 Apr 2019 17:03:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8B18E9FE; Tue, 9 Apr 2019 19:02:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B18E9FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1554829426; bh=rE3Fr68OWyAHVwdBMw7CiTFvSn+VN4XJE13altHUvBQ=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uNUf5rkKvmhIQ13PEiHgFvyAsRM/yfJJlYvqsJFHpqDON70ux1mCRE6Q3dmggIFDx liCH7s+oGuv3EkpE6l/rNVX3Ik/3+Kue7E5u9tyNEuPLCpZZ9pcql7HiIvhXHDhf6k /NiTOh02R0T8Lmw7shvrplFqPycFQ6himoQUjqUs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4E3A0F89722; Tue, 9 Apr 2019 19:00:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 03C15F89610; Tue, 9 Apr 2019 19:00:36 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 61B87F89636 for ; Tue, 9 Apr 2019 19:00:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61B87F89636 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6CC0AAF81 for ; Tue, 9 Apr 2019 17:00:23 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 9 Apr 2019 19:00:16 +0200 Message-Id: <20190409170020.20685-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190409170020.20685-1-tiwai@suse.de> References: <20190409170020.20685-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 1/5] ALSA: seq: Use kvmalloc() for cell pools X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use kvmalloc() for allocating cell pools since the pool size can be relatively small that may be covered better by slab. Signed-off-by: Takashi Iwai --- sound/core/seq/seq_memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 5b0388202bac..6ea4d8a5a71e 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -389,8 +389,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) if (snd_BUG_ON(!pool)) return -EINVAL; - cellptr = vmalloc(array_size(sizeof(struct snd_seq_event_cell), - pool->size)); + cellptr = kvmalloc_array(sizeof(struct snd_seq_event_cell), pool->size, + GFP_KERNEL); if (!cellptr) return -ENOMEM; @@ -398,7 +398,7 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) spin_lock_irqsave(&pool->lock, flags); if (pool->ptr) { spin_unlock_irqrestore(&pool->lock, flags); - vfree(cellptr); + kvfree(cellptr); return 0; } @@ -456,7 +456,7 @@ int snd_seq_pool_done(struct snd_seq_pool *pool) pool->total_elements = 0; spin_unlock_irqrestore(&pool->lock, flags); - vfree(ptr); + kvfree(ptr); spin_lock_irqsave(&pool->lock, flags); pool->closing = 0;