From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Igor Druzhinin <igor.druzhinin@citrix.com>
Cc: intel-gvt-dev@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, zhenyuw@linux.intel.com,
zhi.a.wang@intel.com, jani.nikula@linux.intel.com,
joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com,
airlied@linux.ie, daniel@ffwll.ch
Subject: Re: [PATCH] drm/i915/gvt: fix high-order allocation failure on late load
Date: Thu, 23 Jan 2020 13:07:27 +0800 [thread overview]
Message-ID: <20200123050727.GA25905@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <1579723824-25711-1-git-send-email-igor.druzhinin@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]
On 2020.01.22 20:10:24 +0000, Igor Druzhinin wrote:
> If the module happens to be loaded later at runtime there is a chance
> memory is already fragmented enough to fail allocation of firmware
> blob storage and consequently GVT init. Since it doesn't seem to be
> necessary to have the blob contiguous, use vmalloc() instead to avoid
> the issue.
>
> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> ---
> drivers/gpu/drm/i915/gvt/firmware.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
> index 049775e..b0c1fda 100644
> --- a/drivers/gpu/drm/i915/gvt/firmware.c
> +++ b/drivers/gpu/drm/i915/gvt/firmware.c
> @@ -146,7 +146,7 @@ void intel_gvt_free_firmware(struct intel_gvt *gvt)
> clean_firmware_sysfs(gvt);
>
> kfree(gvt->firmware.cfg_space);
> - kfree(gvt->firmware.mmio);
> + vfree(gvt->firmware.mmio);
> }
>
> static int verify_firmware(struct intel_gvt *gvt,
> @@ -229,7 +229,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
>
> firmware->cfg_space = mem;
>
> - mem = kmalloc(info->mmio_size, GFP_KERNEL);
> + mem = vmalloc(info->mmio_size);
> if (!mem) {
> kfree(path);
> kfree(firmware->cfg_space);
> --
> 2.7.4
>
Looks fine to me. Thanks!
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
prev parent reply other threads:[~2020-01-23 5:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 20:10 Igor Druzhinin
2020-01-23 5:07 ` Zhenyu Wang [this message]
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=20200123050727.GA25905@zhen-hp.sh.intel.com \
--to=zhenyuw@linux.intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=igor.druzhinin@citrix.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=zhi.a.wang@intel.com \
/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
all inboxes | Powered by JetHome®