* [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
@ 2011-08-16 19:08 Oleg Nesterov
2011-08-16 19:17 ` Benjamin Herrenschmidt
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Oleg Nesterov @ 2011-08-16 19:08 UTC (permalink / raw)
To: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Linas Vepstas
Cc: Matt Fleming, Tejun Heo, linux-kernel
daemonize() is only needed when a user-space task does kernel_thread().
eeh_event_handler() thread is created by the worker kthread, and thus
it doesn't need the soon-to-be-deprecated daemonize().
Note: looks like eeh_event_wq can be static and it can do all work
itself without kernel_thread().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
arch/powerpc/platforms/pseries/eeh_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 3.1/arch/powerpc/platforms/pseries/eeh_event.c~3_daemonize_eeh 2011-04-06 21:33:42.000000000 +0200
+++ 3.1/arch/powerpc/platforms/pseries/eeh_event.c 2011-08-16 21:03:56.000000000 +0200
@@ -60,7 +60,7 @@ static int eeh_event_handler(void * dumm
struct eeh_event *event;
struct pci_dn *pdn;
- daemonize ("eehd");
+ set_task_comm(current, "eehd");
set_current_state(TASK_INTERRUPTIBLE);
spin_lock_irqsave(&eeh_eventlist_lock, flags);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:08 [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize() Oleg Nesterov
@ 2011-08-16 19:17 ` Benjamin Herrenschmidt
2011-08-16 19:24 ` Linas Vepstas
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2011-08-16 19:17 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Paul Mackerras, Linas Vepstas, Matt Fleming,
Tejun Heo, linux-kernel
On Tue, 2011-08-16 at 21:08 +0200, Oleg Nesterov wrote:
> daemonize() is only needed when a user-space task does kernel_thread().
>
> eeh_event_handler() thread is created by the worker kthread, and thus
> it doesn't need the soon-to-be-deprecated daemonize().
>
> Note: looks like eeh_event_wq can be static and it can do all work
> itself without kernel_thread().
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
Right, but don't bother cleaning that code too much tho :-) I'm quite
close to reworking/refactoring most of it anyways.
Cheers,
Ben.
> arch/powerpc/platforms/pseries/eeh_event.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- 3.1/arch/powerpc/platforms/pseries/eeh_event.c~3_daemonize_eeh 2011-04-06 21:33:42.000000000 +0200
> +++ 3.1/arch/powerpc/platforms/pseries/eeh_event.c 2011-08-16 21:03:56.000000000 +0200
> @@ -60,7 +60,7 @@ static int eeh_event_handler(void * dumm
> struct eeh_event *event;
> struct pci_dn *pdn;
>
> - daemonize ("eehd");
> + set_task_comm(current, "eehd");
> set_current_state(TASK_INTERRUPTIBLE);
>
> spin_lock_irqsave(&eeh_eventlist_lock, flags);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:08 [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize() Oleg Nesterov
2011-08-16 19:17 ` Benjamin Herrenschmidt
@ 2011-08-16 19:24 ` Linas Vepstas
2011-08-16 19:29 ` Tejun Heo
2011-08-16 19:26 ` Tejun Heo
2011-08-16 21:27 ` Matt Fleming
3 siblings, 1 reply; 9+ messages in thread
From: Linas Vepstas @ 2011-08-16 19:24 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Matt Fleming, Tejun Heo, linux-kernel
On 16 August 2011 14:08, Oleg Nesterov <oleg@redhat.com> wrote:
> daemonize() is only needed when a user-space task does kernel_thread().
>
> eeh_event_handler() thread is created by the worker kthread, and thus
> it doesn't need the soon-to-be-deprecated daemonize().
>
> Note: looks like eeh_event_wq can be static and it can do all work
> itself without kernel_thread().
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
I've not been following the deprecation of daemonize(), so I presume
that the suggested change is indeed appropriate.
As to the kernel thread, realize that the eeh recovery proceedure
can take many seconds, or in certain pathological situations, it
can hang (e.g. if a sata controller dies and fails to recover when
there's a mounted file system on it ..)
so, given that, I'll just say:
Acked-by: Linas Vepstas <linasvepstas@gmail.com>
BTW, if someone wants to tackle a big, difficult project, one would be
to untangle the mess that happens when the hardware underneath an
active block device dies. Currently, the kernel will deadlock in
umpteen zillion places waiting for blocks and files that will never
arrive.
--linas
> ---
>
> arch/powerpc/platforms/pseries/eeh_event.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- 3.1/arch/powerpc/platforms/pseries/eeh_event.c~3_daemonize_eeh 2011-04-06 21:33:42.000000000 +0200
> +++ 3.1/arch/powerpc/platforms/pseries/eeh_event.c 2011-08-16 21:03:56.000000000 +0200
> @@ -60,7 +60,7 @@ static int eeh_event_handler(void * dumm
> struct eeh_event *event;
> struct pci_dn *pdn;
>
> - daemonize ("eehd");
> + set_task_comm(current, "eehd");
> set_current_state(TASK_INTERRUPTIBLE);
>
> spin_lock_irqsave(&eeh_eventlist_lock, flags);
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:08 [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize() Oleg Nesterov
2011-08-16 19:17 ` Benjamin Herrenschmidt
2011-08-16 19:24 ` Linas Vepstas
@ 2011-08-16 19:26 ` Tejun Heo
2011-08-17 17:27 ` Oleg Nesterov
2011-08-16 21:27 ` Matt Fleming
3 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2011-08-16 19:26 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Linas Vepstas, Matt Fleming, linux-kernel
On Tue, Aug 16, 2011 at 09:08:58PM +0200, Oleg Nesterov wrote:
> daemonize() is only needed when a user-space task does kernel_thread().
>
> eeh_event_handler() thread is created by the worker kthread, and thus
> it doesn't need the soon-to-be-deprecated daemonize().
>
> Note: looks like eeh_event_wq can be static and it can do all work
> itself without kernel_thread().
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Yeay! Nice series. How do you wanna route these? Through -mm?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:24 ` Linas Vepstas
@ 2011-08-16 19:29 ` Tejun Heo
2011-08-16 21:38 ` Linas Vepstas
0 siblings, 1 reply; 9+ messages in thread
From: Tejun Heo @ 2011-08-16 19:29 UTC (permalink / raw)
To: Linas Vepstas
Cc: Oleg Nesterov, Andrew Morton, Benjamin Herrenschmidt,
Paul Mackerras, Matt Fleming, linux-kernel
Hello,
On Tue, Aug 16, 2011 at 02:24:12PM -0500, Linas Vepstas wrote:
> BTW, if someone wants to tackle a big, difficult project, one would be
> to untangle the mess that happens when the hardware underneath an
> active block device dies. Currently, the kernel will deadlock in
> umpteen zillion places waiting for blocks and files that will never
> arrive.
Umm... that has been working fine for SCSI and ATA for years now.
Just aborting pending commands and freeing the device should do it.
Drivers need to take care of driver specific resources (per-req and
per-dev) but that's not different from aborting timed out commands.
What's missing for your use case?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:08 [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize() Oleg Nesterov
` (2 preceding siblings ...)
2011-08-16 19:26 ` Tejun Heo
@ 2011-08-16 21:27 ` Matt Fleming
3 siblings, 0 replies; 9+ messages in thread
From: Matt Fleming @ 2011-08-16 21:27 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Linas Vepstas, Tejun Heo, linux-kernel
On Tue, 2011-08-16 at 21:08 +0200, Oleg Nesterov wrote:
> daemonize() is only needed when a user-space task does kernel_thread().
>
> eeh_event_handler() thread is created by the worker kthread, and thus
> it doesn't need the soon-to-be-deprecated daemonize().
>
> Note: looks like eeh_event_wq can be static and it can do all work
> itself without kernel_thread().
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Matt Fleming <matt.fleming@intel.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:29 ` Tejun Heo
@ 2011-08-16 21:38 ` Linas Vepstas
0 siblings, 0 replies; 9+ messages in thread
From: Linas Vepstas @ 2011-08-16 21:38 UTC (permalink / raw)
To: Tejun Heo
Cc: Oleg Nesterov, Andrew Morton, Benjamin Herrenschmidt,
Paul Mackerras, Matt Fleming, linux-kernel
On 16 August 2011 14:29, Tejun Heo <tj@kernel.org> wrote:
> Hello,
>
> On Tue, Aug 16, 2011 at 02:24:12PM -0500, Linas Vepstas wrote:
>> BTW, if someone wants to tackle a big, difficult project, one would be
>> to untangle the mess that happens when the hardware underneath an
>> active block device dies. Currently, the kernel will deadlock in
>> umpteen zillion places waiting for blocks and files that will never
>> arrive.
>
> Umm... that has been working fine for SCSI and ATA for years now.
> Just aborting pending commands and freeing the device should do it.
> Drivers need to take care of driver specific resources (per-req and
> per-dev) but that's not different from aborting timed out commands.
> What's missing for your use case?
Sorry, I guess I'm out-of-date; its been far more than a few years since
I last tried this :-) The use case was eeh recovery, where the hardware was
so hosed that it wouldn't recover. The test cases were whatever it was that
the test team could throw at the system.
--linas
--linas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-16 19:26 ` Tejun Heo
@ 2011-08-17 17:27 ` Oleg Nesterov
2011-08-18 7:34 ` Tejun Heo
0 siblings, 1 reply; 9+ messages in thread
From: Oleg Nesterov @ 2011-08-17 17:27 UTC (permalink / raw)
To: Tejun Heo
Cc: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Linas Vepstas, Matt Fleming, linux-kernel
On 08/16, Tejun Heo wrote:
>
> On Tue, Aug 16, 2011 at 09:08:58PM +0200, Oleg Nesterov wrote:
> > daemonize() is only needed when a user-space task does kernel_thread().
> >
> > eeh_event_handler() thread is created by the worker kthread, and thus
> > it doesn't need the soon-to-be-deprecated daemonize().
> >
> > Note: looks like eeh_event_wq can be static and it can do all work
> > itself without kernel_thread().
> >
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
> How do you wanna route these? Through -mm?
Oh, I don't know. -mm, or probably maintainers can pick them.
They don't depend on each other.
Btw. Perhaps we should kill CLONE_KERNEL? And note that the only
user is eeh_thread_launcher().
The problem is, CLONE_KERNEL looks as "use me if you want to create
a kernel thread". But CLONE_SIGHAND means the kernel thread should
not play with signals, and this is not obvious.
Oleg.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize()
2011-08-17 17:27 ` Oleg Nesterov
@ 2011-08-18 7:34 ` Tejun Heo
0 siblings, 0 replies; 9+ messages in thread
From: Tejun Heo @ 2011-08-18 7:34 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Linas Vepstas, Matt Fleming, linux-kernel
Hello,
On Wed, Aug 17, 2011 at 07:27:13PM +0200, Oleg Nesterov wrote:
> Btw. Perhaps we should kill CLONE_KERNEL? And note that the only
> user is eeh_thread_launcher().
>
> The problem is, CLONE_KERNEL looks as "use me if you want to create
> a kernel thread". But CLONE_SIGHAND means the kernel thread should
> not play with signals, and this is not obvious.
I guess it predates kthread(). There's no reason to use
kernel_thread() directly outside of a few core places, so removing it
sounds like a pretty good idea.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-08-18 7:35 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-16 19:08 [PATCH] powerpc/eeh: remove eeh_event_handler()->daemonize() Oleg Nesterov
2011-08-16 19:17 ` Benjamin Herrenschmidt
2011-08-16 19:24 ` Linas Vepstas
2011-08-16 19:29 ` Tejun Heo
2011-08-16 21:38 ` Linas Vepstas
2011-08-16 19:26 ` Tejun Heo
2011-08-17 17:27 ` Oleg Nesterov
2011-08-18 7:34 ` Tejun Heo
2011-08-16 21:27 ` Matt Fleming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox