From: Marco Elver <elver@google.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexander Potapenko <glider@google.com>,
Jann Horn <jannh@google.com>,
Aleksandr Nogikh <nogikh@google.com>,
Taras Madan <tarasmadan@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
kasan-dev@googlegroups.com
Subject: Re: [PATCH v2 4/5] kfence: limit currently covered allocations when pool nearly full
Date: Tue, 21 Sep 2021 13:35:42 +0200 [thread overview]
Message-ID: <CANpmjNPuW47hwmLm=RXr6sXSzvAmz0_vo3m9UGgUbT_CQ=oSgg@mail.gmail.com> (raw)
In-Reply-To: <CACT4Y+Z6Rss3+oiN5bcKHYeQgG=nZ9VDqwrhOS4VUZ=_a5NoBw@mail.gmail.com>
On Tue, 21 Sept 2021 at 13:05, Dmitry Vyukov <dvyukov@google.com> wrote:
[...]
> > +/*
> > + * Adds (or subtracts) count @val for allocation stack trace hash
> > + * @alloc_stack_hash from Counting Bloom filter.
> > + */
> > +static void alloc_covered_add(u32 alloc_stack_hash, int val)
> > +{
> > + int i;
> > +
> > + if (!alloc_stack_hash)
> > + return;
>
> Nice!
> I like the hash seed, non-evicting cache and that threshold become a
> command line parameter.
>
> This check is the only place I don't understand. What's special about
> alloc_stack_hash == 0? I see that even double-free's won't call this
> with 0.
Indeed, it's no longer required (I think it was in a previous version
I played with). At this point, it should only be true if jhash()
returns 0 for something, and in that case might not even want the
check.
I can also remove the unnecessary "meta->alloc_stack_hash = 0;" in
kfence_guarded_free().
Unless I hear otherwise, I'll remove the unneeded code (and send a v3
of this series in a few days).
next prev parent reply other threads:[~2021-09-21 11:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 10:10 [PATCH v2 1/5] stacktrace: move filter_irq_stacks() to kernel/stacktrace.c Marco Elver
2021-09-21 10:10 ` [PATCH v2 2/5] kfence: count unexpectedly skipped allocations Marco Elver
2021-09-21 10:48 ` Dmitry Vyukov
2021-09-21 10:10 ` [PATCH v2 3/5] kfence: move saving stack trace of allocations into __kfence_alloc() Marco Elver
2021-09-21 10:50 ` Dmitry Vyukov
2021-09-21 10:10 ` [PATCH v2 4/5] kfence: limit currently covered allocations when pool nearly full Marco Elver
2021-09-21 11:05 ` Dmitry Vyukov
2021-09-21 11:35 ` Marco Elver [this message]
2021-09-21 10:10 ` [PATCH v2 5/5] kfence: add note to documentation about skipping covered allocations Marco Elver
2021-09-21 10:51 ` Dmitry Vyukov
2021-09-21 10:47 ` [PATCH v2 1/5] stacktrace: move filter_irq_stacks() to kernel/stacktrace.c Dmitry Vyukov
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='CANpmjNPuW47hwmLm=RXr6sXSzvAmz0_vo3m9UGgUbT_CQ=oSgg@mail.gmail.com' \
--to=elver@google.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=jannh@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nogikh@google.com \
--cc=tarasmadan@google.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