From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [BUG?][2.6.25-mm1] sleeping during IRQ disabled
Date: Wed, 07 May 2008 09:05:59 +0000 [thread overview]
Message-ID: <482170F7.2050909@jp.fujitsu.com> (raw)
In-Reply-To: <20080502182440.6E5F.KOSAKI.MOTOHIRO@jp.fujitsu.com>
Oh, wait...
Petr Tesarik wrote:
> On Wed, 2008-05-07 at 09:57 +0900, Hidetoshi Seto wrote:
>>
>> 1160 .work_pending_syscall:
>> 1161 add r2=-8,r2
>> 1162 add r3=-8,r3
>> 1163 ;;
>> 1164 st8 [r2]=r8
>> 1165 st8 [r3]=r10
>> 1166 .work_pending:
>> 1167 tbit.z p6,p0=r31,TIF_NEED_RESCHED // current_thread_info()->need_resched=0?
>> 1168 (p6) br.cond.sptk.few .notify
>> 1169 #ifdef CONFIG_PREEMPT
>> 1170 (pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1
>> 1171 ;;
>> 1172 (pKStk) st4 [r20]=r21
>> 1173 ssm psr.i // enable interrupts
>> 1174 #endif
>>> 1175 br.call.spnt.many rp=schedule
>>> 1176 .ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1
>>> 1177 rsm psr.i // disable interrupts
>>> 1178 ;;
>>> 1179 #ifdef CONFIG_PREEMPT
>>> 1180 (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
>>> 1181 ;;
>>> 1182 (pKStk) st4 [r20]=r0 // preempt_count() <- 0
>>> 1183 #endif
>>> 1184 (pLvSys)br.cond.sptk.few .work_pending_syscall_end
>>> 1185 br.cond.sptk.many .work_processed_kernel // re-check
>>> 1186
>>> 1187 .notify:
>>> 1188 (pUStk) br.call.spnt.many rp=notify_resume_user
>>>
>> AFAIK, we always call notify_resume_user() with interrupts disabled.
>> Is this right?
If I am right, this also means we always call schedule() with interrupts
disabled, when it is required without CONFIG_PREEMPT.
...Doesn't it matter, Tony? I think it is quite strange.
>> Hmm, could you make ia64_sync_kernel_rbs to safe with interrupts
>> disabled, Petr?
>
> No, the point of that function is to copy part of the kernel RBS to user
> RBS. Accesses to user space are always allowed to sleep and there's
> nothing I can do about it (without rewriting the whole memory management
> in Linux from scratch). All I can do is to take the simpler approach
> without TIF_RESTORE_RSE I proposed in the very beginning of the RSE sync
> discussion, but which was then turned down, because Roland warned about
> possible severe performance degradations.
>
> The introduction of TIF_RESTORE_RSE was originally Shaohua's idea, so
> maybe he knows how to do it properly.
>
> BTW why must be interrupts disabled in this path? Would it be possible
> to re-enable them for the duration of the synchronization, or does it
> harm somehow?
Good point.
I'm not sure the reason, but I suppose we can call notify_resume_user()
and schedule() with interrupts enabled. Possibly we must do so.
Thanks,
H.Seto
next prev parent reply other threads:[~2008-05-07 9:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 9:27 [BUG?][2.6.25-mm1] sleeping during IRQ disabled KOSAKI Motohiro
2008-05-02 10:02 ` Petr Tesarik
2008-05-02 22:53 ` Luck, Tony
2008-05-03 7:28 ` KOSAKI Motohiro
2008-05-04 15:47 ` KOSAKI Motohiro
2008-05-05 8:40 ` Petr Tesarik
2008-05-05 15:43 ` Petr Tesarik
2008-05-05 15:48 ` Petr Tesarik
2008-05-05 18:37 ` Luck, Tony
2008-05-06 3:09 ` KOSAKI Motohiro
2008-05-06 3:12 ` KOSAKI Motohiro
2008-05-06 18:25 ` Luck, Tony
2008-05-06 20:03 ` Luck, Tony
2008-05-06 21:41 ` Luck, Tony
2008-05-06 21:54 ` Luck, Tony
2008-05-07 0:57 ` Hidetoshi Seto
2008-05-07 6:59 ` Petr Tesarik
2008-05-07 8:54 ` Shaohua Li
2008-05-07 9:05 ` Hidetoshi Seto [this message]
2008-05-07 9:12 ` Hidetoshi Seto
2008-05-07 18:20 ` Roland McGrath
2008-05-07 21:50 ` Luck, Tony
2008-05-07 23:23 ` Roland McGrath
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=482170F7.2050909@jp.fujitsu.com \
--to=seto.hidetoshi@jp.fujitsu.com \
--cc=linux-ia64@vger.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 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.