Kernel Tree For Xiaomi 11 Lite NE 5G
Go to file
Steven Rostedt (Google) ec59a13252 ring-buffer: Include dropped pages in counting dirty patches
[ Upstream commit 31029a8b2c7e656a0289194ef16415050ae4c4ac ]

The function ring_buffer_nr_dirty_pages() was created to find out how many
pages are filled in the ring buffer. There's two running counters. One is
incremented whenever a new page is touched (pages_touched) and the other
is whenever a page is read (pages_read). The dirty count is the number
touched minus the number read. This is used to determine if a blocked task
should be woken up if the percentage of the ring buffer it is waiting for
is hit.

The problem is that it does not take into account dropped pages (when the
new writes overwrite pages that were not read). And then the dirty pages
will always be greater than the percentage.

This makes the "buffer_percent" file inaccurate, as the number of dirty
pages end up always being larger than the percentage, event when it's not
and this causes user space to be woken up more than it wants to be.

Add a new counter to keep track of lost pages, and include that in the
accounting of dirty pages so that it is actually accurate.

Link: https://lkml.kernel.org/r/20221021123013.55fb6055@gandalf.local.home

Fixes: 2c2b0a78b3 ("ring-buffer: Add percentage of ring buffer full to wake up reader")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-25 17:42:20 +01:00
arch arm64: dts: imx8mn: Fix NAND controller size-cells 2022-11-25 17:42:15 +01:00
block block: sed-opal: kmalloc the cmd/resp buffers 2022-11-25 17:42:14 +01:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-22 14:11:22 +02:00
crypto crypto: akcipher - default implementation for setting a private key 2022-10-26 13:22:45 +02:00
Documentation docs: update mediator contact information in CoC doc 2022-11-25 17:42:20 +01:00
drivers serial: 8250: Flush DMA Rx on RLSI 2022-11-25 17:42:20 +01:00
fs cifs: add check for returning value of SMB2_set_info_init 2022-11-25 17:42:16 +01:00
include vmlinux.lds.h: Fix placement of '.data..decrypted' section 2022-11-25 17:42:09 +01:00
init random: handle latent entropy and command line from random_init() 2022-06-22 14:11:17 +02:00
ipc ipc: remove memcg accounting for sops objects in do_semtimedop() 2022-11-10 17:57:58 +01:00
kernel ring-buffer: Include dropped pages in counting dirty patches 2022-11-25 17:42:20 +01:00
lib dyndbg: let query-modname override actual module name 2022-10-26 13:22:37 +02:00
LICENSES
mm mm,hugetlb: take hugetlb_lock before decrementing h->resv_huge_pages 2022-11-03 23:56:54 +09:00
net net/x25: Fix skb leak in x25_lapb_receive_frame() 2022-11-25 17:42:16 +01:00
samples
scripts cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-25 17:42:10 +01:00
security capabilities: fix potential memleak on error path from vfs_getxattr_alloc() 2022-11-10 17:57:55 +01:00
sound ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open() 2022-11-25 17:42:17 +01:00
tools selftests/intel_pstate: fix build for ARCH=x86_64 2022-11-25 17:42:12 +01:00
usr
virt KVM: arm64: vgic: Fix exit condition in scan_its_table() 2022-10-29 10:20:35 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: add Chandan as xfs maintainer for 5.4.y 2022-09-28 11:03:58 +02:00
Makefile Linux 5.4.224 2022-11-10 17:57:58 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.