From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.com>, Tejun Heo <tj@kernel.org>,
Kyle McMartin <kyle@kernel.org>,
Dave Jones <davej@codemonkey.org.uk>,
Calvin Owens <calvinowens@fb.com>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [RFC][PATCH v3 4/4] printk: set may_schedule for some of console_trylock callers
Date: Fri, 12 Feb 2016 14:11:35 +0900 [thread overview]
Message-ID: <20160212051135.GA570@swordfish> (raw)
In-Reply-To: <20160211161000.GN3305@pathway.suse.cz>
On (02/11/16 17:10), Petr Mladek wrote:
[..]
> > well, I believe it's ok. __rcu_read_lock() for CONFIG_PREEMPT_RCU
> > does current->rcu_read_lock_nesting++, so rcu_preempt_depth() works
> > as expected. otherwise, for !CONFIG_PREEMPT_RCU kernel,
> > __rcu_read_lock() does
> >
> > if (IS_ENABLED(CONFIG_PREEMPT_COUNT))
> > preempt_disable()
> >
> >
> > - if we run "CONFIG_PREEMPT_RCU" then rcu_preempt_depth()
> > works here.
> >
> > - if we run "!CONFIG_PREEMPT_RCU && CONFIG_PREEMPT_COUNT"
> > then preemptible() works for us
> >
> > - if we run "!CONFIG_PREEMPT_RCU && !CONFIG_PREEMPT_COUNT"
> > then preemptible() is always 0.
>
> I feel convinced. But we should somehow document it. I think how
> to do it effectively. I think that the following text would help
> me if I read it:
>
> /*
> * Safe context for rescheduling is detected only when
> * PREEMPT_COUNT is enabled. preemptible() always returns
> * false otherwise.
> *
> * RCU read sections must be detected separately. They
> * have a separate preemption counter when PREEMPT_RCU
> * is enabled.
> */
>
> I wanted to highlight why exactly the check returns 0 in !PREEMPT_COUNT
> kernel. I missed this a bit in you original comment. But feel free
> to change it as you like.
good point. thanks! will re-spin the patch set later today,
have no reliable internet connection at the moment.
-ss
next prev parent reply other threads:[~2016-02-12 5:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 8:15 [RFC][PATCH v3 0/4] let printk()/console_trylock() callers to cond_resched() Sergey Senozhatsky
2016-01-23 8:15 ` [RFC][PATCH v3 1/4] printk: move can_use_console out of console_trylock_for_printk Sergey Senozhatsky
2016-02-10 16:48 ` Petr Mladek
2016-02-11 7:57 ` Sergey Senozhatsky
2016-01-23 8:15 ` [RFC][PATCH v3 2/4] printk: do not console_cont_flush() on every jump to again Sergey Senozhatsky
2016-02-10 16:58 ` Petr Mladek
2016-02-11 8:03 ` Sergey Senozhatsky
2016-01-23 8:15 ` [RFC][PATCH v3 3/4] printk: remove console_trylock_for_printk Sergey Senozhatsky
2016-02-11 12:33 ` Petr Mladek
2016-01-23 8:15 ` [RFC][PATCH v3 4/4] printk: set may_schedule for some of console_trylock callers Sergey Senozhatsky
2016-02-11 14:41 ` Petr Mladek
2016-02-11 15:02 ` Sergey Senozhatsky
2016-02-11 16:10 ` Petr Mladek
2016-02-12 5:11 ` Sergey Senozhatsky [this message]
2016-02-03 3:49 ` [RFC][PATCH v3 0/4] let printk()/console_trylock() callers to cond_resched() Sergey Senozhatsky
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=20160212051135.GA570@swordfish \
--to=sergey.senozhatsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=calvinowens@fb.com \
--cc=davej@codemonkey.org.uk \
--cc=jack@suse.com \
--cc=kyle@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pmladek@suse.com \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).