[PATCHv3,6/7] criu/proc: Define BUF_SIZE without PAGE_SIZE dependency

Submitted by Dmitry Safonov on April 6, 2018, 11:40 p.m.

Details

Message ID 20180406234021.15724-7-dima@arista.com
State New
Series "Large pages support for aarch64/ppc64"
Headers show

Commit Message

Dmitry Safonov April 6, 2018, 11:40 p.m.
PAGE_SIZE will be a variable value on platforms where it can be
different due to large pages.
And looks like (c) there is no reason for BUF_SIZE == PAGE_SIZE,
so let's keep it as it was, rather than complicating it with dynamic
allocation for the buffer.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 criu/proc_parse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index 54f0ffd8ed49..986934c6669a 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -61,16 +61,16 @@ 
 #define SIGEV_THREAD_ID 4       /* deliver to thread */
 #endif
 
+#define BUF_SIZE	4096	/* Good enough value - can be changed */
+
 struct buffer {
-	char buf[PAGE_SIZE];
+	char buf[BUF_SIZE];
 	char end; /* '\0' */
 };
 
 static struct buffer __buf;
 static char *buf = __buf.buf;
 
-#define BUF_SIZE sizeof(__buf.buf)
-
 /*
  * This is how AIO ring buffers look like in proc
  */