From: Peter Lieven <pl@kamp.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, pbonzini@redhat.com,
mst@redhat.com, dgilbert@redhat.com, peter.maydell@linaro.org,
eblake@redhat.com, rth@twiddle.net, armbru@redhat.com,
Peter Lieven <pl@kamp.de>
Subject: [Qemu-devel] [PATCH V8 0/6] coroutine: mmap stack memory and stack size
Date: Mon, 26 Sep 2016 13:44:26 +0200 [thread overview]
Message-ID: <1474890272-22952-1-git-send-email-pl@kamp.de> (raw)
I decided to split this from the rest of the Qemu RSS usage series as
it contains the more or less non contentious patches.
I omitted the MAP_GROWSDOWN flag in mmap as we are not 100% sure which
side effects it has.
I kept the guard page which is now nicely makes the stacks visible in
smaps. The old version of the relevent patch lacked the MAP_FIXED flag
in the second call to mmap.
v7->v8:
The series failed on platforms with 64kB page size. Thus the following changes
where made:
- Patch 1: add the guard page to the stack memory and do not deduct it [Kevin, Stephan]
- Patch 1: Submit the requested page size as a pointer so that qemu_alloc_stack can
adjust the size according to system requirements and that the full size is usable
to the caller.
- Patch 6: reduced stack size to 60kB so that on systems with 4kB page size we still get
64kB allocations.
v6->v7:
- Patch 1: avoid multiple calls to sysconf and getpagesize [Richard]
v5->v6:
- Patch 1: added info that the guard page is deducted from stack memory to
commit msg and headers [Stefan]
- rebased to master
v4->v5:
- Patch 1: check if _SC_THREAD_STACK_MIN is defined
- Patch 1: guard against sysconf(_SC_THREAD_STACK_MIN) returning -1 [Eric]
v3->v4:
- Patch 1: add a static function to adjust the stack size [Richard]
- Patch 1: round up the stack size to multiple of the pagesize.
v2->v3:
- Patch 1,6: adjusted commit message to mention the guard page [Markus]
v1->v2:
- Patch 1: added an architecture dependend guard page [Richard]
- Patch 1: avoid stacks smaller than _SC_THREAD_STACK_MIN [Richard]
- Patch 1: use mmap+mprotect instead of mmap+mmap [Richard]
- Patch 5: u_int32_t -> uint32_t [Richard]
- Patch 5: only available if stack grows down
Peter Lieven (6):
oslib-posix: add helpers for stack alloc and free
coroutine: add a macro for the coroutine stack size
coroutine-ucontext: use helper for allocating stack memory
coroutine-sigaltstack: use helper for allocating stack memory
oslib-posix: add a configure switch to debug stack usage
coroutine: reduce stack size to 60kB
configure | 19 +++++++++++
include/qemu/coroutine_int.h | 2 ++
include/sysemu/os-posix.h | 27 +++++++++++++++
util/coroutine-sigaltstack.c | 9 ++---
util/coroutine-ucontext.c | 11 +++---
util/coroutine-win32.c | 2 +-
util/oslib-posix.c | 81 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 141 insertions(+), 10 deletions(-)
--
1.9.1
next reply other threads:[~2016-09-26 11:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 11:44 Peter Lieven [this message]
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 1/6] oslib-posix: add helpers for stack alloc and free Peter Lieven
2016-09-26 13:44 ` Kevin Wolf
2016-09-26 14:43 ` Peter Lieven
2016-09-26 14:51 ` Kevin Wolf
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 2/6] coroutine: add a macro for the coroutine stack size Peter Lieven
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 3/6] coroutine-ucontext: use helper for allocating stack memory Peter Lieven
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 4/6] coroutine-sigaltstack: " Peter Lieven
2016-09-26 13:51 ` Kevin Wolf
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 5/6] oslib-posix: add a configure switch to debug stack usage Peter Lieven
2016-09-26 11:44 ` [Qemu-devel] [PATCH V8 6/6] coroutine: reduce stack size to 60kB Peter Lieven
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=1474890272-22952-1-git-send-email-pl@kamp.de \
--to=pl@kamp.de \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).