From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Include the size in the error message for mlock
Date: Tue, 22 Jan 2019 10:55:15 -0800 [thread overview]
Message-ID: <73afc737-d2bc-7ee0-a252-92562768749e@intel.com> (raw)
In-Reply-To: <20190122181728.2500-1-chris@chris-wilson.co.uk>
On 22/01/19 10:17, Chris Wilson wrote:
> Knowing how much we tried to allocate would be useful if one should need
> to debug why it failed.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=109439
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
LGTM.
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
> lib/igt_aux.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 1250d5c5f..2e2d552b5 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -1080,14 +1080,14 @@ void igt_lock_mem(size_t size)
>
> locked_mem = malloc(locked_size);
> igt_require_f(locked_mem,
> - "Could not allocate enough memory to lock.\n");
> + "Could not malloc %zdMiB for locking.\n", size);
>
> /* write into each page to ensure it is allocated */
> for (i = 0; i < locked_size; i += pagesize)
> locked_mem[i] = i;
>
> ret = mlock(locked_mem, locked_size);
> - igt_assert_f(ret == 0, "Could not lock memory into RAM.\n");
> + igt_assert_f(ret == 0, "Could not mlock %zdMiB.\n", size);
> }
>
> /**
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-01-22 18:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 18:17 [igt-dev] [PATCH i-g-t] lib: Include the size in the error message for mlock Chris Wilson
2019-01-22 18:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-22 18:55 ` Antonio Argenziano [this message]
2019-01-22 20:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=73afc737-d2bc-7ee0-a252-92562768749e@intel.com \
--to=antonio.argenziano@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.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