From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Shuah Khan <shuahkh@osg.samsung.com>,
Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH 1/5] [media] media-device: get rid of the spinlock
Date: Wed, 16 Mar 2016 10:10:21 -0300 [thread overview]
Message-ID: <20160316101021.60274478@recife.lan> (raw)
In-Reply-To: <CABxcv=k+MQE7Q+d_g=NgKqgwVqyg9J4LhXhjVyF9kartMt_PJw@mail.gmail.com>
Em Wed, 16 Mar 2016 09:53:12 -0300
Javier Martinez Canillas <javier@dowhile0.org> escreveu:
> Hello Mauro,
>
> On Wed, Mar 16, 2016 at 9:04 AM, Mauro Carvalho Chehab
> <mchehab@osg.samsung.com> wrote:
> > Right now, the lock schema for media_device struct is messy,
> > since sometimes, it is protected via a spin lock, while, for
> > media graph traversal, it is protected by a mutex.
> >
> > Solve this conflict by always using a mutex.
> >
> > As a side effect, this prevents a bug where the media notifiers
> > were called at atomic context.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Btw, I'm running a stress test here, doing bind/unbind on au0828,
while calling mc_nextgen_test:
Running one instance of this loop:
$ i=0; while :; do i=$((i+1)); echo "loop $i"; sudo su -c "echo 1-3.1.2:1.0 > /sys/bus/usb/drivers/au0828/bind"; sudo su -c "echo 1-3.1.2:1.0 > /sys/bus/usb/drivers/au0828/unbind"; done
and 3 instances of this loop:
$ while :; do clear; mc_nextgen_test; done
My test machine has 4 CPUs, so this should be enough to check
if the mutexes at ioctl and at the register/unregister functions
are ok.
Right now, the loop ran 160 times. Not a single trouble.
Ok, it is not doing any graph traversal ops, but the code seems to be
pretty much reliable with mutexes.
I'll keep it running for more time to be sure, but it seems that
the current media core works fine for dynamic
entity/interface/link addition/removal.
Regards,
Mauro
> > ---
>
> I agree with the patch.
>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> Best regards,
> Javier
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks,
Mauro
next prev parent reply other threads:[~2016-03-16 13:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 12:04 [PATCH 1/5] [media] media-device: get rid of the spinlock Mauro Carvalho Chehab
2016-03-16 12:04 ` [PATCH 2/5] [media] media-device: Fix a comment Mauro Carvalho Chehab
2016-03-16 12:58 ` Javier Martinez Canillas
2016-03-16 12:04 ` [PATCH 3/5] [media] au0828: Unregister notifiers Mauro Carvalho Chehab
2016-03-16 13:11 ` Javier Martinez Canillas
2016-03-22 19:55 ` Shuah Khan
2016-03-16 12:04 ` [PATCH 4/5] [media] media-device: use kref for media_device instance Mauro Carvalho Chehab
2016-03-16 13:23 ` Javier Martinez Canillas
2016-03-16 14:05 ` Shuah Khan
2016-03-16 14:25 ` Mauro Carvalho Chehab
2016-03-16 14:32 ` Shuah Khan
2016-03-17 11:50 ` Sakari Ailus
2016-03-18 11:17 ` Mauro Carvalho Chehab
2016-03-18 13:10 ` Sakari Ailus
2016-03-22 19:56 ` Shuah Khan
2016-03-22 20:07 ` Shuah Khan
2016-03-16 12:04 ` [PATCH 5/5] [media] media-device: make media_device_cleanup() static Mauro Carvalho Chehab
2016-03-16 14:03 ` Javier Martinez Canillas
2016-03-16 14:36 ` Mauro Carvalho Chehab
2016-03-16 14:38 ` Javier Martinez Canillas
2016-03-22 19:57 ` Shuah Khan
2016-03-16 12:53 ` [PATCH 1/5] [media] media-device: get rid of the spinlock Javier Martinez Canillas
2016-03-16 13:10 ` Mauro Carvalho Chehab [this message]
2016-03-16 14:10 ` Sakari Ailus
2016-03-22 19:52 ` Shuah Khan
2016-03-24 22:11 ` Laurent Pinchart
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=20160316101021.60274478@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=javier@dowhile0.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=sakari.ailus@iki.fi \
--cc=shuahkh@osg.samsung.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