lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 28 May 2021 14:08:53 +0200 (CEST)
From:   torvic9@...lbox.org
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Cc:     "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: [Question] mm/vmpressure.c: ilog2 calculation in constant

Hello,

in mm/vmpressure.c, we have defined this constant:

  static const unsigned int vmpressure_level_critical_prio = ilog2(100 / 10);

My question is: Why do we calculate ilog2 instead of simply setting the constant to '3'?
Then, I guess, we could also get rid of the log2.h include.
Note that this is just a question, not a request, as I'm sure there is a reason for this.
(given the help text in the comment just above)

Greetings,
Tor Vic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ