linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Vegard Nossum <vegard.nossum@oracle.com>,
	Willy Tarreau <w@1wt.eu>, Andy Lutomirski <luto@amacapital.net>,
	Kees Cook <keescook@google.com>,
	Vladimir Davydov <vdavydov@virtuozzo.com>,
	Konstantin Khlebnikov <koct9i@gmail.com>,
	Pavel Emelyanov <xemul@virtuozzo.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [RFC] mm: Account anon mappings as RLIMIT_DATA
Date: Fri, 11 Dec 2015 23:59:52 +0300	[thread overview]
Message-ID: <20151211205951.GA29551@uranus> (raw)
In-Reply-To: <CA+55aFzbBQp-QzWj2k7twuZ7+ESFpzoRPGZVKWkDv04zHCZ3Sg@mail.gmail.com>

On Fri, Dec 11, 2015 at 12:55:51PM -0800, Linus Torvalds wrote:
> >
> > +static inline int anon_accountable_mapping(struct file *file, vm_flags_t vm_flags)
> > +{
> > +       return !file &&
> > +               (vm_flags & (VM_GROWSDOWN | VM_GROWSUP |
> > +                            VM_SHARED | VM_MAYSHARE)) == 0;
> > +}
> 
> You're duplicating that "is it an anon accountable mapping" logic. I
> think you should move the inline helper function up, and use it in
> vm_stat_account().
> 
> Other than that, I think the patch certainly looks clean and obvious
> enough. But I didn't actually try to *run* it, maybe it ends up not
> working due to something I don't see.

Thank for the note, Linus! I tried to play with it a little bit,
but I need to test it more first. I sent it simply to be sure
that i'm moving in right direction. Once I get reviewed all things
again and test it more deeply, I'll send a new patch.

--
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:[~2015-12-11 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 20:49 [RFC] mm: Account anon mappings as RLIMIT_DATA Cyrill Gorcunov
2015-12-11 20:55 ` Linus Torvalds
2015-12-11 20:59   ` Cyrill Gorcunov [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=20151211205951.GA29551@uranus \
    --to=gorcunov@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=keescook@google.com \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=quentin.casasnovas@oracle.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vdavydov@virtuozzo.com \
    --cc=vegard.nossum@oracle.com \
    --cc=w@1wt.eu \
    --cc=xemul@virtuozzo.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).