From: Doug Goldstein <cardoe@cardoe.com>
To: xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>, Doug Goldstein <cardoe@cardoe.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH 2/5] tmem: drop direct usage of opt_tmem
Date: Mon, 14 Mar 2016 15:29:22 -0500 [thread overview]
Message-ID: <1457987365-866-3-git-send-email-cardoe@cardoe.com> (raw)
In-Reply-To: <1457987365-866-1-git-send-email-cardoe@cardoe.com>
Don't use the opt_tmem variable to check if tmem is enabled, instead use
the tmem_enabled() helper function everywhere.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
xen/arch/x86/setup.c | 2 +-
xen/common/memory.c | 2 +-
xen/common/page_alloc.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 5485468..7181624 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1243,7 +1243,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
init_domheap_pages(s, e);
}
- if ( opt_tmem )
+ if ( tmem_enabled() )
{
printk(XENLOG_WARNING
"TMEM physical RAM limit exceeded, disabling TMEM\n");
diff --git a/xen/common/memory.c b/xen/common/memory.c
index ef57219..c7fca96 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -202,7 +202,7 @@ static void populate_physmap(struct memop_args *a)
if ( unlikely(!page) )
{
- if ( !opt_tmem || a->extent_order )
+ if ( !tmem_enabled() || a->extent_order )
gdprintk(XENLOG_INFO,
"Could not allocate order=%u extent: id=%d memflags=%#x (%u of %u)\n",
a->extent_order, d->domain_id, a->memflags,
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 22e8feb..1e6246e 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -652,7 +652,7 @@ static void __init setup_low_mem_virq(void)
static void check_low_mem_virq(void)
{
unsigned long avail_pages = total_avail_pages +
- (opt_tmem ? tmem_freeable_pages() : 0) - outstanding_claims;
+ (tmem_enabled() ? tmem_freeable_pages() : 0) - outstanding_claims;
if ( unlikely(avail_pages <= low_mem_virq_th) )
{
@@ -738,7 +738,7 @@ static struct page_info *alloc_heap_pages(
* Others try tmem pools then fail. This is a workaround until all
* post-dom0-creation-multi-page allocations can be eliminated.
*/
- if ( opt_tmem && ((order == 0) || (order >= 9)) &&
+ if ( tmem_enabled() && ((order == 0) || (order >= 9)) &&
(total_avail_pages <= midsize_alloc_zone_pages) &&
tmem_freeable_pages() )
goto try_tmem;
@@ -984,7 +984,7 @@ static void free_heap_pages(
avail[node][zone] += 1 << order;
total_avail_pages += 1 << order;
- if ( opt_tmem )
+ if ( tmem_enabled() )
midsize_alloc_zone_pages = max(
midsize_alloc_zone_pages, total_avail_pages / MIDSIZE_ALLOC_FRAC);
@@ -1755,7 +1755,7 @@ int assign_pages(
{
if ( unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
{
- if ( !opt_tmem || order != 0 || d->tot_pages != d->max_pages )
+ if ( !tmem_enabled() || order != 0 || d->tot_pages != d->max_pages )
gprintk(XENLOG_INFO, "Over-allocation for domain %u: "
"%u > %u\n", d->domain_id,
d->tot_pages + (1 << order), d->max_pages);
--
2.4.10
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-14 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 20:29 [PATCH 0/5] Allow tmem to be disabled via Kconfig Doug Goldstein
2016-03-14 20:29 ` [PATCH 1/5] tmem: add tmem_disable() function Doug Goldstein
2016-03-15 8:12 ` Jan Beulich
2016-03-14 20:29 ` Doug Goldstein [this message]
2016-03-15 8:15 ` [PATCH 2/5] tmem: drop direct usage of opt_tmem Jan Beulich
2016-03-14 20:29 ` [PATCH 3/5] tmem: make tmem_freeable_pages() check tmem status Doug Goldstein
2016-03-15 8:17 ` Jan Beulich
2016-03-14 20:29 ` [PATCH 4/5] tmem: don't assume stdbool.h is included Doug Goldstein
2016-03-15 8:23 ` Jan Beulich
2016-03-14 20:29 ` [PATCH 5/5] tmem: allow tmem to be disabled with Kconfig Doug Goldstein
2016-03-15 8:31 ` Jan Beulich
2016-03-15 18:28 ` Doug Goldstein
2016-03-15 19:04 ` Doug Goldstein
2016-03-16 8:36 ` Jan Beulich
2016-03-14 20:46 ` [PATCH 0/5] Allow tmem to be disabled via Kconfig Konrad Rzeszutek Wilk
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=1457987365-866-3-git-send-email-cardoe@cardoe.com \
--to=cardoe@cardoe.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.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).