mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PM: save 8bytes in 'struct dev_pm_info'
@ 2012-08-07  2:57 Ming Lei
  2012-08-07 11:27 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2012-08-07  2:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-kernel, linux-pm, Ming Lei

On ARMv7, sizeof(struct dev_pm_info) becomes 344Bytes from 352Bytes
after applying the patch which only changes fields' order, so we can
save 8bytes per device. Nothing in behaviour changed.

GCC: gcc version 4.5.1

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 include/linux/pm.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index f067e60..f116d40 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -505,11 +505,6 @@ struct pm_subsys_data {
 
 struct dev_pm_info {
 	pm_message_t		power_state;
-	unsigned int		can_wakeup:1;
-	unsigned int		async_suspend:1;
-	bool			is_prepared:1;	/* Owned by the PM core */
-	bool			is_suspended:1;	/* Ditto */
-	bool			ignore_children:1;
 	spinlock_t		lock;
 #ifdef CONFIG_PM_SLEEP
 	struct list_head	entry;
@@ -519,13 +514,12 @@ struct dev_pm_info {
 #else
 	unsigned int		should_wakeup:1;
 #endif
+	unsigned int		can_wakeup:1;
+	unsigned int		async_suspend:1;
+	bool			is_prepared:1;	/* Owned by the PM core */
+	bool			is_suspended:1;	/* Ditto */
+	bool			ignore_children:1;
 #ifdef CONFIG_PM_RUNTIME
-	struct timer_list	suspend_timer;
-	unsigned long		timer_expires;
-	struct work_struct	work;
-	wait_queue_head_t	wait_queue;
-	atomic_t		usage_count;
-	atomic_t		child_count;
 	unsigned int		disable_depth:3;
 	unsigned int		idle_notification:1;
 	unsigned int		request_pending:1;
@@ -538,6 +532,12 @@ struct dev_pm_info {
 	unsigned int		timer_autosuspends:1;
 	enum rpm_request	request;
 	enum rpm_status		runtime_status;
+	struct timer_list	suspend_timer;
+	unsigned long		timer_expires;
+	struct work_struct	work;
+	wait_queue_head_t	wait_queue;
+	atomic_t		usage_count;
+	atomic_t		child_count;
 	int			runtime_error;
 	int			autosuspend_delay;
 	unsigned long		last_busy;
-- 
1.7.9.5


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

* Re: [PATCH] PM: save 8bytes in 'struct dev_pm_info'
  2012-08-07  2:57 [PATCH] PM: save 8bytes in 'struct dev_pm_info' Ming Lei
@ 2012-08-07 11:27 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2012-08-07 11:27 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-kernel, linux-pm

On Tuesday, August 07, 2012, Ming Lei wrote:
> On ARMv7, sizeof(struct dev_pm_info) becomes 344Bytes from 352Bytes
> after applying the patch which only changes fields' order, so we can
> save 8bytes per device. Nothing in behaviour changed.
> 
> GCC: gcc version 4.5.1
> 
> Signed-off-by: Ming Lei <ming.lei@canonical.com>

While I have no fundamental objections against this patch, I see that it
will conflict with some other patches changing struct dev_pm_info.

For this reason, if I apply it at all, I'll do that when my pull request for
v3.7 is practically ready.

Thanks,
Rafael


> ---
>  include/linux/pm.h |   22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index f067e60..f116d40 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -505,11 +505,6 @@ struct pm_subsys_data {
>  
>  struct dev_pm_info {
>  	pm_message_t		power_state;
> -	unsigned int		can_wakeup:1;
> -	unsigned int		async_suspend:1;
> -	bool			is_prepared:1;	/* Owned by the PM core */
> -	bool			is_suspended:1;	/* Ditto */
> -	bool			ignore_children:1;
>  	spinlock_t		lock;
>  #ifdef CONFIG_PM_SLEEP
>  	struct list_head	entry;
> @@ -519,13 +514,12 @@ struct dev_pm_info {
>  #else
>  	unsigned int		should_wakeup:1;
>  #endif
> +	unsigned int		can_wakeup:1;
> +	unsigned int		async_suspend:1;
> +	bool			is_prepared:1;	/* Owned by the PM core */
> +	bool			is_suspended:1;	/* Ditto */
> +	bool			ignore_children:1;
>  #ifdef CONFIG_PM_RUNTIME
> -	struct timer_list	suspend_timer;
> -	unsigned long		timer_expires;
> -	struct work_struct	work;
> -	wait_queue_head_t	wait_queue;
> -	atomic_t		usage_count;
> -	atomic_t		child_count;
>  	unsigned int		disable_depth:3;
>  	unsigned int		idle_notification:1;
>  	unsigned int		request_pending:1;
> @@ -538,6 +532,12 @@ struct dev_pm_info {
>  	unsigned int		timer_autosuspends:1;
>  	enum rpm_request	request;
>  	enum rpm_status		runtime_status;
> +	struct timer_list	suspend_timer;
> +	unsigned long		timer_expires;
> +	struct work_struct	work;
> +	wait_queue_head_t	wait_queue;
> +	atomic_t		usage_count;
> +	atomic_t		child_count;
>  	int			runtime_error;
>  	int			autosuspend_delay;
>  	unsigned long		last_busy;
> 


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

end of thread, other threads:[~2012-08-07 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  2:57 [PATCH] PM: save 8bytes in 'struct dev_pm_info' Ming Lei
2012-08-07 11:27 ` Rafael J. Wysocki

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®