* [PATCH 1/1] Revert "block: add __init to blkcg_policy_register"
@ 2014-06-21 12:05 Fabian Frederick
2014-06-23 9:35 ` David Rientjes
0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-06-21 12:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Jens Axboe, Damien Wyart, Andrew Morton
This reverts commit a2d445d44000
Adding __init to blkcg_policy_register makes it unreliable when
loading cfq at runtime.
(Similar problem to b5097e956a4d "block: add __init to elv_register"
reported by Damien Wyart).
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Damien Wyart <damien.wyart@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
block/blk-cgroup.c | 2 +-
block/blk-cgroup.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 069bc20..9f5bce3 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(blkcg_deactivate_policy);
* Register @pol with blkcg core. Might sleep and @pol may be modified on
* successful registration. Returns 0 on success and -errno on failure.
*/
-int __init blkcg_policy_register(struct blkcg_policy *pol)
+int blkcg_policy_register(struct blkcg_policy *pol)
{
int i, ret;
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index cbb7f94..d692b29 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -145,7 +145,7 @@ void blkcg_drain_queue(struct request_queue *q);
void blkcg_exit_queue(struct request_queue *q);
/* Blkio controller policy registration */
-int __init blkcg_policy_register(struct blkcg_policy *pol);
+int blkcg_policy_register(struct blkcg_policy *pol);
void blkcg_policy_unregister(struct blkcg_policy *pol);
int blkcg_activate_policy(struct request_queue *q,
const struct blkcg_policy *pol);
@@ -580,7 +580,7 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { ret
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
static inline void blkcg_drain_queue(struct request_queue *q) { }
static inline void blkcg_exit_queue(struct request_queue *q) { }
-static inline int __init blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
+static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
static inline int blkcg_activate_policy(struct request_queue *q,
const struct blkcg_policy *pol) { return 0; }
--
1.8.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] Revert "block: add __init to blkcg_policy_register"
2014-06-21 12:05 [PATCH 1/1] Revert "block: add __init to blkcg_policy_register" Fabian Frederick
@ 2014-06-23 9:35 ` David Rientjes
2014-06-23 15:22 ` Fabian Frederick
0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2014-06-23 9:35 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Jens Axboe, Damien Wyart, Andrew Morton
On Sat, 21 Jun 2014, Fabian Frederick wrote:
> This reverts commit a2d445d44000
>
> Adding __init to blkcg_policy_register makes it unreliable when
> loading cfq at runtime.
>
> (Similar problem to b5097e956a4d "block: add __init to elv_register"
> reported by Damien Wyart).
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Damien Wyart <damien.wyart@gmail.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> block/blk-cgroup.c | 2 +-
> block/blk-cgroup.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 069bc20..9f5bce3 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(blkcg_deactivate_policy);
> * Register @pol with blkcg core. Might sleep and @pol may be modified on
> * successful registration. Returns 0 on success and -errno on failure.
> */
> -int __init blkcg_policy_register(struct blkcg_policy *pol)
> +int blkcg_policy_register(struct blkcg_policy *pol)
> {
> int i, ret;
>
This is the second such revert from you for __init annotations, have you
double checked all the other patches you've sent?
> diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
> index cbb7f94..d692b29 100644
> --- a/block/blk-cgroup.h
> +++ b/block/blk-cgroup.h
> @@ -145,7 +145,7 @@ void blkcg_drain_queue(struct request_queue *q);
> void blkcg_exit_queue(struct request_queue *q);
>
> /* Blkio controller policy registration */
> -int __init blkcg_policy_register(struct blkcg_policy *pol);
> +int blkcg_policy_register(struct blkcg_policy *pol);
> void blkcg_policy_unregister(struct blkcg_policy *pol);
> int blkcg_activate_policy(struct request_queue *q,
> const struct blkcg_policy *pol);
> @@ -580,7 +580,7 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { ret
> static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
> static inline void blkcg_drain_queue(struct request_queue *q) { }
> static inline void blkcg_exit_queue(struct request_queue *q) { }
> -static inline int __init blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
> +static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
Why would you have marked an inline function as __init in the first place?
> static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
> static inline int blkcg_activate_policy(struct request_queue *q,
> const struct blkcg_policy *pol) { return 0; }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] Revert "block: add __init to blkcg_policy_register"
2014-06-23 9:35 ` David Rientjes
@ 2014-06-23 15:22 ` Fabian Frederick
0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2014-06-23 15:22 UTC (permalink / raw)
To: David Rientjes; +Cc: linux-kernel, Jens Axboe, Damien Wyart, Andrew Morton
On Mon, 23 Jun 2014 02:35:09 -0700 (PDT)
David Rientjes <rientjes@google.com> wrote:
> On Sat, 21 Jun 2014, Fabian Frederick wrote:
>
> > This reverts commit a2d445d44000
> >
> > Adding __init to blkcg_policy_register makes it unreliable when
> > loading cfq at runtime.
> >
> > (Similar problem to b5097e956a4d "block: add __init to elv_register"
> > reported by Damien Wyart).
> >
> > Cc: Jens Axboe <axboe@kernel.dk>
> > Cc: Damien Wyart <damien.wyart@gmail.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> > ---
> > block/blk-cgroup.c | 2 +-
> > block/blk-cgroup.h | 4 ++--
> > 2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> > index 069bc20..9f5bce3 100644
> > --- a/block/blk-cgroup.c
> > +++ b/block/blk-cgroup.c
> > @@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(blkcg_deactivate_policy);
> > * Register @pol with blkcg core. Might sleep and @pol may be modified on
> > * successful registration. Returns 0 on success and -errno on failure.
> > */
> > -int __init blkcg_policy_register(struct blkcg_policy *pol)
> > +int blkcg_policy_register(struct blkcg_policy *pol)
> > {
> > int i, ret;
> >
>
> This is the second such revert from you for __init annotations, have you
> double checked all the other patches you've sent?
I received a bug report for elv_register and after looking at my
recent __init patches I found this one with the same problem.
>
> > diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
> > index cbb7f94..d692b29 100644
> > --- a/block/blk-cgroup.h
> > +++ b/block/blk-cgroup.h
> > @@ -145,7 +145,7 @@ void blkcg_drain_queue(struct request_queue *q);
> > void blkcg_exit_queue(struct request_queue *q);
> >
> > /* Blkio controller policy registration */
> > -int __init blkcg_policy_register(struct blkcg_policy *pol);
> > +int blkcg_policy_register(struct blkcg_policy *pol);
> > void blkcg_policy_unregister(struct blkcg_policy *pol);
> > int blkcg_activate_policy(struct request_queue *q,
> > const struct blkcg_policy *pol);
> > @@ -580,7 +580,7 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { ret
> > static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
> > static inline void blkcg_drain_queue(struct request_queue *q) { }
> > static inline void blkcg_exit_queue(struct request_queue *q) { }
> > -static inline int __init blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
> > +static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
>
> Why would you have marked an inline function as __init in the first place?
__init was initially added to mark function in case we remove inline someday as it's only called by __init functions. Problem in this case being it would break external modules.
Fabian
>
> > static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
> > static inline int blkcg_activate_policy(struct request_queue *q,
> > const struct blkcg_policy *pol) { return 0; }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-23 15:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 12:05 [PATCH 1/1] Revert "block: add __init to blkcg_policy_register" Fabian Frederick
2014-06-23 9:35 ` David Rientjes
2014-06-23 15:22 ` Fabian Frederick
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.