|
@@ -70,12 +70,13 @@ struct tty_buffer {
|
|
|
|
|
|
/*
|
|
|
* We default to dicing tty buffer allocations to this many characters
|
|
|
- * in order to avoid multiple page allocations. We assume tty_buffer itself
|
|
|
- * is under 256 bytes. See tty_buffer_find for the allocation logic this
|
|
|
- * must match
|
|
|
+ * 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 - 256) / 2)
|
|
|
+#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
|
|
|
|
|
|
|
|
|
struct tty_bufhead {
|