proc: slightly faster /proc/*/limits
diff mbox series

Message ID 20181203164242.GB6904@avx2
State In Next
Commit afe922c2daae4a8f0101a30658c886c2b6eb2a96
Headers show
Series
  • proc: slightly faster /proc/*/limits
Related show

Commit Message

Alexey Dobriyan Dec. 3, 2018, 4:42 p.m. UTC
Header of /proc/*/limits is a fixed string, so print it directly without
formatting specifiers.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/proc/base.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch
diff mbox series

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -581,8 +581,10 @@  static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
 	/*
 	 * print the file header
 	 */
-       seq_printf(m, "%-25s %-20s %-20s %-10s\n",
-		  "Limit", "Soft Limit", "Hard Limit", "Units");
+	seq_puts(m, "Limit                     "
+		"Soft Limit           "
+		"Hard Limit           "
+		"Units     \n");
 
 	for (i = 0; i < RLIM_NLIMITS; i++) {
 		if (rlim[i].rlim_cur == RLIM_INFINITY)