Received: by 2002:aa6:c46f:0:b029:96:faae:e639 with SMTP id i15csp328706lkq; Thu, 5 Nov 2020 03:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA3vYk3Q7ppSLZvuJnp9OSDyvyraZlaOLrZSueZvjiyC/Pew0BFr2z/m12n/OgRu4QO5lx X-Received: by 2002:a17:906:824a:: with SMTP id f10mr1943098ejx.167.1604576341433; Thu, 05 Nov 2020 03:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604576341; cv=none; d=google.com; s=arc-20160816; b=dA79FwrxFjJmr8jjnGYmx6OGh8W/BmIAzmpUExJBiCMVNdmbIJomKNI7ObpllNAdPr uj2BLZA+l1393YQrGMX1+56FrfiU6KfkL8TVxZRkt1K4Z5wOmaa67Xigy4O0BGa6Qaqx Wq+LJVt22uMLwWn5UvYs1bsvlZHxuNuiIwmm1X22biZQXdhc2/zeJw4sroz4oAG2R1zL F+qD6d4g0Gyy7xLU/jJPeMRtE3I/m24qwmgl3XzLSNmSAqFWyCksBSJKOiAYVYyxy3pq DY8cqsEz7JQ6Swuc7ua0pobzNB1mUFHD3rEV0POdNJ3chMWXeNLJYVqEP9wa0BgA2JoZ k4LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BqAyd5oPIZ6twy3M+P8m2ePirTM3ef9UMxPbSLSvBUQ=; b=g0TohJ5YduEeXd0F5WVsQ9Luae3xoG91YZP30f+QTiDerCXLtRp6kg/ST7fLqeLsZY x5zmQILsSSq97oIIYGo82bTQRz6vNSYtWqROq5I+PWKQyQXRFbwuU71JXckZ3XdhjIdu 23I6Gp9zeKZaZ4oa1Q3hu620eQeCvKRySjNB5yKbcc/fAEC3IveQS2SlJGEGTrO3Ph/s D6+zGi3iPbvRdJwE6gVRzGONbVPz9/+AqNT0HiIGBQo2oWHKCmzh3K2wEZYu7WpSFFpA 1XmLviXJYGeb3HTfCPawhPdDbTPJ8yQn2oMouDiMBShT1Ci/O0kuiSwFqT6YqZJQcRp9 2BYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="H1Ji/SSR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn1si924398edb.408.2020.11.05.03.38.39; Thu, 05 Nov 2020 03:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="H1Ji/SSR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbgKELeg (ORCPT + 99 others); Thu, 5 Nov 2020 06:34:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50268 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729887AbgKELee (ORCPT ); Thu, 5 Nov 2020 06:34:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604576073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BqAyd5oPIZ6twy3M+P8m2ePirTM3ef9UMxPbSLSvBUQ=; b=H1Ji/SSRLepPs593QvmPTFjBbLbFlS7MR3Ob4Dx5DKDHjzAXgua8ZV2YDUgnKxxtGU/FA5 PPC9Y0zixfoGYhAmOQyOM00VS0i6gYd+3416d4CPZXksxjmL4/vFABGF8QNPZA7sfl78nI CkPmg6YuSTolP1yzWCFShYLB0hENryc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-CKDof9iRPs6yY3cC_MY5pQ-1; Thu, 05 Nov 2020 06:34:29 -0500 X-MC-Unique: CKDof9iRPs6yY3cC_MY5pQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84B22186841A; Thu, 5 Nov 2020 11:34:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id C210C6266E; Thu, 5 Nov 2020 11:34:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D61CE9D0F; Thu, 5 Nov 2020 12:34:25 +0100 (CET) Date: Thu, 5 Nov 2020 12:34:25 +0100 From: Gerd Hoffmann To: Sergey Senozhatsky Cc: Sergey Senozhatsky , David Airlie , Daniel Vetter , Suleiman Souhlal , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/virtio: use kvmalloc for large allocations Message-ID: <20201105113425.q45omct7eb44eraq@sirius.home.kraxel.org> References: <20201105014744.1662226-1-senozhatsky@chromium.org> <20201105065233.3td3zuyfmbypjtvq@sirius.home.kraxel.org> <20201105070054.GD128655@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201105070054.GD128655@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 05, 2020 at 04:00:54PM +0900, Sergey Senozhatsky wrote: > Hi, > > On (20/11/05 07:52), Gerd Hoffmann wrote: > > > - *ents = kmalloc_array(*nents, sizeof(struct virtio_gpu_mem_entry), > > > - GFP_KERNEL); > > > + *ents = kvmalloc_array(*nents, > > > + sizeof(struct virtio_gpu_mem_entry), > > > + GFP_KERNEL); > > > > Shouldn't that be balanced with a kvfree() elsewhere? > > I think it already is. ents pointer is assigned to vbuf->data_buf, > and free_vbuf() already uses kvfree(vbuf->data_buf) to free it. Ah, right, we needed that before elsewhere. Ok then, pushed to drm-misc-next. thanks, Gerd