All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: adeos-main <adeos-main@gna.org>
Subject: Re: [Adeos-main] [RFC][PATCH] Rework async printk conditions
Date: Sun, 19 Oct 2008 12:46:02 +0200	[thread overview]
Message-ID: <48FB0FEA.4040309@domain.hid> (raw)
In-Reply-To: <48E37266.2040006@domain.hid>

Jan Kiszka wrote:
> Some ad-hoc instrumentation of Xenomai code running over the root domain
> but with the head domain stalled (nklock held) triggered the new
> topmost-stalled warning for me.
> 
> So I reworked the condition for doing async (ipipe-buffered) printk as
> follows:
>  no oops in progress AND
>  domain did not request sync printk AND
>  (domain != root OR
>    (domain == root AND some higher domain stalled))
> 
> Makes sense?
>

Yes it does. Merged, thanks.

> Jan
> 
> ---
>  kernel/printk.c |   24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)
> 
> Index: b/kernel/printk.c
> ===================================================================
> --- a/kernel/printk.c
> +++ b/kernel/printk.c
> @@ -641,17 +641,33 @@ void __ipipe_flush_printk (unsigned virq
>  
>  asmlinkage int printk(const char *fmt, ...)
>  {
> -  	int r, fbytes, oldcount, cs = -1;
> -    	unsigned long flags;
> +	int r, fbytes, oldcount;
> +	int sprintk = 1;
> +	int cs = -1;
> +	unsigned long flags;
>  	va_list args;
>  
>  	va_start(args, fmt);
>  
> -	if (test_bit(IPIPE_SPRINTK_FLAG,&ipipe_current_domain->flags) ||
> +	if (test_bit(IPIPE_SPRINTK_FLAG, &ipipe_current_domain->flags) ||
>  	    oops_in_progress)
>  		cs = ipipe_disable_context_check(ipipe_processor_id());
> +	else if (ipipe_current_domain == ipipe_root_domain) {
> +		struct ipipe_domain *dom;
>  
> -	if (ipipe_current_domain == ipipe_root_domain || cs != -1) {
> +		local_irq_save_hw(flags);
> +		list_for_each_entry(dom, &__ipipe_pipeline, p_link) {
> +			if (dom == ipipe_root_domain)
> +				break;
> +			if (test_bit(IPIPE_STALL_FLAG,
> +				     &ipipe_cpudom_var(dom, status)))
> +				sprintk = 0;
> +		}
> +		local_irq_restore_hw(flags);
> +	} else
> +		sprintk = 0;
> +
> +	if (sprintk) {
>  		r = vprintk(fmt, args);
>  		if (cs != -1)
>  			ipipe_restore_context_check(ipipe_processor_id(), cs);
> 
> _______________________________________________
> Adeos-main mailing list
> Adeos-main@domain.hid
> https://mail.gna.org/listinfo/adeos-main
> 


-- 
Philippe.


      reply	other threads:[~2008-10-19 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 12:51 [Adeos-main] [RFC][PATCH] Rework async printk conditions Jan Kiszka
2008-10-19 10:46 ` Philippe Gerum [this message]

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=48FB0FEA.4040309@domain.hid \
    --to=rpm@xenomai.org \
    --cc=adeos-main@gna.org \
    --cc=jan.kiszka@domain.hid \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.