From: Lucian Grijincu Date: Wed, 16 Nov 2016 04:24:38 +0000 (-0800) Subject: folly: MemoryMapping: less verbose warning on TRY_LOCK+ENOMEM failures X-Git-Tag: v2016.11.21.00~28 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9cb38044deb22632fafcf7e89a15484d43ca823f;p=folly.git folly: MemoryMapping: less verbose warning on TRY_LOCK+ENOMEM failures Reviewed By: philippv Differential Revision: D4184097 fbshipit-source-id: 2f1f82b845528fea4667af612c92c348f8d9ec25 --- diff --git a/folly/MemoryMapping.cpp b/folly/MemoryMapping.cpp index bc094d38..71918c4e 100644 --- a/folly/MemoryMapping.cpp +++ b/folly/MemoryMapping.cpp @@ -258,10 +258,11 @@ bool MemoryMapping::mlock(LockMode lock) { } auto msg = - folly::sformat("mlock({}) failed at {}", mapLength_, amountSucceeded); - - if (lock == LockMode::TRY_LOCK && (errno == EPERM || errno == ENOMEM)) { + folly::format("mlock({}) failed at {}", mapLength_, amountSucceeded); + if (lock == LockMode::TRY_LOCK && errno == EPERM) { PLOG(WARNING) << msg; + } else if (lock == LockMode::TRY_LOCK && errno == ENOMEM) { + VLOG(1) << msg; } else { PLOG(FATAL) << msg; }