Re: [GIT PULL] Cgroup writeback support for 4.2

From: Geert Uytterhoeven
Date: Fri Jun 26 2015 - 05:50:20 EST


On Thu, Jun 25, 2015 at 4:44 PM, Jens Axboe <axboe@xxxxxx> wrote:
> This is the big pull request for adding cgroup writeback support. This
> code has been in development for a long time, and it has been simmering
> in for-next for a good chunk of this cycle too. This is one of those
> problems that has been talked about for at least half a decade, finally
> there's a solution and code to go with it.

Spoiler for TLDR: These are all false positives.

If CONFIG_CGROUP_WRITEBACK=n:

mm/page-writeback.c: In function âbalance_dirty_pages_ratelimitedâ:
mm/page-writeback.c:1574: warning: âwritebackâ is used
uninitialized in this function

In this case, mem_cgroup_wb_stats() is a dummy function that doesn't
write to its output parameters, hence writeback will contain arbitrary data.

There's another call too mem_cgroup_wb_stats() in
wb_over_bg_thresh() where my gcc 4.1.2 didn't warn, where it probably
deduced that mdtc will always be NULL, and the branch thus never taken.

Regardless of CONFIG_CGROUP_WRITEBACK:

mm/page-writeback.c: In function âbalance_dirty_pages_ratelimitedâ:
mm/page-writeback.c:1537: warning: âm_bg_threshâ may be used
uninitialized in this function
mm/page-writeback.c:1537: warning: âm_threshâ may be used
uninitialized in this function
mm/page-writeback.c:1537: warning: âm_dirtyâ may be used
uninitialized in this function

But these are false positives too, due to the many tests on mdtc or !mdtc,
and the creative use of dummy *_INIT() macros and mdtc_valid() static inline
functions.
I suggest refactoring this code to make it less fragile, though.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/