linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	YueHaibing <yuehaibing@huawei.com>,
	Maya Erez <merez@codeaurora.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	kernel-janitors@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] wil6210: fix debugfs_simple_attr.cocci warnings
Date: Sat, 6 Oct 2018 14:22:58 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1810061422030.2363@hadrien> (raw)
In-Reply-To: <87pnwnff65.fsf@kamboji.qca.qualcomm.com>



On Sat, 6 Oct 2018, Kalle Valo wrote:

> Julia Lawall <julia.lawall@lip6.fr> writes:
>
> > On Fri, 5 Oct 2018, Kalle Valo wrote:
> >
> >> YueHaibing <yuehaibing@huawei.com> writes:
> >>
> >> > Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
> >> > for debugfs files.
> >> >
> >> > Semantic patch information:
> >> > Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
> >> > imposes some significant overhead as compared to
> >> > DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().
> >> >
> >> > Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
> >>
> >> Just out of curiosity, what kind of overhead are we talking about here?
> >
> > The log message on the commit introducing the semantic patch says the
> > following:
> >
> >     In order to protect against file removal races, debugfs files created via
> >     debugfs_create_file() now get wrapped by a struct file_operations at their
> >     opening.
> >
> >     If the original struct file_operations are known to be safe against removal
> >     races by themselves already, the proxy creation may be bypassed by creating
> >     the files through debugfs_create_file_unsafe().
> >
> >     In order to help debugfs users who use the common
> >       DEFINE_SIMPLE_ATTRIBUTE() + debugfs_create_file()
> >     idiom to transition to removal safe struct file_operations, the helper
> >     macro DEFINE_DEBUGFS_ATTRIBUTE() has been introduced.
> >
> >     Thus, the preferred strategy is to use
> >       DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe()
> >     now.
>
> I admit that I didn't have time to investigate this is detail but I'm
> still not understanding where is that "significant overhead" coming from
> and how big of overhead are we talking about? I guess it has something
> to do with full_proxy_open() vs open_proxy_open()?
>
> Not that I'm against this patch, just curious when I see someone
> claiming "significant overhead" which is not obvious for me.

The message with the semantic patch doesn't really talk about significant
overhead.  Maybe YueHaibing can discuss with the person who proposed the
semantic patch what the actual issue is, and when the proposed change is
actually applicable.

julia


>
> --
> Kalle Valo
>

  reply	other threads:[~2018-10-06 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 11:07 [PATCH] wil6210: fix debugfs_simple_attr.cocci warnings YueHaibing
2018-10-05 11:04 ` Kalle Valo
2018-10-05 11:51   ` YueHaibing
2018-10-05 14:29   ` Julia Lawall
2018-10-06 12:11     ` Kalle Valo
2018-10-06 12:22       ` Julia Lawall [this message]
2018-10-06 12:54         ` Kalle Valo
2018-10-13 17:29 ` Kalle Valo

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=alpine.DEB.2.21.1810061422030.2363@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=merez@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=wil6210@qti.qualcomm.com \
    --cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).