All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Minchan Kim <minchan@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Cc: "Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@google.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Martijn Coenen" <maco@android.com>
Subject: Re: [PATCH v4] ANDROID: binder: change down_write to down_read
Date: Wed, 28 Mar 2018 23:48:43 -0700	[thread overview]
Message-ID: <1522306123.2210.28.camel@perches.com> (raw)
In-Reply-To: <20180329064013.198620-1-minchan@kernel.org>

On Thu, 2018-03-29 at 15:40 +0900, Minchan Kim wrote:
> binder_update_page_range needs down_write of mmap_sem because
> vm_insert_page need to change vma->vm_flags to VM_MIXEDMAP unless
> it is set. However, when I profile binder working, it seems
> every binder buffers should be mapped in advance by binder_mmap.
> It means we could set VM_MIXEDMAP in bider_mmap time which is

typo trivia: binder_mmap

> already hold a mmap_sem as down_write so binder_update_page_range
> doesn't need to hold a mmap_sem as down_write.

and style trivia:

> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
[]
> @@ -4722,7 +4722,8 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
>  		failure_string = "bad vm_flags";
>  		goto err_bad_arg;
>  	}
> -	vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
> +	vma->vm_flags = (vma->vm_flags | VM_DONTCOPY | VM_MIXEDMAP) &
> +							~VM_MAYWRITE;

Perhaps this is clearer as

	vma->vm_flags |= VM_DONTCOPY | VM_MIXEDMAP;
	vma->vm_flags &= ~VM_MAYWRITE;

      reply	other threads:[~2018-03-29  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29  6:40 [PATCH v4] ANDROID: binder: change down_write to down_read Minchan Kim
2018-03-29  6:48 ` Joe Perches [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=1522306123.2210.28.camel@perches.com \
    --to=joe@perches.com \
    --cc=arve@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=minchan@kernel.org \
    --cc=tkjos@google.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 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.