diff options
author | Mark Salyzyn <salyzyn@android.com> | 2016-09-01 18:13:46 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2016-09-09 01:01:10 +0300 |
commit | 5bf6d1b92715f224ef6e1c3abca5dd63eeb4915d (patch) | |
tree | 09139364ae61fbb0b188c0a762861bf800b70d23 /fs/pstore/ram.c | |
parent | 79d955af711a6e20207783590a2cfddbd649568b (diff) | |
download | linux-5bf6d1b92715f224ef6e1c3abca5dd63eeb4915d.tar.xz |
pstore/pmsg: drop bounce buffer
Removing a bounce buffer copy operation in the pmsg driver path is
always better. We also gain in overall performance by not requesting
a vmalloc on every write as this can cause precious RT tasks, such
as user facing media operation, to stall while memory is being
reclaimed. Added a write_buf_user to the pstore functions, a backup
platform write_buf_user that uses the small buffer that is part of
the instance, and implemented a ramoops write_buf_user that only
supports PSTORE_TYPE_PMSG.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore/ram.c')
-rw-r--r-- | fs/pstore/ram.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 08597c524439..f3e3cf00d8b9 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -331,6 +331,24 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type, return 0; } +static int notrace ramoops_pstore_write_buf_user(enum pstore_type_id type, + enum kmsg_dump_reason reason, + u64 *id, unsigned int part, + const char __user *buf, + bool compressed, size_t size, + struct pstore_info *psi) +{ + if (type == PSTORE_TYPE_PMSG) { + struct ramoops_context *cxt = psi->data; + + if (!cxt->mprz) + return -ENOMEM; + return persistent_ram_write_user(cxt->mprz, buf, size); + } + + return -EINVAL; +} + static int ramoops_pstore_erase(enum pstore_type_id type, u64 id, int count, struct timespec time, struct pstore_info *psi) { @@ -369,6 +387,7 @@ static struct ramoops_context oops_cxt = { .open = ramoops_pstore_open, .read = ramoops_pstore_read, .write_buf = ramoops_pstore_write_buf, + .write_buf_user = ramoops_pstore_write_buf_user, .erase = ramoops_pstore_erase, }, }; |