linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: remove judgement based on gfp_flags
Date: Mon, 27 Dec 2021 18:02:19 -0800	[thread overview]
Message-ID: <20211227180219.4fdaaeca@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> (raw)
In-Reply-To: <CAGWkznEOsLweqA3omJ+xMs4bWvyphSvKBQmqPs+rer_e5fqKHg@mail.gmail.com>

On Mon, 27 Dec 2021 15:38:31 +0800 Zhaoyang Huang wrote:
> On Mon, Dec 27, 2021 at 2:14 PM Zhaoyang Huang <huangzhaoyang@gmail.com> wrote:
> > On Fri, Dec 24, 2021 at 1:11 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > > This is checking if we can sleep AFAICT. What are you trying to fix?
> > Yes and NO. gfp means *get free pages* which indicate if the embedded
> > memory allocation among the process can sleep or not, but without any
> > other meanings. The driver which invokes this function could have to
> > use GFP_KERNEL for allocating memory as the critical resources but
> > don't want to sleep on the netlink's congestion.

Let's focus on explaining the problem you're trying to solve.
What's the driver you're talking about? Why does it have to
pay attention to the innards of netlink? Details, please.

> Since unique block flags(msg_flags & MSG_DONTWAIT) work as parameters
> for unicast, could we introduce it to broadcast, instead of abusing
> gfp_flag.
> 
>  static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
>  {
> ...
>          if (dst_group) {
>                  refcount_inc(&skb->users);
>                  netlink_broadcast(sk, skb, dst_portid, dst_group, GFP_KERNEL);
>          }
>          err = netlink_unicast(sk, skb, dst_portid, msg->msg_flags & MSG_DONTWAIT);

  reply	other threads:[~2021-12-28  2:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23  1:56 [PATCH] net: remove judgement based on gfp_flags Huangzhaoyang
2021-12-23 17:11 ` Jakub Kicinski
2021-12-27  6:14   ` Zhaoyang Huang
2021-12-27  7:38     ` Zhaoyang Huang
2021-12-28  2:02       ` Jakub Kicinski [this message]
2022-01-04  2:57 ` [net] 6f87debdea: BUG:scheduling_while_atomic kernel test robot

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=20211227180219.4fdaaeca@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zhaoyang.huang@unisoc.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).