zlogger: map only the actively used buffer to the userspace 54/281154/14
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 15 Sep 2022 11:30:03 +0000 (13:30 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 19 Oct 2022 09:17:02 +0000 (11:17 +0200)
commit3a489d20b218eec5073f18e5b248ced6c6a843d8
treefffc7e3f53cc6f30c4658e01eab235fab4390b42
parent0f5c8cdd391e54332079f6e311c363ccb5e306ea
zlogger: map only the actively used buffer to the userspace

Each zlogger client maps only a single 4KB buffer and writes to it. Once
it is filled, it calls ALLOC ioctl (like before) and kernel remaps a new
buffer in place of the old buffer.

If kernel needs to free a buffer, the userspace mapping is cleared and
will cause a page fault on the next access, which in turn will cause
allocation of the new buffer just like the ALLOC ioctl does.

Change-Id: I2d6fe8406e201ef20b6378a7ba37ed5df7790406
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
include/uapi/linux/zlogger.h
kernel/zlogger/zlogger.c