linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>,
	Roman Gushchin <guro@fb.com>, Michal Hocko <mhocko@suse.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Thomas Garnier <thgarnie@google.com>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Joel Fernandes <joelaf@google.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH v4 1/3] mm/vmap: keep track of free blocks for vmap allocation
Date: Wed, 15 May 2019 17:24:15 +0200	[thread overview]
Message-ID: <20190515152415.lcbnqvcjppype7i5@pc636> (raw)
In-Reply-To: <20190514141942.23271725e5d1b8477a44f102@linux-foundation.org>

Hello, Andrew.

> An earlier version of this patch was accused of crashing the kernel:
> 
> https://lists.01.org/pipermail/lkp/2019-April/010004.html
> 
> does the v4 series address this?
I tried before to narrow down that crash but i did not succeed, so
i have never seen that before on my test environment as well as
during running lkp-tests including trinity test case:

test-url: http://codemonkey.org.uk/projects/trinity/

But after analysis of the Call-trace and slob_alloc(): 

<snip>
[    0.395722] Call Trace:
[    0.395722]  slob_alloc+0x1c9/0x240
[    0.395722]  kmem_cache_alloc+0x70/0x80
[    0.395722]  acpi_ps_alloc_op+0xc0/0xca
[    0.395722]  acpi_ps_get_next_arg+0x3fa/0x6ed
<snip>

<snip>
    /* Attempt to alloc */
    prev = sp->lru.prev;
    b = slob_page_alloc(sp, size, align);
    if (!b)
        continue;

    /* Improve fragment distribution and reduce our average
     * search time by starting our next search here. (see
     * Knuth vol 1, sec 2.5, pg 449) */
    if (prev != slob_list->prev &&
            slob_list->next != prev->next)
        list_move_tail(slob_list, prev->next); <- Crash is here in __list_add_valid()
    break;
}
<snip>

i see that it tries to manipulate with "prev" node that may be removed
from the list by slob_page_alloc() earlier if whole page is used. I think
that crash has to be fixed by the below commit:

https://www.spinics.net/lists/mm-commits/msg137923.html

it was introduced into 5.1-rc3 kernel.

Why ("mm/vmalloc.c: keep track of free blocks for vmap allocation")
was accused is probably because it uses "kmem cache allocations with struct alignment"
instead of kmalloc()/kzalloc(). Maybe because of bigger size requests
it became easier to trigger the BUG. But that is theory.

--
Vlad Rezki

  reply	other threads:[~2019-05-15 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-06 18:35 [PATCH v4 0/3] improve vmap allocation Uladzislau Rezki (Sony)
2019-04-06 18:35 ` [PATCH v4 1/3] mm/vmap: keep track of free blocks for " Uladzislau Rezki (Sony)
2019-04-08 23:19   ` Roman Gushchin
2019-04-09  9:45     ` Uladzislau Rezki
2019-05-14 21:19   ` Andrew Morton
2019-05-15 15:24     ` Uladzislau Rezki [this message]
2019-05-16  7:30       ` Uladzislau Rezki
2019-04-06 18:35 ` [PATCH v4 2/3] mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro Uladzislau Rezki (Sony)
2019-04-06 18:35 ` [PATCH v4 3/3] mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro Uladzislau Rezki (Sony)

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=20190515152415.lcbnqvcjppype7i5@pc636 \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=joelaf@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mingo@elte.hu \
    --cc=oleksiy.avramchenko@sonymobile.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=tj@kernel.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).