Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1493218
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: warn about allocations which stall for too long |
| Date | 2016-09-29 10:50 +0200 |
| Message-ID | <smFcu-1IL-11@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <skzNU-4QO-35@gated-at.bofh.it> <skAgW-5sZ-41@gated-at.bofh.it> <skLvH-450-5@gated-at.bofh.it> <slziO-1rJ-25@gated-at.bofh.it> <sm09k-1bo-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue 27-09-16 21:57:26, Tetsuo Handa wrote: > Michal Hocko wrote: > > > > > ) rather than by line number, and surround __warn_memalloc_stall() call with > > > > > mutex in order to serialize warning messages because it is possible that > > > > > multiple allocation requests are stalling? > > > > > > > > we do not use any lock in warn_alloc_failed so why this should be any > > > > different? > > > > > > warn_alloc_failed() is called for both __GFP_DIRECT_RECLAIM and > > > !__GFP_DIRECT_RECLAIM allocation requests, and it is not allowed > > > to sleep if !__GFP_DIRECT_RECLAIM. Thus, we have to tolerate that > > > concurrent memory allocation failure messages make dmesg output > > > unreadable. But __warn_memalloc_stall() is called for only > > > __GFP_DIRECT_RECLAIM allocation requests. Thus, we are allowed to > > > sleep in order to serialize concurrent memory allocation stall > > > messages. > > > > I still do not see a point. A single line about the warning and locked > > dump_stack sounds sufficient to me. > > printk() is slow operation. It is possible that two allocation requests > start within time period needed for completing warn_alloc_failed(). > It is possible that multiple concurrent allocations are stalling when > one of them cannot be satisfied. The consequence is multiple concurrent > timeouts corrupting dmesg. > http://I-love.SAKURA.ne.jp/tmp/serial-20160927-nolock.txt.xz > (Please ignore Oops at do_task_stat(); it is irrelevant to this topic.) > > If we guard it with mutex_lock(&oom_lock)/mutex_unlock(&oom_lock), > no corruption. > http://I-love.SAKURA.ne.jp/tmp/serial-20160927-lock.txt.xz I have just posted v2 which reuses warn_alloc_failed infrastructure. If we want to have a lock there then it should be a separate patch imho. Ideally with and example from your above kernel log. -- Michal Hocko SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] mm: warn about allocations which stall for too long Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-09-23 16:40 +0200
Re: [PATCH] mm: warn about allocations which stall for too long Michal Hocko <mhocko@kernel.org> - 2016-09-23 17:10 +0200
Re: [PATCH] mm: warn about allocations which stall for too long Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-09-24 05:10 +0200
Re: [PATCH] mm: warn about allocations which stall for too long Michal Hocko <mhocko@kernel.org> - 2016-09-26 10:20 +0200
Re: [PATCH] mm: warn about allocations which stall for too long Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-09-27 15:00 +0200
Re: [PATCH] mm: warn about allocations which stall for too long Michal Hocko <mhocko@kernel.org> - 2016-09-29 10:50 +0200
csiph-web