Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: vagabon.xyz@gmail.com, ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] Remove mfinfo[64] used by get_wchan()
Date: Fri, 18 Aug 2006 09:50:57 +0200	[thread overview]
Message-ID: <44E57161.5060104@innova-card.com> (raw)
In-Reply-To: <20060818.115213.108739385.nemoto@toshiba-tops.co.jp>

Atsushi Nemoto wrote:
> On Thu, 17 Aug 2006 15:57:28 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>> This array was used to 'cache' some frame info about scheduler
>> functions to speed up get_wchan(). This array was 1Ko size and
>> was only used when CONFIG_KALLSYMS was set but declared for all
>> configs.
>>
>> Rather than make the array statement conditional, this patches
>> removes this array and its uses. Indeed the common case doesn't
>> seem to use this array and get_wchan() is not a critical path
>> anyways.
> 
> It looks good basically, but a few fixes are required.
> 
>>  static int __init frame_info_init(void)
>>  {
>> -	int i;
>> +	unsigned long size = 0;
> 
> You must pass some non-zero size even if CONFIG_KALLSYMS was not set.
> Otherwise schedule_mfi will not be initialized as expected.  Actually,
> this is not a problem of this patch, but we missed this point on
> previous cleanups for the get_frame_info()...
> 

or maybe we can just fix get_frame_info() and make it more robust ?

>> +unsigned long get_wchan(struct task_struct *task)
>> +{
>> +	unsigned long stack_page = (unsigned long)task_stack_page(task);
> 
> This should be done after "if (!task ..." check.
> 
>> +	unsigned long pc = 0;
>> +#ifdef CONFIG_KALLSYMS
>> +	unsigned long sp = task->thread.reg29;
> 
> Same.  And you missed one stack level.
> 
> 	sp = task->thread.reg29 + schedule_mfi.frame_size;
> 

Absolutely. I'll cook up a new patch and will send it today.

Thanks

		Franck

  reply	other threads:[~2006-08-18  7:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-17 13:57 [PATCH] Remove mfinfo[64] used by get_wchan() Franck Bui-Huu
2006-08-18  2:52 ` Atsushi Nemoto
2006-08-18  7:50   ` Franck Bui-Huu [this message]
2006-08-18  8:15     ` Atsushi Nemoto
2006-08-18  8:50       ` Franck Bui-Huu
2006-08-18  9:11         ` Atsushi Nemoto
2006-08-18 12:17           ` Franck Bui-Huu
2006-08-18 14:04             ` Atsushi Nemoto
2006-08-18 14:13               ` Franck Bui-Huu
2006-08-18 14:41                 ` Atsushi Nemoto

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=44E57161.5060104@innova-card.com \
    --to=vagabon.xyz@gmail.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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