From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: [PATCH 1 of 3] xenpaging: convert xenpaging_victim_t to struct victim
Date: Mon, 09 Jan 2012 17:09:37 +0100 [thread overview]
Message-ID: <dfcef53aa44f76b0dc13.1326125377@probook.site> (raw)
In-Reply-To: <patchbomb.1326125376@probook.site>
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1326125241 -3600
# Node ID dfcef53aa44f76b0dc13fa2acb012f4158da5c7b
# Parent 3a22ed3ec534799b3cab55b0dc0a7380e701ecbe
xenpaging: convert xenpaging_victim_t to struct victim
Signed-off-by: Olaf Hering <olaf@aepfle.de>
diff -r 3a22ed3ec534 -r dfcef53aa44f tools/xenpaging/policy.h
--- a/tools/xenpaging/policy.h
+++ b/tools/xenpaging/policy.h
@@ -29,7 +29,7 @@
int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
void policy_notify_paged_out(unsigned long gfn);
void policy_notify_paged_in(unsigned long gfn);
void policy_notify_paged_in_nomru(unsigned long gfn);
diff -r 3a22ed3ec534 -r dfcef53aa44f tools/xenpaging/policy_default.c
--- a/tools/xenpaging/policy_default.c
+++ b/tools/xenpaging/policy_default.c
@@ -77,7 +77,7 @@ int policy_init(xenpaging_t *paging)
return rc;
}
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim)
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
{
xc_interface *xch = paging->xc_handle;
unsigned long wrap = current_gfn;
diff -r 3a22ed3ec534 -r dfcef53aa44f tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -562,8 +562,7 @@ static void put_response(mem_event_t *me
RING_PUSH_RESPONSES(back_ring);
}
-static int xenpaging_evict_page(xenpaging_t *paging,
- xenpaging_victim_t *victim, int fd, int i)
+static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
void *page;
@@ -712,8 +711,7 @@ static void resume_pages(xenpaging_t *pa
page_in_trigger();
}
-static int evict_victim(xenpaging_t *paging,
- xenpaging_victim_t *victim, int fd, int i)
+static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
int j = 0;
@@ -756,7 +754,7 @@ static int evict_victim(xenpaging_t *pag
}
/* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
{
xc_interface *xch = paging->xc_handle;
int rc, slot, num = 0;
@@ -783,7 +781,7 @@ int main(int argc, char *argv[])
{
struct sigaction act;
xenpaging_t *paging;
- xenpaging_victim_t *victims;
+ struct victim *victims;
mem_event_request_t req;
mem_event_response_t rsp;
int num, prev_num = 0;
@@ -817,7 +815,7 @@ int main(int argc, char *argv[])
}
/* Allocate upper limit of pages to allow growing and shrinking */
- victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+ victims = calloc(paging->max_pages, sizeof(struct victim));
if ( !victims )
goto out;
diff -r 3a22ed3ec534 -r dfcef53aa44f tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h
+++ b/tools/xenpaging/xenpaging.h
@@ -57,10 +57,10 @@ typedef struct xenpaging {
} xenpaging_t;
-typedef struct xenpaging_victim {
+struct victim {
/* the gfn of the page to evict */
unsigned long gfn;
-} xenpaging_victim_t;
+};
extern void create_page_in_thread(xenpaging_t *paging);
next prev parent reply other threads:[~2012-01-09 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-09 16:09 [PATCH 0 of 3] tools/xenpaging: remove typedefs Olaf Hering
2012-01-09 16:09 ` Olaf Hering [this message]
2012-01-09 16:09 ` [PATCH 2 of 3] xenpaging: convert xenpaging_t to struct xenpaging Olaf Hering
2012-01-09 16:09 ` [PATCH 3 of 3] xenpaging: convert mem_event_t to struct mem_event Olaf Hering
2012-01-10 17:02 ` [PATCH 0 of 3] tools/xenpaging: remove typedefs Ian Jackson
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=dfcef53aa44f76b0dc13.1326125377@probook.site \
--to=olaf@aepfle.de \
--cc=xen-devel@lists.xensource.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).