aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2016-08-11 18:33:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-11 19:58:14 -0400
commitbcbf0d566b6e59a6e873bfe415cc415111a819e2 (patch)
treebc511c93dbfc9ff2cfca6ca4fc699c9b002d44b4 /mm
parent615d66c37c755c49ce022c9e5ac0875d27d2603d (diff)
kasan: remove the unnecessary WARN_ONCE from quarantine.c
It's quite unlikely that the user will so little memory that the per-CPU quarantines won't fit into the given fraction of the available memory. Even in that case he won't be able to do anything with the information given in the warning. Link: http://lkml.kernel.org/r/1470929182-101413-1-git-send-email-glider@google.com Signed-off-by: Alexander Potapenko <glider@google.com> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Andrey Konovalov <adech.fo@gmail.com> Cc: Christoph Lameter <cl@linux.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Kuthonuzo Luruo <kuthonuzo.luruo@hpe.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/kasan/quarantine.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
index b6728a33a4ac..baabaad4a4aa 100644
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@ -217,11 +217,8 @@ void quarantine_reduce(void)
217 new_quarantine_size = (READ_ONCE(totalram_pages) << PAGE_SHIFT) / 217 new_quarantine_size = (READ_ONCE(totalram_pages) << PAGE_SHIFT) /
218 QUARANTINE_FRACTION; 218 QUARANTINE_FRACTION;
219 percpu_quarantines = QUARANTINE_PERCPU_SIZE * num_online_cpus(); 219 percpu_quarantines = QUARANTINE_PERCPU_SIZE * num_online_cpus();
220 if (WARN_ONCE(new_quarantine_size < percpu_quarantines, 220 new_quarantine_size = (new_quarantine_size < percpu_quarantines) ?
221 "Too little memory, disabling global KASAN quarantine.\n")) 221 0 : new_quarantine_size - percpu_quarantines;
222 new_quarantine_size = 0;
223 else
224 new_quarantine_size -= percpu_quarantines;
225 WRITE_ONCE(quarantine_size, new_quarantine_size); 222 WRITE_ONCE(quarantine_size, new_quarantine_size);
226 223
227 last = global_quarantine.head; 224 last = global_quarantine.head;