From: Andy Lutomirski <luto@kernel.org>
To: Daniel Axtens <dja@axtens.net>
Cc: Mark Rutland <mark.rutland@arm.com>,
Christophe Leroy <christophe.leroy@c-s.fr>,
kasan-dev <kasan-dev@googlegroups.com>,
Linux-MM <linux-mm@kvack.org>, X86 ML <x86@kernel.org>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Alexander Potapenko <glider@google.com>,
Andrew Lutomirski <luto@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Dmitry Vyukov <dvyukov@google.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory
Date: Mon, 19 Aug 2019 15:20:47 -0700 [thread overview]
Message-ID: <CALCETrXnvofB_2KciRL6gZBemtjwTVg4-EKSJx-nz-BULF5aMg@mail.gmail.com> (raw)
In-Reply-To: <87imqtu7pc.fsf@dja-thinkpad.axtens.net>
> On Aug 18, 2019, at 8:58 PM, Daniel Axtens <dja@axtens.net> wrote:
>
>>> Each page of shadow memory represent 8 pages of real memory. Could we use
>>> page_ref to count how many pieces of a shadow page are used so that we can
>>> free it when the ref count decreases to 0.
>
> I'm not sure how much of a difference it will make, but I'll have a look.
>
There are a grand total of eight possible pages that could require a
given shadow page. I would suggest that, instead of reference
counting, you just check all eight pages.
Or, better yet, look at the actual vm_area_struct and are where prev
and next point. That should tell you exactly which range can be freed.
next prev parent reply other threads:[~2019-08-19 22:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 0:16 [PATCH v4 0/3] kasan: support backing vmalloc space with real shadow memory Daniel Axtens
2019-08-15 0:16 ` [PATCH v4 1/3] " Daniel Axtens
2019-08-16 7:47 ` Christophe Leroy
2019-08-16 17:08 ` Mark Rutland
2019-08-16 17:41 ` Andy Lutomirski
2019-08-19 10:15 ` Mark Rutland
2019-08-19 3:58 ` Daniel Axtens
2019-08-19 22:20 ` Andy Lutomirski [this message]
2019-08-15 0:16 ` [PATCH v4 2/3] fork: support VMAP_STACK with KASAN_VMALLOC Daniel Axtens
2019-08-15 0:16 ` [PATCH v4 3/3] x86/kasan: support KASAN_VMALLOC Daniel Axtens
2019-08-16 8:04 ` Christophe Leroy
2019-08-15 11:28 ` [PATCH v4 0/3] kasan: support backing vmalloc space with real shadow memory Mark Rutland
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=CALCETrXnvofB_2KciRL6gZBemtjwTVg4-EKSJx-nz-BULF5aMg@mail.gmail.com \
--to=luto@kernel.org \
--cc=aryabinin@virtuozzo.com \
--cc=christophe.leroy@c-s.fr \
--cc=dja@axtens.net \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=gor@linux.ibm.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mark.rutland@arm.com \
--cc=x86@kernel.org \
/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).