linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org
Cc: "John Stultz"
	<john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
	"Linux API" <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Santosh Shilimkar"
	<santosh.shilimkar-l0cyMroinI0@public.gmane.org>,
	"Arve Hjønnevåg" <arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	"Sumit Semwal"
	<sumit.semwal-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Rebecca Schultz Zavin"
	<rebecca-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	"Christoffer Dall"
	<christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Anup Patel" <anup.patel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] staging: android: binder: move to the "real" part of the kernel
Date: Tue, 21 Oct 2014 12:36:22 +0200	[thread overview]
Message-ID: <20141021103622.GB23161@amd> (raw)
In-Reply-To: <20141016231221.GA13592-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>

On Fri 2014-10-17 01:12:21, Greg Kroah-Hartman wrote:
> On Thu, Oct 16, 2014 at 10:09:04AM -0700, John Stultz wrote:
> > On Thu, Oct 16, 2014 at 5:47 AM, Greg Kroah-Hartman
> > <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> wrote:
> > > From: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>

> > Are the Android guys comfortable with the ABI stability rules they'll
> > now face?
> 
> Just because something is in staging, doesn't mean you don't have to
> follow the same ABI stability rules as the rest of the kernel.  If a
> change had happened to this code that broke userspace in the past, I
> would have reverted it.  So this should not be anything different from
> what has been happening inthe past.

Actually, there's big difference.

If Al Viro changes core filesystem in a way that breaks
staging/binder, binder is broken, and if it can't be fixed... well it
can't be fixed.

If Al Viro changes core filesystem in a way that breaks
drivers/binder, Al's change is going to be reverted.

It is really hard to review without API documentation. Normally, API
documentation is required for stuff like this.

For example: does it add new files in /proc?

Given that it is stable, can we get rid of binder_debug() and
especially BINDER_DEBUG_ENTRY stuff?

Checkpatch warns about 98 too long lines. Some of them could be fixed
easily.

This looks scary:

                        trace_binder_transaction_fd(t, fp->handle,
                        target_fd);
			                binder_debug(BINDER_DEBUG_TRANSACTION,
                                     "        fd %d -> %d\n",
                        fp->handle, target_fd);
                        /* TODO: fput? */
                        fp->handle = target_fd;
			        } break;

Could binder_transcation() be split to smaller functions according to
CodingStyle? 17 goto targets at the end of function are not exactly
easy to read.

ginder_thread_read/write also needs splitting.

binder_ioctl_write_read: just use direct return, no need to goto out
if it just returns.

   proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
        mutex_unlock(&binder_mmap_lock);

#ifdef CONFIG_CPU_CACHE_VIPT
        if (cache_is_vipt_aliasing()) {
                while (CACHE_COLOUR((vma->vm_start ^
        (uint32_t)proc->buffer))) {

Should this be (uintptr_t)?

        /*pr_info("binder_mmap: %d %lx-%lx maps %p\n",                                   

Delete the code, don't comment it out. It is on more than one place.

static void print_binder_thread(struct seq_file *m,
                                struct binder_thread *thread,
                                int print_always)
{
        struct binder_transaction *t;
	struct binder_work *w;
        size_t start_pos = m->count;
	size_t header_pos;

        seq_printf(m, "  thread %d: l %02x\n", thread->pid,
        thread->looper);
        header_pos = m->count;
        t = thread->transaction_stack;
	while (t) {
 	        if (t->from == thread) {
                        print_binder_transaction(m,
				                                 "
        outgoing transaction", t);
                        t = t->from_parent;

Is anyone depending on the debugfs files? Can it be deleted?

Code indentation is "interesting" in binder_thread_read(). See the "}
break;" lines. {}s should not be needed...?

I don't think this code would get merged if it was submitted for
normal inclusion in kernel. I don't think it is good idea to push it
through the back door, without documenting what it does and without
patches even going to the lists.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2014-10-21 10:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 12:47 [PATCH] staging: android: binder: move to the "real" part of the kernel Greg Kroah-Hartman
     [not found] ` <20141016124741.GA3832-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-10-16 14:18   ` Michael Kerrisk (man-pages)
2014-10-16 23:14     ` Greg Kroah-Hartman
2014-10-20 12:45       ` Dan Carpenter
2014-10-21 10:01       ` Pavel Machek
2014-10-20 17:06   ` Arnd Bergmann
2014-10-16 17:09 ` John Stultz
     [not found]   ` <CALAqxLU05D8qQA47E77PiuuN7eVt66WEq1qn+PqdE-tpEUzFpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-16 23:12     ` Greg Kroah-Hartman
     [not found]       ` <20141016231221.GA13592-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-10-17  3:25         ` John Stultz
2014-10-17  8:01           ` Greg Kroah-Hartman
2014-10-21 10:36         ` Pavel Machek [this message]
2014-10-21 14:12           ` Arnd Bergmann
2014-10-21 20:05             ` Pavel Machek
2014-10-18 21:36       ` One Thousand Gnomes
2014-10-19 22:01         ` Greg Kroah-Hartman
2014-10-17  9:26 ` Dan Carpenter
2014-10-19 22:05   ` Greg Kroah-Hartman
2014-10-20  9:20     ` Dan Carpenter
2014-10-20 23:32       ` Arve Hjønnevåg
     [not found]         ` <CAMP5Xgcm-sxd3rf3VA1ZO44bUT1+u_QG1AAdjzK39q0ynfsZGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-22  3:10           ` Rom Lemarchand
2014-10-22  3:16             ` Joe Perches
2014-10-24  5:00             ` Dan Carpenter
2014-10-17  9:43 ` Christoph Hellwig
2014-10-19 22:04   ` Greg Kroah-Hartman
     [not found]     ` <20141019220450.GB3780-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-10-21 10:46       ` Christoph Hellwig

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=20141021103622.GB23161@amd \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=anup.patel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rebecca-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=santosh.shilimkar-l0cyMroinI0@public.gmane.org \
    --cc=sumit.semwal-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /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).