public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Ahmed Soliman <ahmedsoliman@mena.vt.edu>
Cc: Anders Roxell <anders.roxell@linaro.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>,
	linux-kernel@vger.kernel.org, Andrew Jones <drjones@redhat.com>
Subject: Re: KVM selftests are failing
Date: Thu, 15 Nov 2018 17:39:01 +0100	[thread overview]
Message-ID: <87efbmqore.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <CANBxJ=EGR=7RrO8ZtJFUwpNZRy_adjCObNtWtcMA=y4rLgeWaQ@mail.gmail.com>

Ahmed Soliman <ahmedsoliman@mena.vt.edu> writes:

> Hello,
> On Thu, Nov 15, 2018 at 4:50 PM Andrew Jones <drjones@redhat.com> wrote:
>>
>> On Thu, Nov 15, 2018 at 03:36:44PM +0200, Ahmed Soliman wrote:
>> > mmap(NULL, 6291456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
>> > -1, 0) = 0x7f46ea2a1000
>> > madvise(0x7f46ea2a1000, 6291456, MADV_NOHUGEPAGE) = -1 EINVAL (Invalid argument)
>> >
>> > For comprehension, this is done on intel core i7-4500U CPU @ 1.80GHz
>>
>> Argh. I see what it is. Your config doesn't have CONFIG_TRANSPARENT_HUGEPAGE=y,
>> so madvise_behavior_valid() returns false, which causes madvise() to
>> immediately return EINVAL. We should be more careful in kvm selftests with
>> our madvise behavior use.
>>
>> >
>> > As for now I will comment the madvise line and the assert when writing
>> > my own kvm self test. I think it wouldn't cause any trouble?, If it is
>> > not the case, please let me know.
>> >
>>
>> You may not need madvise() at all for your test, depending on what you're
>> doing. So leaving it out may be fine. Reworking kvm selftests to ensure
>> only valid madvise behaviors are used (and only when necessary), before
>> adding new tests, would be best.
>
> Confirmed it worked after CONFIG_TRANSPARENT_HUGEPAGE=y
> I will send a patch soon that should make the self test check if
> Transparent huge pages are enabled first before issuing the related
> madvise()

Just ignore -EINVAL returned from madvise(), QEMU went even further,
see:

commit 1d7414396f926651c4d7a673eb3a10aca5246d76
Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Date:   Thu Nov 19 15:27:48 2015 +0000

    Assume madvise for (no)hugepage works

-- 
Vitaly

  reply	other threads:[~2018-11-15 16:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 15:30 KVM selftests are failing Ahmed Soliman
2018-11-14 18:08 ` Andrew Jones
2018-11-14 18:19   ` Anders Roxell
2018-11-14 19:23     ` Ahmed Soliman
2018-11-14 21:29       ` Ahmed Soliman
2018-11-15  9:02         ` Andrew Jones
2018-11-15 13:36           ` Ahmed Soliman
2018-11-15 14:50             ` Andrew Jones
2018-11-15 16:15               ` Ahmed Soliman
2018-11-15 16:39                 ` Vitaly Kuznetsov [this message]
2018-11-16 12:00                   ` Ahmed Soliman
2018-11-16 12:08                     ` Paolo Bonzini
2018-11-16 13:36                     ` Vitaly Kuznetsov
2018-11-17 19:43                       ` Ahmed Soliman
2018-11-15  8:41       ` Andrew Jones

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=87efbmqore.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=ahmedsoliman@mena.vt.edu \
    --cc=anders.roxell@linaro.org \
    --cc=drjones@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=shuah@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