# 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/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux-gcc --version # < /opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux-ld --version # < git log --format=%s --max-count=1 30bac164aca750892b93eef350439a0562a68647 # < make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- allmodconfig drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # yes \n | make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- oldconfig yes: standard output: Broken pipe # make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type :1333:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp] :1336:2: warning: #warning syscall rseq not implemented [-Wcpp] /kisskb/src/arch/xtensa/kernel/pci.c:45:32: warning: 'pci_ctrl_tail' defined but not used [-Wunused-variable] static struct pci_controller **pci_ctrl_tail = &pci_ctrl_head; ^ /kisskb/src/drivers/char/tpm/tpm2-cmd.c: In function 'tpm2_unseal_trusted': /kisskb/src/drivers/char/tpm/tpm2-cmd.c:668:2: warning: 'blob_handle' may be used uninitialized in this function [-Wmaybe-uninitialized] tpm2_flush_context_cmd(chip, blob_handle, TPM_TRANSMIT_UNLOCKED); ^ ./usr/include/asm/setup.h:17: userspace cannot reference function or variable defined in the kernel /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret == -EOPNOTSUPP) ^ /kisskb/src/drivers/input/joystick/analog.c:172:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^ In file included from /kisskb/src/arch/xtensa/include/asm/atomic.h:21:0, from /kisskb/src/include/linux/atomic.h:7, from /kisskb/src/include/asm-generic/bitops/atomic.h:5, from /kisskb/src/arch/xtensa/include/asm/bitops.h:222, from /kisskb/src/include/linux/bitops.h:19, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/wait_bit.h:8, from /kisskb/src/include/linux/fs.h:6, from /kisskb/src/fs/ocfs2/file.c:27: /kisskb/src/fs/ocfs2/file.c: In function 'ocfs2_file_write_iter': /kisskb/src/arch/xtensa/include/asm/cmpxchg.h:139:3: warning: value computed is not used [-Wunused-value] ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) ^ /kisskb/src/fs/ocfs2/file.c:2386:3: note: in expansion of macro 'xchg' xchg(&iocb->ki_complete, saved_ki_complete); ^ /kisskb/src/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'mlx5e_grp_sw_update_stats': /kisskb/src/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:217:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ In file included from /kisskb/src/arch/xtensa/include/asm/atomic.h:21:0, from /kisskb/src/include/linux/atomic.h:7, from /kisskb/src/include/asm-generic/bitops/atomic.h:5, from /kisskb/src/arch/xtensa/include/asm/bitops.h:222, from /kisskb/src/include/linux/bitops.h:19, from /kisskb/src/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:11: /kisskb/src/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function 'ixgbevf_xdp_setup': /kisskb/src/arch/xtensa/include/asm/cmpxchg.h:139:3: warning: value computed is not used [-Wunused-value] ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) ^ /kisskb/src/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:4471:4: note: in expansion of macro 'xchg' xchg(&adapter->rx_ring[i]->xdp_prog, adapter->xdp_prog); ^ In file included from /kisskb/src/include/linux/rwsem.h:16:0, from /kisskb/src/include/linux/notifier.h:15, from /kisskb/src/include/linux/clk.h:17, from /kisskb/src/drivers/tty/serial/sh-sci.c:24: /kisskb/src/drivers/tty/serial/sh-sci.c: In function 'sci_submit_rx': /kisskb/src/include/linux/spinlock.h:279:3: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized] _raw_spin_unlock_irqrestore(lock, flags); \ ^ /kisskb/src/drivers/tty/serial/sh-sci.c:1338:16: note: 'flags' was declared here unsigned long flags; ^ Completed OK # rm -rf /kisskb/build/linus_xtensa-allmodconfig_xtensa # Build took: 0:23:15.436951