* [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info
@ 2014-05-12 17:56 Fabian Frederick
2014-05-12 18:01 ` Tejun Heo
2014-05-12 18:21 ` Joe Perches
0 siblings, 2 replies; 5+ messages in thread
From: Fabian Frederick @ 2014-05-12 17:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Tejun Heo, akpm
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
kernel/workqueue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0ee63af..6824afc 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4098,8 +4098,8 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
/* create a new pwq */
pwq = alloc_unbound_pwq(wq, target_attrs);
if (!pwq) {
- pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
- wq->name);
+ pr_warn("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
+ wq->name);
goto out_unlock;
}
@@ -4548,7 +4548,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task)
probe_kernel_read(desc, worker->desc, sizeof(desc) - 1);
if (fn || name[0] || desc[0]) {
- printk("%sWorkqueue: %s %pf", log_lvl, name, fn);
+ pr_info("%sWorkqueue: %s %pf", log_lvl, name, fn);
if (desc[0])
pr_cont(" (%s)", desc);
pr_cont("\n");
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info
2014-05-12 17:56 [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info Fabian Frederick
@ 2014-05-12 18:01 ` Tejun Heo
2014-05-12 18:21 ` Joe Perches
1 sibling, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2014-05-12 18:01 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, akpm
On Mon, May 12, 2014 at 07:56:23PM +0200, Fabian Frederick wrote:
>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied to wq/for-3.16. Patch didn't apply and refreshed. Please
consider basing further patches on top of subsystem devel branches.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info
2014-05-12 17:56 [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info Fabian Frederick
2014-05-12 18:01 ` Tejun Heo
@ 2014-05-12 18:21 ` Joe Perches
2014-05-12 18:26 ` Fabian Frederick
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-05-12 18:21 UTC (permalink / raw)
To: Fabian Frederick, Tejun Heo; +Cc: linux-kernel, akpm
On Mon, 2014-05-12 at 19:56 +0200, Fabian Frederick wrote:
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> kernel/workqueue.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 0ee63af..6824afc 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -4098,8 +4098,8 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
> /* create a new pwq */
> pwq = alloc_unbound_pwq(wq, target_attrs);
> if (!pwq) {
> - pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> - wq->name);
> + pr_warn("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> + wq->name);
> goto out_unlock;
> }
>
> @@ -4548,7 +4548,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task)
> probe_kernel_read(desc, worker->desc, sizeof(desc) - 1);
>
> if (fn || name[0] || desc[0]) {
> - printk("%sWorkqueue: %s %pf", log_lvl, name, fn);
> + pr_info("%sWorkqueue: %s %pf", log_lvl, name, fn);
Not correct.
log_lvl already emits the appropriate level
and this overrides it with KERN_INFO.
The output will now be incorrect emitting
at KERN_INFO followed by an SOH and the
desired log level.
> if (desc[0])
> pr_cont(" (%s)", desc);
> pr_cont("\n");
Trivially, it likely would be a bit better to avoid
any possible output message interleaving by using:
if (fn || name[0] || desc[0]) {
if (desc[0])
printk("%sWorkqueue: %s %pf (%s)\n",
log_lvl, name, fn, desc);
else
printk("%sWorkqueue: %s %pf\n",
log_lvl, name, fn);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info
2014-05-12 18:21 ` Joe Perches
@ 2014-05-12 18:26 ` Fabian Frederick
2014-05-12 18:29 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Frederick @ 2014-05-12 18:26 UTC (permalink / raw)
To: Joe Perches; +Cc: Tejun Heo, linux-kernel, akpm
On Mon, 12 May 2014 11:21:28 -0700
Joe Perches <joe@perches.com> wrote:
> On Mon, 2014-05-12 at 19:56 +0200, Fabian Frederick wrote:
> > Cc: Tejun Heo <tj@kernel.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> > ---
> > kernel/workqueue.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> > index 0ee63af..6824afc 100644
> > --- a/kernel/workqueue.c
> > +++ b/kernel/workqueue.c
> > @@ -4098,8 +4098,8 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
> > /* create a new pwq */
> > pwq = alloc_unbound_pwq(wq, target_attrs);
> > if (!pwq) {
> > - pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> > - wq->name);
> > + pr_warn("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
> > + wq->name);
> > goto out_unlock;
> > }
> >
> > @@ -4548,7 +4548,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task)
> > probe_kernel_read(desc, worker->desc, sizeof(desc) - 1);
> >
> > if (fn || name[0] || desc[0]) {
> > - printk("%sWorkqueue: %s %pf", log_lvl, name, fn);
> > + pr_info("%sWorkqueue: %s %pf", log_lvl, name, fn);
>
> Not correct.
>
> log_lvl already emits the appropriate level
> and this overrides it with KERN_INFO.
>
> The output will now be incorrect emitting
> at KERN_INFO followed by an SOH and the
> desired log level.
Such printk can't be converted to pr_ ?
>
> > if (desc[0])
> > pr_cont(" (%s)", desc);
> > pr_cont("\n");
>
> Trivially, it likely would be a bit better to avoid
> any possible output message interleaving by using:
>
> if (fn || name[0] || desc[0]) {
> if (desc[0])
> printk("%sWorkqueue: %s %pf (%s)\n",
> log_lvl, name, fn, desc);
> else
> printk("%sWorkqueue: %s %pf\n",
> log_lvl, name, fn);
> }
>
>
>
--
Fabian Frederick <fabf@skynet.be>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info
2014-05-12 18:26 ` Fabian Frederick
@ 2014-05-12 18:29 ` Joe Perches
0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2014-05-12 18:29 UTC (permalink / raw)
To: Fabian Frederick; +Cc: Tejun Heo, linux-kernel, akpm
On Mon, 2014-05-12 at 20:26 +0200, Fabian Frederick wrote:
> On Mon, 12 May 2014 11:21:28 -0700 Joe Perches <joe@perches.com> wrote:
> > On Mon, 2014-05-12 at 19:56 +0200, Fabian Frederick wrote:
[]
> > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
[]
> > > @@ -4548,7 +4548,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task)
> > > probe_kernel_read(desc, worker->desc, sizeof(desc) - 1);
> > >
> > > if (fn || name[0] || desc[0]) {
> > > - printk("%sWorkqueue: %s %pf", log_lvl, name, fn);
> > > + pr_info("%sWorkqueue: %s %pf", log_lvl, name, fn);
> >
> > Not correct.
> >
> > log_lvl already emits the appropriate level
> > and this overrides it with KERN_INFO.
> >
> > The output will now be incorrect emitting
> > at KERN_INFO followed by an SOH and the
> > desired log level.
>
> Such printk can't be converted to pr_ ?
Correct.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-12 18:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 17:56 [PATCH 1/1] kernel/workqueue.c: pr_warning/pr_warn & printk/pr_info Fabian Frederick
2014-05-12 18:01 ` Tejun Heo
2014-05-12 18:21 ` Joe Perches
2014-05-12 18:26 ` Fabian Frederick
2014-05-12 18:29 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®