Re: [PATCH 2/3] mm, compaction: cover all compaction mode in compact_zone

From: Vlastimil Babka
Date: Tue Mar 08 2016 - 09:22:24 EST


On 03/08/2016 02:42 PM, Michal Hocko wrote:
> From: Michal Hocko <mhocko@xxxxxxxx>
>
> the compiler is complaining after "mm, compaction: change COMPACT_
> constants into enum"

Potentially a squash into that patch then?

> mm/compaction.c: In function âcompact_zoneâ:
> mm/compaction.c:1350:2: warning: enumeration value âCOMPACT_DEFERREDâ not handled in switch [-Wswitch]
> switch (ret) {
> ^
> mm/compaction.c:1350:2: warning: enumeration value âCOMPACT_COMPLETEâ not handled in switch [-Wswitch]
> mm/compaction.c:1350:2: warning: enumeration value âCOMPACT_NO_SUITABLE_PAGEâ not handled in switch [-Wswitch]
> mm/compaction.c:1350:2: warning: enumeration value âCOMPACT_NOT_SUITABLE_ZONEâ not handled in switch [-Wswitch]
> mm/compaction.c:1350:2: warning: enumeration value âCOMPACT_CONTENDEDâ not handled in switch [-Wswitch]
>
> compaction_suitable is allowed to return only COMPACT_PARTIAL,
> COMPACT_SKIPPED and COMPACT_CONTINUE so other cases are simply
> impossible. Put a VM_BUG_ON to catch an impossible return value.
>
> Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>