From: Hugo Lefeuvre <hle@owl.eu.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernelnewbies@kernelnewbies.org
Subject: Re: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues
Date: Sat, 2 Jun 2018 14:08:08 -0400 [thread overview]
Message-ID: <20180602180808.GA2052@hle-laptop.local> (raw)
In-Reply-To: <20180601160954.GA4895@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
Hi,
> Unless you can measure the performance difference, do not use a rw
> semaphore, just use a normal mutex please. Odds are it will be faster
> in the end and take up less space.
>
> So please test, or if you can't test, just use a mutex.
I don't have the device yet, so I won't be able to test. I have opted for the
mutex instead.
I have just sent an updated version fixing another issue in my code: The
mutex can't be included in pi433_instance because we have to lock it
before dereferencing our pi433_instance pointer. The best solution I
could think of was to create a wrapper struct pi433_data which would contain
pointers to the pi433_instance and its mutex. I couldn't find any
similar situation in the kernel, so I'm not sure it's the right way to
go though.
Thanks !
Regards,
Hugo
--
Hugo Lefeuvre (hle) | www.owl.eu.com
4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2018-06-02 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 12:50 Hugo Lefeuvre
2018-06-01 13:32 ` valdis.kletnieks
2018-06-01 13:51 ` Hugo Lefeuvre
2018-06-01 16:09 ` Greg Kroah-Hartman
2018-06-02 18:08 ` Hugo Lefeuvre [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=20180602180808.GA2052@hle-laptop.local \
--to=hle@owl.eu.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®