Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 20:50:24, Sergey Senozhatsky wrote: > On (01/13/17 12:03), Petr Mladek wrote: > [..] > > > why can't we? > > > > Because it would newer call cond_resched() in non-preemptive kernel > > with CONFIG_PREEMPT_COUNT disabled. IMHO, we want to call it, > > for example, when we scroll

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 20:50:24, Sergey Senozhatsky wrote: > On (01/13/17 12:03), Petr Mladek wrote: > [..] > > > why can't we? > > > > Because it would newer call cond_resched() in non-preemptive kernel > > with CONFIG_PREEMPT_COUNT disabled. IMHO, we want to call it, > > for example, when we scroll

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Sergey Senozhatsky
On (01/13/17 12:03), Petr Mladek wrote: [..] > > why can't we? > > Because it would newer call cond_resched() in non-preemptive kernel > with CONFIG_PREEMPT_COUNT disabled. IMHO, we want to call it, > for example, when we scroll the entire screen from tty_operations. > > Or do I miss anything?

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Sergey Senozhatsky
On (01/13/17 12:03), Petr Mladek wrote: [..] > > why can't we? > > Because it would newer call cond_resched() in non-preemptive kernel > with CONFIG_PREEMPT_COUNT disabled. IMHO, we want to call it, > for example, when we scroll the entire screen from tty_operations. > > Or do I miss anything?

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 12:53:07, Sergey Senozhatsky wrote: > On (01/13/17 11:52), Sergey Senozhatsky wrote: > [..] > > and we really don't want to cond_resched() when we are in panic. > > that's why console_flush_on_panic() sets it to zero explicitly. > > > > console_trylock() checks oops_in_progress,

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 12:53:07, Sergey Senozhatsky wrote: > On (01/13/17 11:52), Sergey Senozhatsky wrote: > [..] > > and we really don't want to cond_resched() when we are in panic. > > that's why console_flush_on_panic() sets it to zero explicitly. > > > > console_trylock() checks oops_in_progress,

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 11:52:55, Sergey Senozhatsky wrote: > On (01/12/17 14:10), Petr Mladek wrote: > [..] > > > /** > > > * console_lock - lock the console system for exclusive use. > > > * > > > @@ -2316,7 +2321,7 @@ EXPORT_SYMBOL(console_unlock); > > > */ > > > void __sched

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 11:52:55, Sergey Senozhatsky wrote: > On (01/12/17 14:10), Petr Mladek wrote: > [..] > > > /** > > > * console_lock - lock the console system for exclusive use. > > > * > > > @@ -2316,7 +2321,7 @@ EXPORT_SYMBOL(console_unlock); > > > */ > > > void __sched

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 11:28:43, Sergey Senozhatsky wrote: > On (01/12/17 15:18), Petr Mladek wrote: > > On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > > > console_trylock() used to always forbid rescheduling; but it got changed > > > like a yaer ago. > > > > > > the other thing is... do we

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-13 Thread Petr Mladek
On Fri 2017-01-13 11:28:43, Sergey Senozhatsky wrote: > On (01/12/17 15:18), Petr Mladek wrote: > > On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > > > console_trylock() used to always forbid rescheduling; but it got changed > > > like a yaer ago. > > > > > > the other thing is... do we

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/13/17 11:52), Sergey Senozhatsky wrote: [..] > and we really don't want to cond_resched() when we are in panic. > that's why console_flush_on_panic() sets it to zero explicitly. > > console_trylock() checks oops_in_progress, so re-taking the semaphore > when we are in > > panic() >

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/13/17 11:52), Sergey Senozhatsky wrote: [..] > and we really don't want to cond_resched() when we are in panic. > that's why console_flush_on_panic() sets it to zero explicitly. > > console_trylock() checks oops_in_progress, so re-taking the semaphore > when we are in > > panic() >

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/12/17 14:10), Petr Mladek wrote: [..] > > /** > > * console_lock - lock the console system for exclusive use. > > * > > @@ -2316,7 +2321,7 @@ EXPORT_SYMBOL(console_unlock); > > */ > > void __sched console_conditional_schedule(void) > > { > > - if (console_may_schedule) > > + if

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/12/17 14:10), Petr Mladek wrote: [..] > > /** > > * console_lock - lock the console system for exclusive use. > > * > > @@ -2316,7 +2321,7 @@ EXPORT_SYMBOL(console_unlock); > > */ > > void __sched console_conditional_schedule(void) > > { > > - if (console_may_schedule) > > + if

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/12/17 15:18), Petr Mladek wrote: > On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > > console_trylock() used to always forbid rescheduling; but it got changed > > like a yaer ago. > > > > the other thing is... do we really need to console_conditional_schedule() > > from fbcon_*()?

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Sergey Senozhatsky
On (01/12/17 15:18), Petr Mladek wrote: > On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > > console_trylock() used to always forbid rescheduling; but it got changed > > like a yaer ago. > > > > the other thing is... do we really need to console_conditional_schedule() > > from fbcon_*()?

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Petr Mladek
On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > console_trylock() used to always forbid rescheduling; but it got changed > like a yaer ago. > > the other thing is... do we really need to console_conditional_schedule() > from fbcon_*()? console_unlock() does cond_resched() after every line

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Petr Mladek
On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > console_trylock() used to always forbid rescheduling; but it got changed > like a yaer ago. > > the other thing is... do we really need to console_conditional_schedule() > from fbcon_*()? console_unlock() does cond_resched() after every line

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Petr Mladek
On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > Cc Greg, Jiri, > > On (12/26/16 19:54), Tetsuo Handa wrote: > [..] > > > > (3) I got below warning. (Though not reproducible.) > > If fb_flashcursor() called console_trylock(), console_may_schedule is > > set to 1? > > hmmm... it

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2017-01-12 Thread Petr Mladek
On Mon 2016-12-26 20:34:07, Sergey Senozhatsky wrote: > Cc Greg, Jiri, > > On (12/26/16 19:54), Tetsuo Handa wrote: > [..] > > > > (3) I got below warning. (Though not reproducible.) > > If fb_flashcursor() called console_trylock(), console_may_schedule is > > set to 1? > > hmmm... it

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2016-12-26 Thread Sergey Senozhatsky
Cc Greg, Jiri, On (12/26/16 19:54), Tetsuo Handa wrote: [..] > > (3) I got below warning. (Though not reproducible.) > If fb_flashcursor() called console_trylock(), console_may_schedule is set > to 1? hmmm... it takes an atomic/spin `printing_lock' lock in vt_console_print(), then call

Re: [PATCH] mm/page_alloc: Wait for oom_lock before retrying.

2016-12-26 Thread Sergey Senozhatsky
Cc Greg, Jiri, On (12/26/16 19:54), Tetsuo Handa wrote: [..] > > (3) I got below warning. (Though not reproducible.) > If fb_flashcursor() called console_trylock(), console_may_schedule is set > to 1? hmmm... it takes an atomic/spin `printing_lock' lock in vt_console_print(), then call