cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Masashi Honma <masashi.honma@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC 0/7] netlink: Add allocation flag to netlink_unicast()
Date: Wed,  6 Jul 2016 09:28:29 +0900	[thread overview]
Message-ID: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com> (raw)

Though netlink_broadcast() has allocation flag which can specify
memory allocation type (ex. GFP_KERNEL/GFP_ATOMIC), netlink_unicast()
does not have it. This can cause "BUG: sleeping function called from
invalid context at" with CONFIG_DEBUG_ATOMIC_SLEEP enabled kernel when
calling netlink_unicast() inside RCU read-side section and not in IRQ.

Though currently such a use case was not found, to solve potential
issue we will add an allocation flag to netlink_unicast(). Previously
netlink_unicast() have used gfp_any() as a flag. We replaced it to
GFP_KERNEL or GFP_ATOMIC or etc by guessing based on context. If we
could not determine the value, we remain it gfp_any(). We welcome
comments like "this gfp_any() should be GFP_KERNEL". Of course other
comments are welcome as well.

This series of patches are not tested.
This is a RFC because this does not fix existing issue.

Masashi Honma (7):
  netlink: Add allocation flag to netlink_unicast()
  netfilter: Add allocation flag to nfnetlink_unicast()
  netlink: Add allocation flag to nlmsg_unicast()
  infiniband: Add allocation flag to ibnl_unicast()
  net: Add allocation flag to rtnl_unicast()
  genetlink: Add allocation flag to genlmsg_unicast()
  genetlink: Add allocation flag to genlmsg_reply()

 crypto/crypto_user.c                  |  3 ++-
 drivers/block/drbd/drbd_nl.c          |  2 +-
 drivers/connector/connector.c         |  2 +-
 drivers/infiniband/core/iwpm_msg.c    |  6 ++---
 drivers/infiniband/core/iwpm_util.c   |  5 ++--
 drivers/infiniband/core/iwpm_util.h   |  1 +
 drivers/infiniband/core/netlink.c     |  4 ++--
 drivers/net/gtp.c                     |  3 ++-
 drivers/net/team/team.c               |  5 ++--
 drivers/net/wireless/mac80211_hwsim.c |  4 ++--
 fs/dlm/netlink.c                      |  2 +-
 include/linux/netfilter/nfnetlink.h   |  2 +-
 include/linux/netlink.h               |  3 ++-
 include/linux/rtnetlink.h             |  3 ++-
 include/net/genetlink.h               | 13 +++++++----
 include/net/netlink.h                 |  6 +++--
 include/rdma/rdma_netlink.h           |  3 ++-
 kernel/audit.c                        |  9 ++++----
 kernel/taskstats.c                    |  4 ++--
 net/core/devlink.c                    | 12 +++++-----
 net/core/net_namespace.c              |  2 +-
 net/core/rtnetlink.c                  | 12 ++++++----
 net/dcb/dcbnl.c                       |  2 +-
 net/decnet/dn_route.c                 |  3 ++-
 net/hsr/hsr_netlink.c                 |  6 +++--
 net/ieee802154/ieee802154.h           |  3 ++-
 net/ieee802154/netlink.c              |  5 ++--
 net/ieee802154/nl-mac.c               |  4 ++--
 net/ieee802154/nl-phy.c               |  6 ++---
 net/ieee802154/nl802154.c             |  4 ++--
 net/ipv4/devinet.c                    |  2 +-
 net/ipv4/fib_frontend.c               |  2 +-
 net/ipv4/fou.c                        |  2 +-
 net/ipv4/inet_diag.c                  |  2 +-
 net/ipv4/ipmr.c                       |  6 +++--
 net/ipv4/route.c                      |  2 +-
 net/ipv4/tcp_metrics.c                |  2 +-
 net/ipv4/udp_diag.c                   |  2 +-
 net/ipv6/addrconf.c                   |  4 ++--
 net/ipv6/addrlabel.c                  |  2 +-
 net/ipv6/ila/ila_xlat.c               |  2 +-
 net/ipv6/ip6mr.c                      |  6 +++--
 net/ipv6/route.c                      |  2 +-
 net/irda/irnetlink.c                  |  2 +-
 net/l2tp/l2tp_netlink.c               |  8 ++++---
 net/netfilter/ipset/ip_set_core.c     | 11 +++++----
 net/netfilter/ipvs/ip_vs_ctl.c        |  2 +-
 net/netfilter/nf_conntrack_netlink.c  |  9 +++++---
 net/netfilter/nf_tables_api.c         | 10 ++++----
 net/netfilter/nfnetlink.c             |  4 ++--
 net/netfilter/nfnetlink_acct.c        |  2 +-
 net/netfilter/nfnetlink_cthelper.c    |  2 +-
 net/netfilter/nfnetlink_cttimeout.c   |  5 ++--
 net/netfilter/nfnetlink_log.c         |  4 ++--
 net/netfilter/nfnetlink_queue.c       |  3 ++-
 net/netfilter/nft_compat.c            |  4 ++--
 net/netlabel/netlabel_cipso_v4.c      |  2 +-
 net/netlabel/netlabel_mgmt.c          |  4 ++--
 net/netlabel/netlabel_unlabeled.c     |  2 +-
 net/netlink/af_netlink.c              | 14 +++++++-----
 net/netlink/genetlink.c               |  2 +-
 net/nfc/netlink.c                     |  6 ++---
 net/openvswitch/datapath.c            |  9 ++++----
 net/sched/act_api.c                   |  2 +-
 net/sctp/sctp_diag.c                  |  2 +-
 net/tipc/bearer.c                     |  4 ++--
 net/tipc/netlink_compat.c             |  2 +-
 net/tipc/node.c                       |  2 +-
 net/unix/diag.c                       |  2 +-
 net/wireless/nl80211.c                | 43 ++++++++++++++++++-----------------
 net/xfrm/xfrm_user.c                  | 15 +++++++-----
 samples/connector/cn_test.c           |  2 +-
 72 files changed, 199 insertions(+), 155 deletions(-)

-- 
2.7.4



             reply	other threads:[~2016-07-06  0:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06  0:28 Masashi Honma [this message]
2016-07-06  0:28 ` [Cluster-devel] [RFC 1/7] netlink: Add allocation flag to netlink_unicast() Masashi Honma
2016-07-06  0:28 ` [Cluster-devel] [RFC 2/7] netfilter: Add allocation flag to nfnetlink_unicast() Masashi Honma
2016-07-06  0:28 ` [Cluster-devel] [RFC 3/7] netlink: Add allocation flag to nlmsg_unicast() Masashi Honma
2016-07-06  0:28 ` [Cluster-devel] [RFC 4/7] infiniband: Add allocation flag to ibnl_unicast() Masashi Honma
2016-07-06  0:28 ` [Cluster-devel] [RFC 5/7] net: Add allocation flag to rtnl_unicast() Masashi Honma
2016-07-08  2:56   ` Eric Dumazet
2016-07-08  3:15     ` Masashi Honma
2016-07-08  4:00       ` Eric Dumazet
2016-07-06  0:28 ` [Cluster-devel] [RFC 6/7] genetlink: Add allocation flag to genlmsg_unicast() Masashi Honma
2016-07-06  0:28 ` [Cluster-devel] [RFC 7/7] genetlink: Add allocation flag to genlmsg_reply() Masashi Honma
2016-07-06  3:22 ` [Cluster-devel] [RFC 0/7] netlink: Add allocation flag to netlink_unicast() David Miller
2016-07-07  0:35 ` Masashi Honma
     [not found]   ` <20160708160821.GA2048@redhat.com>
2016-07-09  3:52     ` Masashi Honma
2016-07-09  3:54 ` Masashi Honma

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=1467764916-4983-1-git-send-email-masashi.honma@gmail.com \
    --to=masashi.honma@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).