Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378369 > unrolled thread

linux-next crash during very early boot

Started byValdis Kletnieks <Valdis.Kletnieks@vt.edu>
First post2016-04-14 02:40 +0200
Last post2016-04-15 16:20 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  linux-next crash during very early boot Valdis Kletnieks <Valdis.Kletnieks@vt.edu> - 2016-04-14 02:40 +0200
    Re: linux-next crash during very early boot Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-04-14 03:40 +0200
      Re: linux-next crash during very early boot Valdis.Kletnieks@vt.edu - 2016-04-14 21:30 +0200
        Re: linux-next crash during very early boot Joonsoo Kim <js1304@gmail.com> - 2016-04-15 03:30 +0200
      Re: linux-next crash during very early boot Valdis.Kletnieks@vt.edu - 2016-04-15 16:20 +0200

#1378369 — linux-next crash during very early boot

FromValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Date2016-04-14 02:40 +0200
Subjectlinux-next crash during very early boot
Message-ID<rnDu9-1rq-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

I'm seeing my laptop crash/wedge up/something during very early
boot - before it can write anything to the console.  Nothing in pstore,
need to hold down the power button for 6 seconds and reboot.

git bisect points at:

commit 7a6bacb133752beacb76775797fd550417e9d3a2
Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Date:   Thu Apr 7 13:59:39 2016 +1000

    mm/slab: factor out kmem_cache_node initialization code

    It can be reused on other place, so factor out it.  Following patch will
    use it.


Not sure what the problem is - the logic *looks* ok at first read.  The
patch *does* remove a spin_lock_irq() - but I find it difficult to
believe that with it gone, my laptop is able to hit the race condition
the spinlock protects against *every single boot*.

The only other thing I see is that n->free_limit used to be assigned
every time, and now it's only assigned at initial creation.

[toc] | [next] | [standalone]


#1378386

FromJoonsoo Kim <iamjoonsoo.kim@lge.com>
Date2016-04-14 03:40 +0200
Message-ID<rnEqe-27K-5@gated-at.bofh.it>
In reply to#1378369
On Wed, Apr 13, 2016 at 08:29:46PM -0400, Valdis Kletnieks wrote:
> I'm seeing my laptop crash/wedge up/something during very early
> boot - before it can write anything to the console.  Nothing in pstore,
> need to hold down the power button for 6 seconds and reboot.
> 
> git bisect points at:
> 
> commit 7a6bacb133752beacb76775797fd550417e9d3a2
> Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Date:   Thu Apr 7 13:59:39 2016 +1000
> 
>     mm/slab: factor out kmem_cache_node initialization code
> 
>     It can be reused on other place, so factor out it.  Following patch will
>     use it.
> 
> 
> Not sure what the problem is - the logic *looks* ok at first read.  The
> patch *does* remove a spin_lock_irq() - but I find it difficult to
> believe that with it gone, my laptop is able to hit the race condition
> the spinlock protects against *every single boot*.
> 
> The only other thing I see is that n->free_limit used to be assigned
> every time, and now it's only assigned at initial creation.

Hello,

My fault. It should be assgined every time. Please test below patch.
I will send it with proper SOB after you confirm the problem disappear.
Thanks for report and analysis!

Thanks.

---------------->8-----------------
diff --git a/mm/slab.c b/mm/slab.c
index 13e74aa..59dd94a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -856,8 +856,14 @@ static int init_cache_node(struct kmem_cache *cachep, int node, gfp_t gfp)
 	 * node has not already allocated this
 	 */
 	n = get_node(cachep, node);
-	if (n)
+	if (n) {
+		spin_lock_irq(&n->list_lock);
+		n->free_limit = (1 + nr_cpus_node(node)) * cachep->batchcount +
+				cachep->num;
+		spin_unlock_irq(&n->list_lock);
+
 		return 0;
+	}
 
 	n = kmalloc_node(sizeof(struct kmem_cache_node), gfp, node);
 	if (!n)

[toc] | [prev] | [next] | [standalone]


#1379242

FromValdis.Kletnieks@vt.edu
Date2016-04-14 21:30 +0200
Message-ID<rnV7I-77H-25@gated-at.bofh.it>
In reply to#1378386

[Multipart message — attachments visible in raw view] — view raw

On Thu, 14 Apr 2016 10:35:47 +0900, Joonsoo Kim said:

> My fault. It should be assgined every time. Please test below patch.
> I will send it with proper SOB after you confirm the problem disappear.
> Thanks for report and analysis!

Still bombs out, sorry.  Will do more debugging this evening if I have
a chance - will follow up tomorrow morning US time....

[toc] | [prev] | [next] | [standalone]


#1379399

FromJoonsoo Kim <js1304@gmail.com>
Date2016-04-15 03:30 +0200
Message-ID<ro0K6-37f-1@gated-at.bofh.it>
In reply to#1379242
2016-04-15 4:22 GMT+09:00  <Valdis.Kletnieks@vt.edu>:
> On Thu, 14 Apr 2016 10:35:47 +0900, Joonsoo Kim said:
>
>> My fault. It should be assgined every time. Please test below patch.
>> I will send it with proper SOB after you confirm the problem disappear.
>> Thanks for report and analysis!
>
> Still bombs out, sorry.  Will do more debugging this evening if I have
> a chance - will follow up tomorrow morning US time....

Hmm... could you also apply the patch on below link?
There is another issue from me and fix is there.

https://lkml.org/lkml/2016/4/10/703

Thanks.

[toc] | [prev] | [next] | [standalone]


#1379850

FromValdis.Kletnieks@vt.edu
Date2016-04-15 16:20 +0200
Message-ID<rocLh-4gd-25@gated-at.bofh.it>
In reply to#1378386

[Multipart message — attachments visible in raw view] — view raw

On Thu, 14 Apr 2016 10:35:47 +0900, Joonsoo Kim said:
> On Wed, Apr 13, 2016 at 08:29:46PM -0400, Valdis Kletnieks wrote:
> > I'm seeing my laptop crash/wedge up/something during very early
> > boot - before it can write anything to the console.  Nothing in pstore,
> > need to hold down the power button for 6 seconds and reboot.
> >
> > git bisect points at:
> >
> > commit 7a6bacb133752beacb76775797fd550417e9d3a2
> > Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> > Date:   Thu Apr 7 13:59:39 2016 +1000
> >
> >     mm/slab: factor out kmem_cache_node initialization code
> >
> >     It can be reused on other place, so factor out it.  Following patch wil
l
> >     use it.
> >
> >
> > Not sure what the problem is - the logic *looks* ok at first read.  The
> > patch *does* remove a spin_lock_irq() - but I find it difficult to
> > believe that with it gone, my laptop is able to hit the race condition
> > the spinlock protects against *every single boot*.
> >
> > The only other thing I see is that n->free_limit used to be assigned
> > every time, and now it's only assigned at initial creation.
>
> Hello,
>
> My fault. It should be assgined every time. Please test below patch.
> I will send it with proper SOB after you confirm the problem disappear.
> Thanks for report and analysis!

Following up - I verified that it was your patch series and not a bad bisect
by starting with a clean next-20160413 and reverting that series - and the
resulting kernel boots fine.

Will take a closer look at your fix patch and figure out what's still changed
afterwards - there's obviously some small semantic change that actually
matters, but we're not spotting it yet...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web