Re: [RFC 0/7] netlink: Add allocation flag to netlink_unicast()

2016-07-08 Thread Masashi Honma
On 2016年07月06日 09:28, Masashi Honma wrote:
> Though netlink_broadcast() ...

Thanks for reply of David Miller, Eric Dumazet, David Teigrand.

On the basis of their comment, only rtnl_unicast() looks need to add gfp
flag
argument. So I will drop almost of patches except 0005.

I will send patch v2 to more limited destination.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 0/7] netlink: Add allocation flag to netlink_unicast()

2016-07-08 Thread Masashi Honma

On 2016年07月09日 01:08, David Teigland wrote:

On Thu, Jul 07, 2016 at 09:35:45AM +0900, Masashi Honma wrote:

At the fs/dlm/netlink.c#dlm_timeout_warn(),
prepare_data allocates buffer with GFP_NOFS
and send_data() sends the buffer.

But send_data() uses GFP_KERNEL or GFP_ATOMIC inside it.
Should it be replaced by GFP_NOFS ?

That's old code that's never been used so it doesn't really matter.


I see. Thank you.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 0/7] netlink: Add allocation flag to netlink_unicast()

2016-07-06 Thread Masashi Honma
At the fs/dlm/netlink.c#dlm_timeout_warn(),
prepare_data allocates buffer with GFP_NOFS
and send_data() sends the buffer.

But send_data() uses GFP_KERNEL or GFP_ATOMIC inside it.
Should it be replaced by GFP_NOFS ?

Masashi Honma

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 0/7] netlink: Add allocation flag to netlink_unicast()

2016-07-05 Thread David Miller
From: Masashi Honma 
Date: Wed,  6 Jul 2016 09:28:29 +0900

> Though currently such a use case was not found, to solve potential
> issue we will add an allocation flag to netlink_unicast().

We don't solve potential issues, we solve real issues.

There is no reason to add the GFP parameter until it is actually
needed.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC 0/7] netlink: Add allocation flag to netlink_unicast()

2016-07-05 Thread Masashi Honma
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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to