linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Simon Baatz <gmbnomis@gmail.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ming Lei <tom.leiming@gmail.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Will Deacon <Will.Deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Tejun Heo <tj@kernel.org>,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: ARM/kirkwood: v3.12-rc6: kernel BUG at mm/util.c:390!
Date: Mon, 28 Oct 2013 12:48:51 +0000	[thread overview]
Message-ID: <20131028124851.GD5354@mbp> (raw)
In-Reply-To: <20131027141817.GA13436@schnuecks.de>

On Sun, Oct 27, 2013 at 02:18:17PM +0000, Simon Baatz wrote:
> On Sun, Oct 27, 2013 at 01:53:44PM +0000, Russell King - ARM Linux wrote:
> > On Sun, Oct 27, 2013 at 09:16:53PM +0800, Ming Lei wrote:
> > > On Sun, Oct 27, 2013 at 8:50 PM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> > > >
> > So...
> > 
> > flush_kernel_dcache_page() is expected to take a struct page pointer.
> > This struct page pointer is part of the kernel's array of struct pages
> > which identifies every single physical page under the control of the
> > kernel.
> > 
> > Arguably, it should not crash if passed a page which has been allocated
> > to the slab cache; as this is not a page cache page,
> > flush_kernel_dcache_page() should merely ignore the call to it and
> > simply return on these.  So this makes total sense:
> 
> In this respect, flush_kernel_dcache_page() is following
> flush_dcache_page(). For example in crypto/scatterwalk.c:
> 
> static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
>                                  unsigned int more)
> {
>         if (out) {
>                 struct page *page;
> 
>                 page = sg_page(walk->sg) + ((walk->offset - 1) >>
> PAGE_SHIFT);
>                 if (!PageSlab(page))
>                         flush_dcache_page(page);
>         }
> ... 
> 
> 
> or in drivers/ata/libata-sff.c:
> 
> ...
>         if (!do_write && !PageSlab(page))
>                 flush_dcache_page(page);
> ...
> 
> 
> (Probably, both cases should have used
> flush_kernel_dcache_page() in the first place). If we say that this
> check belongs in flush_kernel_dcache_page() we should also put it
> into flush_dcache_page(), no?

According to cachetlb.txt, flush_dcache_page() is only called on page
cache pages, so this excludes the PageSlab() check.

For flush_kernel_dcache_page() it says "when the kernel modifies and
user page" and my reading is that this applies to either page cache
or anonymous pages but not slab pages, so I would add such check to the
caller.

-- 
Catalin

--
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>

  reply	other threads:[~2013-10-28 12:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 20:07 ARM/kirkwood: v3.12-rc6: kernel BUG at mm/util.c:390! Aaro Koskinen
2013-10-26 14:36 ` Will Deacon
2013-10-26 17:23   ` Aaro Koskinen
2013-10-27 11:51   ` Ming Lei
2013-10-27 12:50     ` Aaro Koskinen
2013-10-27 13:16       ` Ming Lei
2013-10-27 13:42         ` Tejun Heo
2013-10-27 13:47           ` Russell King - ARM Linux
2013-10-27 13:53         ` Russell King - ARM Linux
2013-10-27 14:18           ` Simon Baatz
2013-10-28 12:48             ` Catalin Marinas [this message]
2013-10-27 14:19           ` Ming Lei
2013-10-28 14:13     ` Simon Baatz
2013-10-28 15:45       ` Ming Lei
  -- strict thread matches above, loose matches on Subject: below --
2013-10-24 20:05 Aaro Koskinen

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=20131028124851.GD5354@mbp \
    --to=catalin.marinas@arm.com \
    --cc=JBottomley@parallels.com \
    --cc=Will.Deacon@arm.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=gmbnomis@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=tj@kernel.org \
    --cc=tom.leiming@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).