linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [RFC] free_pages stuff
Date: Tue, 5 Jan 2016 16:42:07 +0100	[thread overview]
Message-ID: <20160105154207.GF15324@dhcp22.suse.cz> (raw)
In-Reply-To: <20160105152602.GR9938@ZenIV.linux.org.uk>

On Tue 05-01-16 15:26:02, Al Viro wrote:
> On Tue, Jan 05, 2016 at 02:59:03PM +0100, Michal Hocko wrote:
> 
> > > 3) vmalloc() is for large allocations.  They will be page-aligned,
> > > but *not* physically contiguous.  OTOH, large physically contiguous
> > > allocations are generally a bad idea.  Unlike other allocators, there's
> > > no variant that could be used in interrupt; freeing is possible there,
> > > but allocation is not.  Note that non-blocking variant *does* exist -
> > > __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL) can be used in atomic
> > > contexts; it's the interrupt ones that are no-go.
> 
> The last sentence I'd put into that part was complete crap...
> 
> > It is also hardcoded GFP_KERNEL context so a usage from NOFS context
> > needs a special treatment.
> 
> ... in part because of this.  GFP_ATOMIC __vmalloc() will be anything but,
> and the only caller passing that is almost certainly bogus.

Agreed as just replied in the other email thread which I have noticed
only now.

> As for NOFS/NOIO,
> I wonder if we should apply that special treatment inside __vmalloc_area_node
> rather than in callers; see the current thread on linux-mm for details...

That would make a lot of sense to me. Spreading the _special_ treatment
all over the kernel is certainly worse.
 
> Another interesting issue is __GFP_HIGHMEM meaning for kmalloc and __vmalloc
> resp. (should never be passed to kmalloc, should almost always be passed
> to __vmalloc - the former needs pages mapped in kernel space, the latter
> probably never needs a separate kernel alias for the data pages, to such
> degree that I'm not sure if we shouldn't _force_ __GFP_HIGHMEM for data pages
> allocation in __vmalloc_area_node())

I would have to think about this one some more. Let's not fragment the
discussion and continue in that email thread:
http://lkml.kernel.org/r/20160103071246.GK9938%40ZenIV.linux.org.uk

-- 
Michal Hocko
SUSE Labs

--
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:[~2016-01-05 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151221234615.GW20997@ZenIV.linux.org.uk>
     [not found] ` <CA+55aFwp4iy4rtX2gE2WjBGFL=NxMVnoFeHqYa2j1dYOMMGqxg@mail.gmail.com>
     [not found]   ` <20151222010403.GX20997@ZenIV.linux.org.uk>
     [not found]     ` <CA+55aFy9NrV_RnziN9z3p5O6rv1A0mirhLD0hL7Wrb77+YyBeg@mail.gmail.com>
     [not found]       ` <20151222022226.GY20997@ZenIV.linux.org.uk>
     [not found]         ` <CAMuHMdUGkVcUOH4VUXiuoa6eGVQEA+QRDEop3GrEOEWz8GeNig@mail.gmail.com>
     [not found]           ` <20151222210435.GB20997@ZenIV.linux.org.uk>
2016-01-05 13:59             ` Michal Hocko
2016-01-05 15:26               ` Al Viro
2016-01-05 15:42                 ` Michal Hocko [this message]

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=20160105154207.GF15324@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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