Merge branch 'pm-cpuidle'
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_buffer.c
index f22e116db105df51990d1abfb7231b9fe9f29b25..c043136fbe5198cf0a7a8704254fc28763ecd0b9 100644 (file)
  */
 #define TTYB_MEM_LIMIT 65536
 
+/*
+ * We default to dicing tty buffer allocations to this many characters
+ * in order to avoid multiple page allocations. We know the size of
+ * tty_buffer itself but it must also be taken into account that the
+ * the buffer is 256 byte aligned. See tty_buffer_find for the allocation
+ * logic this must match
+ */
+
+#define TTY_BUFFER_PAGE        (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
+
 
 /**
  *     tty_buffer_lock_exclusive       -       gain exclusive access to buffer