netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, vladbu@mellanox.com
Subject: Re: [Patch net 8/9] act_ife: move tcfa_lock down to where necessary
Date: Mon, 20 Aug 2018 11:29:52 -0700 (PDT)	[thread overview]
Message-ID: <20180820.112952.2052634913677104782.davem@davemloft.net> (raw)
In-Reply-To: <20180819192213.14196-9-xiyou.wangcong@gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Sun, 19 Aug 2018 12:22:12 -0700

> The only time we need to take tcfa_lock is when adding
> a new metainfo to an existing ife->metalist. We don't need
> to take tcfa_lock so early and so broadly in tcf_ife_init().
> 
> This means we can always take ife_mod_lock first, avoid the
> reverse locking ordering warning as reported by Vlad.
> 
> Reported-by: Vlad Buslov <vladbu@mellanox.com>
> Tested-by: Vlad Buslov <vladbu@mellanox.com>
> Cc: Vlad Buslov <vladbu@mellanox.com>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

After this change we no longer call populate_metalist() in an atomic
context via tcf_ife_init(), and populate_metalist passes 'exists'
down to add_metainfo() as an 'atomic' indicator.  It doesn't have this
meaning if you aren't holding the tcfa_lock in the callers with BH
disabled.

Therefore, add_metainfo()'s 'atomic' indication is inaccurate in this
call chain and will use GFP_ATOMIC unnecessarily.

Probably the thing to just is just pass 'false' down to add_metainfo()
in populate_metalist().

  reply	other threads:[~2018-08-20 21:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-19 19:22 [Patch net 0/9] net_sched: pending clean up and bug fixes Cong Wang
2018-08-19 19:22 ` [Patch net 1/9] net_sched: improve and refactor tcf_action_put_many() Cong Wang
2018-08-19 19:22 ` [Patch net 2/9] net_sched: remove unnecessary ops->delete() Cong Wang
2018-08-19 19:22 ` [Patch net 3/9] net_sched: remove unused parameter for tcf_action_delete() Cong Wang
2018-08-19 19:22 ` [Patch net 4/9] net_sched: remove unused tcf_idr_check() Cong Wang
2018-08-19 19:22 ` [Patch net 5/9] net_sched: remove list_head from tc_action Cong Wang
2018-08-19 19:22 ` [Patch net 6/9] net_sched: remove unused tcfa_capab Cong Wang
2018-08-19 19:22 ` [Patch net 7/9] Revert "net: sched: act_ife: disable bh when taking ife_mod_lock" Cong Wang
2018-08-19 19:22 ` [Patch net 8/9] act_ife: move tcfa_lock down to where necessary Cong Wang
2018-08-20 18:29   ` David Miller [this message]
2018-08-20 23:57     ` Cong Wang
2018-08-21 19:43       ` David Miller
2018-08-19 19:22 ` [Patch net 9/9] act_ife: fix a potential deadlock Cong Wang
2018-08-21 20:00 ` [Patch net 0/9] net_sched: pending clean up and bug fixes David Miller

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=20180820.112952.2052634913677104782.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=vladbu@mellanox.com \
    --cc=xiyou.wangcong@gmail.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).