mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] ipc,sem: use current->state helpers
@ 2015-01-15  6:59 Davidlohr Bueso
  2015-01-15  6:59 ` [PATCH 2/3] jbd: drop jbd_ENOSYS debug Davidlohr Bueso
  2015-01-15  6:59 ` [PATCH 3/3] signal: use current->state helpers Davidlohr Bueso
  0 siblings, 2 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2015-01-15  6:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Davidlohr Bueso, Davidlohr Bueso

Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping
track of who changed the state.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 ipc/sem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/sem.c b/ipc/sem.c
index 6115146..9284211 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1941,7 +1941,7 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
 	queue.sleeper = current;
 
 sleep_again:
-	current->state = TASK_INTERRUPTIBLE;
+	__set_current_state(TASK_INTERRUPTIBLE);
 	sem_unlock(sma, locknum);
 	rcu_read_unlock();
 
-- 
2.1.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] jbd: drop jbd_ENOSYS debug
  2015-01-15  6:59 [PATCH 1/3] ipc,sem: use current->state helpers Davidlohr Bueso
@ 2015-01-15  6:59 ` Davidlohr Bueso
  2015-01-15  9:34   ` Jan Kara
  2015-01-15  6:59 ` [PATCH 3/3] signal: use current->state helpers Davidlohr Bueso
  1 sibling, 1 reply; 5+ messages in thread
From: Davidlohr Bueso @ 2015-01-15  6:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Davidlohr Bueso, Jan Kara, Davidlohr Bueso

A quick search shows that there are no users, drop the
macro for both jbd and jbd2.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Jan Kara <jack@suse.cz>
---
My goal here was to just change how we set current state, however
I realized that the function is not used.

 include/linux/jbd.h  | 9 ---------
 include/linux/jbd2.h | 9 ---------
 2 files changed, 18 deletions(-)

diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 31229e0..d326152 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -956,15 +956,6 @@ void __log_wait_for_space(journal_t *journal);
 extern void	__journal_drop_transaction(journal_t *, transaction_t *);
 extern int	cleanup_journal_tail(journal_t *);
 
-/* Debugging code only: */
-
-#define jbd_ENOSYS() \
-do {								           \
-	printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
-	current->state = TASK_UNINTERRUPTIBLE;			           \
-	schedule();						           \
-} while (1)
-
 /*
  * is_journal_abort
  *
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 704b9a5..20e7f78 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1251,15 +1251,6 @@ void __jbd2_log_wait_for_space(journal_t *journal);
 extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *);
 extern int jbd2_cleanup_journal_tail(journal_t *);
 
-/* Debugging code only: */
-
-#define jbd_ENOSYS() \
-do {								           \
-	printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
-	current->state = TASK_UNINTERRUPTIBLE;			           \
-	schedule();						           \
-} while (1)
-
 /*
  * is_journal_abort
  *
-- 
2.1.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] signal: use current->state helpers
  2015-01-15  6:59 [PATCH 1/3] ipc,sem: use current->state helpers Davidlohr Bueso
  2015-01-15  6:59 ` [PATCH 2/3] jbd: drop jbd_ENOSYS debug Davidlohr Bueso
@ 2015-01-15  6:59 ` Davidlohr Bueso
  2015-01-15 19:43   ` Oleg Nesterov
  1 sibling, 1 reply; 5+ messages in thread
From: Davidlohr Bueso @ 2015-01-15  6:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Davidlohr Bueso, Oleg Nesterov, Davidlohr Bueso

Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping
track of who changed the state.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Oleg Nesterov <oleg@redhat.com>
---
 kernel/signal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 33a5275..a390499 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
 SYSCALL_DEFINE0(pause)
 {
 	while (!signal_pending(current)) {
-		current->state = TASK_INTERRUPTIBLE;
+		__set_current_state(TASK_INTERRUPTIBLE);
 		schedule();
 	}
 	return -ERESTARTNOHAND;
@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set)
 	current->saved_sigmask = current->blocked;
 	set_current_blocked(set);
 
-	current->state = TASK_INTERRUPTIBLE;
+	__set_current_state(TASK_INTERRUPTIBLE);
 	schedule();
 	set_restore_sigmask();
 	return -ERESTARTNOHAND;
-- 
2.1.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] jbd: drop jbd_ENOSYS debug
  2015-01-15  6:59 ` [PATCH 2/3] jbd: drop jbd_ENOSYS debug Davidlohr Bueso
@ 2015-01-15  9:34   ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2015-01-15  9:34 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Andrew Morton, linux-kernel, Jan Kara, Davidlohr Bueso

On Wed 14-01-15 22:59:13, Davidlohr Bueso wrote:
> A quick search shows that there are no users, drop the
> macro for both jbd and jbd2.
> 
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> Cc: Jan Kara <jack@suse.cz>
  Thanks. I've added the patch to my tree.

								Honza

> ---
> My goal here was to just change how we set current state, however
> I realized that the function is not used.
> 
>  include/linux/jbd.h  | 9 ---------
>  include/linux/jbd2.h | 9 ---------
>  2 files changed, 18 deletions(-)
> 
> diff --git a/include/linux/jbd.h b/include/linux/jbd.h
> index 31229e0..d326152 100644
> --- a/include/linux/jbd.h
> +++ b/include/linux/jbd.h
> @@ -956,15 +956,6 @@ void __log_wait_for_space(journal_t *journal);
>  extern void	__journal_drop_transaction(journal_t *, transaction_t *);
>  extern int	cleanup_journal_tail(journal_t *);
>  
> -/* Debugging code only: */
> -
> -#define jbd_ENOSYS() \
> -do {								           \
> -	printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
> -	current->state = TASK_UNINTERRUPTIBLE;			           \
> -	schedule();						           \
> -} while (1)
> -
>  /*
>   * is_journal_abort
>   *
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index 704b9a5..20e7f78 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1251,15 +1251,6 @@ void __jbd2_log_wait_for_space(journal_t *journal);
>  extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *);
>  extern int jbd2_cleanup_journal_tail(journal_t *);
>  
> -/* Debugging code only: */
> -
> -#define jbd_ENOSYS() \
> -do {								           \
> -	printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
> -	current->state = TASK_UNINTERRUPTIBLE;			           \
> -	schedule();						           \
> -} while (1)
> -
>  /*
>   * is_journal_abort
>   *
> -- 
> 2.1.2
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] signal: use current->state helpers
  2015-01-15  6:59 ` [PATCH 3/3] signal: use current->state helpers Davidlohr Bueso
@ 2015-01-15 19:43   ` Oleg Nesterov
  0 siblings, 0 replies; 5+ messages in thread
From: Oleg Nesterov @ 2015-01-15 19:43 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Andrew Morton, linux-kernel, Davidlohr Bueso

On 01/14, Davidlohr Bueso wrote:
>
> Call __set_current_state() instead of assigning the new state directly.
> These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping
> track of who changed the state.

Acked-by: Oleg Nesterov <oleg@redhat.com>

> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> Cc: Oleg Nesterov <oleg@redhat.com>
> ---
>  kernel/signal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 33a5275..a390499 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
>  SYSCALL_DEFINE0(pause)
>  {
>  	while (!signal_pending(current)) {
> -		current->state = TASK_INTERRUPTIBLE;
> +		__set_current_state(TASK_INTERRUPTIBLE);
>  		schedule();
>  	}
>  	return -ERESTARTNOHAND;
> @@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set)
>  	current->saved_sigmask = current->blocked;
>  	set_current_blocked(set);
>  
> -	current->state = TASK_INTERRUPTIBLE;
> +	__set_current_state(TASK_INTERRUPTIBLE);
>  	schedule();
>  	set_restore_sigmask();
>  	return -ERESTARTNOHAND;
> -- 
> 2.1.2
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-15 19:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-15  6:59 [PATCH 1/3] ipc,sem: use current->state helpers Davidlohr Bueso
2015-01-15  6:59 ` [PATCH 2/3] jbd: drop jbd_ENOSYS debug Davidlohr Bueso
2015-01-15  9:34   ` Jan Kara
2015-01-15  6:59 ` [PATCH 3/3] signal: use current->state helpers Davidlohr Bueso
2015-01-15 19:43   ` Oleg Nesterov

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®