linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Shaohua Li <shli@fb.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, riel@redhat.com,
	mgorman@suse.de, hughd@google.com, hannes@cmpxchg.org,
	aarcange@redhat.com, je@fb.com, Kernel-team@fb.com
Subject: Re: [RFC] mm: add a new vector based madvise syscall
Date: Fri, 30 Oct 2015 13:17:54 -0700	[thread overview]
Message-ID: <871tccaz65.fsf@tassilo.jf.intel.com> (raw)
In-Reply-To: <20151029215516.GA3864685@devbig084.prn1.facebook.com> (Shaohua Li's message of "Thu, 29 Oct 2015 14:55:16 -0700")

Shaohua Li <shli@fb.com> writes:
> +		vmas[i] = find_vma(current->mm, start);
> +		/*
> +		 * don't allow range cross vma, it doesn't make sense for
> +		 * DONTNEED
> +		 */
> +		if (!vmas[i] || start < vmas[i]->vm_start ||
> +		    start + len > vmas[i]->vm_end) {
> +			error = -ENOMEM;
> +			goto up_out;
> +		}
> +		if (vmas[i]->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP)) {
> +			error = -EINVAL;
> +			goto up_out;
> +		}
> +	}

Needs a cond_resched() somewhere in case the list is very long?

BTW one trick that may be interesting here is to add a new mode
that skips the TLB flush completely, but instead waits with
the freeing until enough context switches to non kernel tasks occurred
(and flushed the TLB this way). This could be done as part of RCU.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

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

  parent reply	other threads:[~2015-10-30 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 21:55 Shaohua Li
2015-10-30 12:48 ` Rik van Riel
2015-10-30 20:17 ` Andi Kleen [this message]
2015-11-02 18:16   ` Shaohua Li
2015-11-05 13:01 ` Vlastimil Babka

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=871tccaz65.fsf@tassilo.jf.intel.com \
    --to=andi@firstfloor.org \
    --cc=Kernel-team@fb.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=je@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.com \
    --cc=shli@fb.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