lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 19/49] writeback: add @gfp to wb_init()
On Mon 06-04-15 15:58:08, Tejun Heo wrote:
> wb_init() currently always uses GFP_KERNEL but the planned cgroup
> writeback support needs using other allocation masks. Add @gfp to
> wb_init().
>
> This patch doesn't introduce any behavior changes.
OK.
Reviewed-by: Jan Kara <jack@suse.cz>

Honza

>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Jan Kara <jack@suse.cz>
> ---
> mm/backing-dev.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index b0707d1..805b287 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -291,7 +291,8 @@ void wb_wakeup_delayed(struct bdi_writeback *wb)
> */
> #define INIT_BW (100 << (20 - PAGE_SHIFT))
>
> -static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi)
> +static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
> + gfp_t gfp)
> {
> int i, err;
>
> @@ -315,12 +316,12 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi)
> INIT_LIST_HEAD(&wb->work_list);
> INIT_DELAYED_WORK(&wb->dwork, wb_workfn);
>
> - err = fprop_local_init_percpu(&wb->completions, GFP_KERNEL);
> + err = fprop_local_init_percpu(&wb->completions, gfp);
> if (err)
> return err;
>
> for (i = 0; i < NR_WB_STAT_ITEMS; i++) {
> - err = percpu_counter_init(&wb->stat[i], 0, GFP_KERNEL);
> + err = percpu_counter_init(&wb->stat[i], 0, gfp);
> if (err) {
> while (--i)
> percpu_counter_destroy(&wb->stat[i]);
> @@ -378,7 +379,7 @@ int bdi_init(struct backing_dev_info *bdi)
> bdi->max_prop_frac = FPROP_FRAC_BASE;
> INIT_LIST_HEAD(&bdi->bdi_list);
>
> - err = wb_init(&bdi->wb, bdi);
> + err = wb_init(&bdi->wb, bdi, GFP_KERNEL);
> if (err)
> return err;
>
> --
> 2.1.0
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR


\
 
 \ /
  Last update: 2015-04-20 18:21    [W:0.236 / U:1.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site