# git rev-parse -q --verify 30bac164aca750892b93eef350439a0562a68647^{commit} 30bac164aca750892b93eef350439a0562a68647 already have revision, skipping fetch # git checkout -q -f -B kisskb 30bac164aca750892b93eef350439a0562a68647 # git clean -qxdf # < git log -1 # commit 30bac164aca750892b93eef350439a0562a68647 # Author: Linus Torvalds # Date: Thu Jan 24 09:04:37 2019 +1300 # # Revert "Change mincore() to count "mapped" pages rather than "cached" pages" # # This reverts commit 574823bfab82d9d8fa47f422778043fbb4b4f50e. # # It turns out that my hope that we could just remove the code that # exposes the cache residency status from mincore() was too optimistic. # # There are various random users that want it, and one example would be # the Netflix database cluster maintenance. To quote Josh Snyder: # # "For Netflix, losing accurate information from the mincore syscall # would lengthen database cluster maintenance operations from days to # months. We rely on cross-process mincore to migrate the contents of a # page cache from machine to machine, and across reboots. # # To do this, I wrote and maintain happycache [1], a page cache # dumper/loader tool. It is quite similar in architecture to pgfincore, # except that it is agnostic to workload. The gist of happycache's # operation is "produce a dump of residence status for each page, do # some operation, then reload exactly the same pages which were present # before." happycache is entirely dependent on accurate reporting of the # in-core status of file-backed pages, as accessed by another process. # # We primarily use happycache with Cassandra, which (like Postgres + # pgfincore) relies heavily on OS page cache to reduce disk accesses. # Because our workloads never experience a cold page cache, we are able # to provision hardware for a peak utilization level that is far lower # than the hypothetical "every query is a cache miss" peak. # # A database warmed by happycache can be ready for service in seconds # (bounded only by the performance of the drives and the I/O subsystem), # with no period of in-service degradation. By contrast, putting a # database in service without a page cache entails a potentially # unbounded period of degradation (at Netflix, the time to populate a # single node's cache via natural cache misses varies by workload from # hours to weeks). If a single node upgrade were to take weeks, then # upgrading an entire cluster would take months. Since we want to apply # security upgrades (and other things) on a somewhat tighter schedule, # we would have to develop more complex solutions to provide the same # functionality already provided by mincore. # # At the bottom line, happycache is designed to benignly exploit the # same information leak documented in the paper [2]. I think it makes # perfect sense to remove cross-process mincore functionality from # unprivileged users, but not to remove it entirely" # # We do have an alternate approach that limits the cache residency # reporting only to processes that have write permissions to the file, so # we can fix the original information leak issue that way. It involves # _adding_ code rather than removing it, which is sad, but hey, at least # we haven't found any users that would find the restrictions # unacceptable. # # So revert the optimistic first approach to make room for that alternate # fix instead. # # Reported-by: Josh Snyder # Cc: Jiri Kosina # Cc: Dominique Martinet # Cc: Andy Lutomirski # Cc: Dave Chinner # Cc: Kevin Easton # Cc: Matthew Wilcox # Cc: Cyril Hrubis # Cc: Vlastimil Babka # Cc: Tejun Heo # Cc: Kirill A. Shutemov # Cc: Daniel Gruss # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-ld --version # < git log --format=%s --max-count=1 30bac164aca750892b93eef350439a0562a68647 # < make -s -j 48 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux- sun3_defconfig WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES Depends on [n]: DISCONTIGMEM [=n] || NUMA Selected by [y]: - SINGLE_MEMORY_CHUNK [=y] && MMU [=y] WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES Depends on [n]: DISCONTIGMEM [=n] || NUMA Selected by [y]: - SINGLE_MEMORY_CHUNK [=y] && MMU [=y] WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES Depends on [n]: DISCONTIGMEM [=n] || NUMA Selected by [y]: - SINGLE_MEMORY_CHUNK [=y] && MMU [=y] # make -s -j 48 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux- :1240:2: warning: #warning syscall seccomp not implemented [-Wcpp] :1318:2: warning: #warning syscall pkey_mprotect not implemented [-Wcpp] :1321:2: warning: #warning syscall pkey_alloc not implemented [-Wcpp] :1324:2: warning: #warning syscall pkey_free not implemented [-Wcpp] :1333:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp] :1336:2: warning: #warning syscall rseq not implemented [-Wcpp] /kisskb/src/arch/m68k/kernel/signal.c: In function 'mangle_kernel_stack': /kisskb/src/arch/m68k/kernel/signal.c:654:3: warning: variable length array 'buf' is used [-Wvla] /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:186:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/ipc/shm.c: In function 'ksys_shmdt': /kisskb/src/ipc/shm.c:1686:59: warning: 'file' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/acct.c: In function 'acct_pin_kill': /kisskb/src/kernel/acct.c:177:2: warning: value computed is not used [-Wunused-value] /kisskb/src/lib/mpi/mpicoder.c: In function 'mpi_read_raw_from_sgl': /kisskb/src/lib/mpi/mpicoder.c:336:12: warning: 'buff' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/core/gen_stats.c: In function '__gnet_stats_copy_basic': /kisskb/src/net/core/gen_stats.c:161:19: warning: 'seq' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/core/dev.c: In function 'validate_xmit_skb_list': /kisskb/src/net/core/dev.c:3405:15: warning: 'tail' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/core/filter.c: In function 'bpf_clear_redirect_map': /kisskb/src/net/core/filter.c:3470:4: warning: value computed is not used [-Wunused-value] /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c: In function 'sun3_82586_timeout': /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c:993:89: warning: array subscript is above array bounds [-Warray-bounds] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:339:21: note: 'pdeo' was declared here /kisskb/src/net/ipv6/ip6_output.c: In function '__ip6_append_data.isra.37': /kisskb/src/include/linux/skbuff.h:1338:6: warning: 'extra_uref' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv6/ip6_output.c:1270:14: note: 'extra_uref' was declared here /kisskb/src/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/ocfs2/file.c: In function 'ocfs2_file_write_iter': /kisskb/src/fs/ocfs2/file.c:2386:3: warning: value computed is not used [-Wunused-value] /kisskb/src/lib/rhashtable.c: In function 'rht_deferred_worker': /kisskb/src/lib/rhashtable.c:264:2: warning: 'next' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/lib/rhashtable.c:229:28: note: 'next' was declared here /kisskb/src/net/sctp/output.c: In function 'sctp_packet_config': /kisskb/src/include/net/sock.h:1942:19: warning: 'sk' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/sctp/output.c:94:15: note: 'sk' was declared here /kisskb/src/drivers/net/macsec.c: In function 'macsec_del_rxsa': /kisskb/src/drivers/net/macsec.c:1926:2: warning: 'assoc_num' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c:1926:2: warning: 'rx_sc' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c: In function 'macsec_del_txsa': /kisskb/src/drivers/net/macsec.c:2003:2: warning: 'assoc_num' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c:2003:2: warning: 'tx_sc' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c: In function 'macsec_upd_txsa': /kisskb/src/drivers/net/macsec.c:2068:5: warning: 'assoc_num' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c:2068:24: warning: 'tx_sc' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/macsec.c:2069:21: warning: 'secy' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv4/ip_output.c: In function '__ip_append_data.isra.40': /kisskb/src/include/linux/skbuff.h:1338:6: warning: 'extra_uref' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/ipv4/ip_output.c:885:14: note: 'extra_uref' was declared here /kisskb/src/fs/posix_acl.c: In function 'get_acl': /kisskb/src/fs/posix_acl.c:147:3: warning: value computed is not used [-Wunused-value] /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1846:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1536:31: warning: 'linear' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1756:46: note: 'linear' was declared here Completed OK # rm -rf /kisskb/build/linus_sun3_defconfig_m68k # Build took: 0:01:08.942967