From: Michal Hocko <mhocko@suse.cz>
To: Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Sasha Levin <sasha.levin@oracle.com>
Subject: Re: [PATCH] mm, debug: mm-introduce-vm_bug_on_mm-fix-fix.patch
Date: Tue, 14 Oct 2014 13:55:54 +0200 [thread overview]
Message-ID: <20141014115554.GB8727@dhcp22.suse.cz> (raw)
In-Reply-To: <20141013185156.GA1959@redhat.com>
On Mon 13-10-14 14:51:56, Dave Jones wrote:
[...]
> diff --git a/mm/debug.c b/mm/debug.c
> index 5ce45c9a29b5..e04e2ae902a1 100644
> --- a/mm/debug.c
> +++ b/mm/debug.c
> @@ -164,74 +164,85 @@ void dump_vma(const struct vm_area_struct *vma)
> }
> EXPORT_SYMBOL(dump_vma);
>
> +static char dumpmm_buffer[4096];
> +
> void dump_mm(const struct mm_struct *mm)
> {
> - pr_emerg("mm %p mmap %p seqnum %d task_size %lu\n"
> -#ifdef CONFIG_MMU
> - "get_unmapped_area %p\n"
> -#endif
> - "mmap_base %lu mmap_legacy_base %lu highest_vm_end %lu\n"
> - "pgd %p mm_users %d mm_count %d nr_ptes %lu map_count %d\n"
> - "hiwater_rss %lx hiwater_vm %lx total_vm %lx locked_vm %lx\n"
> - "pinned_vm %lx shared_vm %lx exec_vm %lx stack_vm %lx\n"
> - "start_code %lx end_code %lx start_data %lx end_data %lx\n"
> - "start_brk %lx brk %lx start_stack %lx\n"
> - "arg_start %lx arg_end %lx env_start %lx env_end %lx\n"
> - "binfmt %p flags %lx core_state %p\n"
> -#ifdef CONFIG_AIO
> - "ioctx_table %p\n"
> -#endif
> -#ifdef CONFIG_MEMCG
> - "owner %p "
> -#endif
> - "exe_file %p\n"
> -#ifdef CONFIG_MMU_NOTIFIER
> - "mmu_notifier_mm %p\n"
> -#endif
> -#ifdef CONFIG_NUMA_BALANCING
> - "numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n"
> -#endif
> -#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
> - "tlb_flush_pending %d\n"
> -#endif
> - "%s", /* This is here to hold the comma */
> + char *p = dumpmm_buffer;
> +
> + memset(dumpmm_buffer, 0, 4096);
I do not see any locking here. Previously we had internal printk log as
a natural synchronization. Now two threads are allowed to scribble over
their messages leaving an unusable output in a better case.
Besides that the %s with "" trick is not really that ugly and handles
the situation quite nicely. So do we really want to make it more
complicated?
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-10-14 11:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 0:02 mmotm 2014-09-22-16-57 uploaded akpm
2014-09-23 0:39 ` Stephen Rothwell
2014-09-23 1:12 ` Andrew Morton
2014-09-23 9:24 ` [PATCH] mm, debug: mm-introduce-vm_bug_on_mm-fix.patch Michal Hocko
2014-09-23 11:28 ` [PATCH] mm, debug: mm-introduce-vm_bug_on_mm-fix-fix.patch Michal Hocko
2014-09-23 16:19 ` Valdis.Kletnieks
2014-09-23 20:52 ` Andrew Morton
2014-09-24 7:09 ` Michal Hocko
2014-09-23 20:12 ` Dave Jones
2014-10-13 18:51 ` Dave Jones
2014-10-13 19:07 ` Joe Perches
2014-10-14 11:55 ` Michal Hocko [this message]
2014-10-14 16:50 ` Dave Jones
2014-10-15 9:03 ` Michal Hocko
2014-09-23 19:02 ` mmotm 2014-09-22-16-57 uploaded Guenter Roeck
2014-09-23 20:01 ` Andrew Morton
2014-09-23 20:13 ` Fabio Estevam
2014-09-23 20:20 ` Naoya Horiguchi
2014-09-23 20:38 ` Guenter Roeck
2014-09-23 21:08 ` Anish Bhatt
2014-09-23 20:31 ` Randy Dunlap
2014-09-23 20:57 ` Guenter Roeck
2014-09-23 21:36 ` Randy Dunlap
2014-09-23 21:53 ` Guenter Roeck
2014-09-24 4:34 ` Guenter Roeck
2014-09-24 6:24 ` David Miller
2014-09-24 7:18 ` Geert Uytterhoeven
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=20141014115554.GB8727@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sasha.levin@oracle.com \
/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