netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net/core/neighbour: tell kmemleak about hash tables
Date: Fri, 11 Jan 2019 10:56:53 +0000	[thread overview]
Message-ID: <20190111105652.GA19375@arrakis.emea.arm.com> (raw)
In-Reply-To: <CALYGNiOHu5gif7Kqgt_LCMBBOHq-LxffSFJGn6Joi6dccDfptQ@mail.gmail.com>

On Fri, Jan 11, 2019 at 07:26:09AM +0300, Konstantin Khlebnikov wrote:
> On Thu, Jan 10, 2019 at 11:45 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > On Tue, Jan 8, 2019 at 1:30 AM Konstantin Khlebnikov
> > <khlebnikov@yandex-team.ru> wrote:
> > > @@ -443,12 +444,14 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
> > >         ret = kmalloc(sizeof(*ret), GFP_ATOMIC);
> > >         if (!ret)
> > >                 return NULL;
> > > -       if (size <= PAGE_SIZE)
> > > +       if (size <= PAGE_SIZE) {
> > >                 buckets = kzalloc(size, GFP_ATOMIC);
> > > -       else
> > > +       } else {
> > >                 buckets = (struct neighbour __rcu **)
> > >                           __get_free_pages(GFP_ATOMIC | __GFP_ZERO,
> > >                                            get_order(size));
> > > +               kmemleak_alloc(buckets, size, 0, GFP_ATOMIC);
> >
> > Why min_count is 0 rather than 1 here?
> 
> The api isn't clear and I've misread description.
> So it should be 1 for reporting leak of hash table itself.
> But 0 doesn't add any new issues.

Correct. I'd say it makes sense to set it to 1 so that you'd have
similar behaviour to the kzalloc() allocation.


-- 
Catalin

  parent reply	other threads:[~2019-01-11 10:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08  9:30 [PATCH] net/core/neighbour: tell kmemleak about hash tables Konstantin Khlebnikov
2019-01-08 11:59 ` Eric Dumazet
2019-01-08 12:56   ` Konstantin Khlebnikov
2019-01-10 14:35 ` David Miller
2019-01-10 14:35   ` David Miller
2019-01-10 18:09 ` Cong Wang
2019-01-10 18:09   ` Cong Wang
2019-01-11  4:26   ` Konstantin Khlebnikov
2019-01-11  4:26     ` Konstantin Khlebnikov
2019-01-11 10:56     ` Catalin Marinas [this message]
2019-01-11 10:56       ` Catalin Marinas

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=20190111105652.GA19375@arrakis.emea.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=khlebnikov@yandex-team.ru \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).