[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1559291012-19269-1-git-send-email-maninder1.s@samsung.com>
Date: Fri, 31 May 2019 13:53:32 +0530
From: Maninder Singh <maninder1.s@...sung.com>
To: viro@...iv.linux.org.uk, jens.axboe@...cle.com
Cc: v.narang@...sung.com, a.sahrawat@...sung.com, pankaj.m@...sung.com,
linux-kernel@...r.kernel.org,
Maninder Singh <maninder1.s@...sung.com>
Subject: [PATCH 1/1] splice: Reduce stack usage by reducing structure
partial_page
u16 can be used to store Page offset and page len for partial page
for page size upto 65K. page size is fixed at compilation time so
size of partial page can be reduced to reduce stack usage of functions
using partial_page structure on stack.
<subbuf_splice_actor>:
e16d42f4 strd r4, [sp, #-36]! ; 0xffffffdc
...
e24ddf4d sub sp, sp, #308 ; 0x134
<tracing_splice_read_pipe>:
e16d42f4 strd r4, [sp, #-36]! ; 0xffffffdc
...
e24ddf53 sub sp, sp, #332 ; 0x14c
After:
======
<subbuf_splice_actor>:
e16d42f4 strd r4, [sp, #-36]! ; 0xffffffdc
...
e24dd0f4 sub sp, sp, #244 ; 0xf4
<tracing_splice_read_pipe>:
e16d42f4 strd r4, [sp, #-36]! ; 0xffffffdc
...
e24ddf45 sub sp, sp, #276 ; 0x114
Tested on ARM.
Signed-off-by: Vaneet Narang <v.narang@...sung.com>
Signed-off-by: Maninder Singh <maninder1.s@...sung.com>
---
include/linux/splice.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 74b4911..d2b1814 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -45,8 +45,13 @@ struct splice_desc {
};
struct partial_page {
+#if PAGE_SHIFT < 16
+ unsigned short offset;
+ unsigned short len;
+#else
unsigned int offset;
unsigned int len;
+#endif
unsigned long private;
};
--
2.7.4
Powered by blists - more mailing lists