All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, cl@gentwo.org,
	kirill.shutemov@linux.intel.com, Andi Kleen <ak@linux.intel.com>,
	akpm@linux-foundation.org, Dave Hansen <dave@sr71.net>
Subject: [PATCH 2/2] mm: blk-mq: uses page->list incorrectly
Date: Wed, 11 Dec 2013 14:36:32 -0800	[thread overview]
Message-ID: <20131211223632.8B2DFD41@viggo.jf.intel.com> (raw)
In-Reply-To: <20131211223631.51094A3D@viggo.jf.intel.com>


From: Dave Hansen <dave.hansen@linux.intel.com>

'struct page' has two list_head fields: 'lru' and 'list'.
Conveniently, they are unioned together.  This means that code
can use them interchangably, which gets horribly confusing.

The blk-mq made the logical decision to try to use page->list.
But, that field was actually introduced just for the slub code.
->lru is the right field to use outside of slab/slub.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/block/blk-mq.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN block/blk-mq.c~blk-mq-uses-page-list-incorrectly block/blk-mq.c
--- linux.git/block/blk-mq.c~blk-mq-uses-page-list-incorrectly	2013-12-11 14:34:51.735196799 -0800
+++ linux.git-davehans/block/blk-mq.c	2013-12-11 14:34:51.739196977 -0800
@@ -1087,8 +1087,8 @@ static void blk_mq_free_rq_map(struct bl
 	struct page *page;
 
 	while (!list_empty(&hctx->page_list)) {
-		page = list_first_entry(&hctx->page_list, struct page, list);
-		list_del_init(&page->list);
+		page = list_first_entry(&hctx->page_list, struct page, lru);
+		list_del_init(&page->lru);
 		__free_pages(page, page->private);
 	}
 
@@ -1152,7 +1152,7 @@ static int blk_mq_init_rq_map(struct blk
 			break;
 
 		page->private = this_order;
-		list_add_tail(&page->list, &hctx->page_list);
+		list_add_tail(&page->lru, &hctx->page_list);
 
 		p = page_address(page);
 		entries_per_page = order_to_size(this_order) / rq_size;
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, cl@gentwo.org,
	kirill.shutemov@linux.intel.com, Andi Kleen <ak@linux.intel.com>,
	akpm@linux-foundation.org, Dave Hansen <dave@sr71.net>
Subject: [PATCH 2/2] mm: blk-mq: uses page->list incorrectly
Date: Wed, 11 Dec 2013 14:36:32 -0800	[thread overview]
Message-ID: <20131211223632.8B2DFD41@viggo.jf.intel.com> (raw)
In-Reply-To: <20131211223631.51094A3D@viggo.jf.intel.com>


From: Dave Hansen <dave.hansen@linux.intel.com>

'struct page' has two list_head fields: 'lru' and 'list'.
Conveniently, they are unioned together.  This means that code
can use them interchangably, which gets horribly confusing.

The blk-mq made the logical decision to try to use page->list.
But, that field was actually introduced just for the slub code.
->lru is the right field to use outside of slab/slub.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/block/blk-mq.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN block/blk-mq.c~blk-mq-uses-page-list-incorrectly block/blk-mq.c
--- linux.git/block/blk-mq.c~blk-mq-uses-page-list-incorrectly	2013-12-11 14:34:51.735196799 -0800
+++ linux.git-davehans/block/blk-mq.c	2013-12-11 14:34:51.739196977 -0800
@@ -1087,8 +1087,8 @@ static void blk_mq_free_rq_map(struct bl
 	struct page *page;
 
 	while (!list_empty(&hctx->page_list)) {
-		page = list_first_entry(&hctx->page_list, struct page, list);
-		list_del_init(&page->list);
+		page = list_first_entry(&hctx->page_list, struct page, lru);
+		list_del_init(&page->lru);
 		__free_pages(page, page->private);
 	}
 
@@ -1152,7 +1152,7 @@ static int blk_mq_init_rq_map(struct blk
 			break;
 
 		page->private = this_order;
-		list_add_tail(&page->list, &hctx->page_list);
+		list_add_tail(&page->lru, &hctx->page_list);
 
 		p = page_address(page);
 		entries_per_page = order_to_size(this_order) / rq_size;
_

  reply	other threads:[~2013-12-11 22:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 22:36 [PATCH 1/2] mm: slab/slub: use page->list consistently instead of page->lru Dave Hansen
2013-12-11 22:36 ` Dave Hansen
2013-12-11 22:36 ` Dave Hansen [this message]
2013-12-11 22:36   ` [PATCH 2/2] mm: blk-mq: uses page->list incorrectly Dave Hansen
2013-12-11 22:47   ` David Rientjes
2013-12-11 22:47     ` David Rientjes
2013-12-12 13:16   ` Kirill A. Shutemov
2013-12-12 13:16     ` Kirill A. Shutemov
2013-12-11 22:45 ` [PATCH 1/2] mm: slab/slub: use page->list consistently instead of page->lru David Rientjes
2013-12-11 22:45   ` David Rientjes
2013-12-12 17:39 ` Christoph Lameter
2013-12-12 17:39   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131211223632.8B2DFD41@viggo.jf.intel.com \
    --to=dave@sr71.net \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.