From: David Hildenbrand <firstname.lastname@example.org> To: John Hubbard <email@example.com>, Minchan Kim <firstname.lastname@example.org>, Andrew Morton <email@example.com> Cc: linux-mm <firstname.lastname@example.org>, LKML <email@example.com>, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org Subject: Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count Date: Wed, 24 Mar 2021 20:53:26 +0100 [thread overview] Message-ID: <email@example.com> (raw) In-Reply-To: <firstname.lastname@example.org> On 24.03.21 20:45, John Hubbard wrote: > On 3/24/21 12:20 PM, Minchan Kim wrote: >> struct cma_stat's lifespan for cma_sysfs is different with >> struct cma because kobject for sysfs requires dynamic object >> while CMA is static object. When CMA is initialized, >> it couldn't use slab to allocate cma_stat since slab was not >> initialized yet. Thus, it allocates the dynamic object >> in subsys_initcall. >> >> However, the cma allocation can happens before subsys_initcall >> then, it goes crash. >> >> Dmitry reported: >> >> .. >> [ 1.226190] [<c027762f>] (cma_sysfs_alloc_pages_count) from [<c027706f>] (cma_alloc+0x153/0x274) >> [ 1.226720] [<c027706f>] (cma_alloc) from [<c01112ab>] (__alloc_from_contiguous+0x37/0x8c) >> [ 1.227272] [<c01112ab>] (__alloc_from_contiguous) from [<c1104af9>] (atomic_pool_init+0x7b/0x126) >> [ 1.233596] [<c1104af9>] (atomic_pool_init) from [<c0101d69>] (do_one_initcall+0x45/0x1e4) >> [ 1.234188] [<c0101d69>] (do_one_initcall) from [<c1101141>] (kernel_init_freeable+0x157/0x1a6) >> [ 1.234741] [<c1101141>] (kernel_init_freeable) from [<c0a27fd1>] (kernel_init+0xd/0xe0) >> [ 1.235289] [<c0a27fd1>] (kernel_init) from [<c0100155>] (ret_from_fork+0x11/0x1c) >> >> This patch moves those statistic fields of cma_stat into struct cma >> and introduces cma_kobject wrapper to follow kobject's rule. >> >> At the same time, it fixes other routines based on suggestions. >> >>  https://lore.kernel.org/linux-mm/YCOAmXqt6dZkCQYs@kroah.com/ >>  https://email@example.com/ >>  https://firstname.lastname@example.org/ >>  https://email@example.com/ >> >> Reported-by: Dmitry Osipenko <firstname.lastname@example.org> >> Tested-by: Dmitry Osipenko <email@example.com> >> Suggested-by: Dmitry Osipenko <firstname.lastname@example.org> >> Suggested-by: John Hubbard <email@example.com> >> Suggested-by: Matthew Wilcox <firstname.lastname@example.org> >> Signed-off-by: Minchan Kim <email@example.com> >> --- >> I belive it's worth to have separate patch rather than replacing >> original patch. It will also help to merge without conflict >> since we already filed other patch based on it. >> Strictly speaking, separating fix part and readbility part >> in this patch would be better but it's gray to separate them >> since most code in this patch was done while we were fixing >> the bug. Since we don't release it yet, I hope it will work. >> Otherwise, I can send a replacement patch inclucing all of >> changes happend until now with gathering SoB. > > If we still have a choice, we should not merge a patch that has a known > serious problem, such as a crash. That's only done if the broken problematic > patch has already been committed to a tree that doesn't allow rebasing, > such as of course the main linux.git. > > Here, I *think* it's just in linux-next and mmotm, so we still are allowed > to fix the original patch. Yes, that's what we should do in case it's not upstream yet. Clean resend + re-apply. -- Thanks, David / dhildenb
next prev parent reply other threads:[~2021-03-24 19:53 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-24 19:20 Minchan Kim 2021-03-24 19:43 ` Dmitry Osipenko 2021-03-24 19:49 ` Minchan Kim 2021-03-24 19:49 ` Dmitry Osipenko 2021-03-24 19:57 ` Minchan Kim 2021-03-24 20:02 ` Dmitry Osipenko 2021-03-24 20:55 ` Minchan Kim 2021-03-24 19:45 ` John Hubbard 2021-03-24 19:53 ` David Hildenbrand [this message] 2021-03-24 19:55 ` Minchan Kim
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 \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count' \ /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
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).