Re: [RFC PATCH 2/8] mm/madvise: remove unnecessary check on madvise_dontneed_free()

From: Kirill A. Shutemov
Date: Mon Sep 27 2021 - 05:11:49 EST


On Sun, Sep 26, 2021 at 09:12:53AM -0700, Nadav Amit wrote:
> From: Nadav Amit <namit@xxxxxxxxxx>
>
> madvise_dontneed_free() is called only from madvise_vma() and the
> behavior is always either MADV_FREE or MADV_DONTNEED. There is no need
> to check again in madvise_dontneed_free() if the behavior is any
> different.

So what. The check is free. Compiler should be clever enough to eliminate
the additional check. If there's a new MADV_DONTNEED flavour, the change
would have to be effectively reverted.

NAK.

--
Kirill A. Shutemov