LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Javier Malave <javier.malave@narfindustries.com>
To: bx@narfindustries.com
Cc: Javier Malave <javier.malave@narfindustries.com>,
	linux-kernel@vger.kernel.org, ah@narfindustries.com
Subject: [RFC 4/9] Popcorn system call additions
Date: Wed, 29 Apr 2020 15:32:51 -0400
Message-ID: <1d44b88fe4435a6ff0db629ac6883e6b01844019.1588127445.git.javier.malave@narfindustries.com> (raw)
In-Reply-To: <cover.1588127445.git.javier.malave@narfindustries.com>
In-Reply-To: <cover.1588127445.git.javier.malave@narfindustries.com>

The Popcorn system calls are a core component of
Popcorn Linux. All system calls have been added 
to kernel/sched/core.c

The main system call is popcorn_migrate. User
applications may invoke this system call to trigger
a migration from their origin node to a remote
node; and vice-versa. The system call relies on
several "server modules" (process server, vma server,
page server) to perform the migration and maintain
VMA coherency. A message layer for IPC has been
also added to communicate Popcorn messages across
the distributed threads. You may find a basic
example of the system call at the Popcorn kernel
library. All three system calls are showcased in the
Popcorn kernel library.
---
 arch/x86/entry/syscalls/syscall_64.tbl |  3 +++
 include/linux/syscalls.h               |  9 +++++++++
 include/uapi/asm-generic/unistd.h      | 11 +++++++++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index b4e6f9e62..5f8aff57e 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -355,6 +355,9 @@
 431	common	fsconfig		__x64_sys_fsconfig
 432	common	fsmount			__x64_sys_fsmount
 433	common	fspick			__x64_sys_fspick
+434	64	popcorn_migrate		__x64_sys_popcorn_migrate
+435	64	popcorn_get_thread_status	__x64_sys_popcorn_get_thread_status
+436	64	popcorn_get_node_info	__x64_sys_popcorn_get_node_info
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2bcef4c70..e8e4430d5 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1250,6 +1250,15 @@ ssize_t ksys_pread64(unsigned int fd, char __user *buf, size_t count,
 ssize_t ksys_pwrite64(unsigned int fd, const char __user *buf,
 		      size_t count, loff_t pos);
 int ksys_fallocate(int fd, int mode, loff_t offset, loff_t len);
+#ifdef CONFIG_POPCORN
+long ksys_brk(unsigned long brk);
+long ksys_mremap(unsigned long addr,
+		 unsigned long old_len, unsigned long new_len,
+		 unsigned long flags, unsigned long new_addr);
+long ksys_madvise(unsigned long start, size_t len, int behavior);
+long ksys_mprotect(unsigned long start, size_t len,
+		  unsigned long prot);
+#endif
 #ifdef CONFIG_ADVISE_SYSCALLS
 int ksys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
 #else
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index a87904daf..71a526a1b 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -844,9 +844,16 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)
 __SYSCALL(__NR_fsmount, sys_fsmount)
 #define __NR_fspick 433
 __SYSCALL(__NR_fspick, sys_fspick)
-
+#ifdef CONFIG_POPCORN
+#define __NR_popcorn_migrate 434
+__SYSCALL(__NR_popcorn_migrate, sys_popcorn_migrate)
+#define __NR_popcorn_get_thread_status 435
+__SYSCALL(__NR_popcorn_get_thread_status, sys_popcorn_get_thread_status)
+#define __NR_popcorn_get_node_info 436
+__SYSCALL(__NR_popcorn_get_node_info, sys_popcorn_get_node_info)
+#endif
 #undef __NR_syscalls
-#define __NR_syscalls 434
+#define __NR_syscalls 437
 
 /*
  * 32 bit systems traditionally used different
-- 
2.17.1


  parent reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0>
2020-04-29 19:32 ` [RFC 0/9] Popcorn Linux Distributed Thread Execution Javier Malave
2020-04-29 19:32   ` [RFC 1/9] Core Popcorn Changes Javier Malave
2020-04-29 19:32   ` [RFC 2/9] Add x86 specifc files for Popcorn Javier Malave
2020-04-29 19:32   ` [RFC 3/9] Temporary revert L1TF mitigation " Javier Malave
2020-04-29 19:32   ` Javier Malave [this message]
2020-04-29 19:32   ` [RFC 5/9] Popcorn Utility Javier Malave
2020-04-29 19:32   ` [RFC 6/9] Process Server for Popcorn Distributed Thread Execution Javier Malave
2020-04-29 19:32   ` [RFC 7/9] Virtual Memory Address Server for " Javier Malave
2020-04-29 19:32   ` [RFC 8/9] Page " Javier Malave
2020-04-29 19:32   ` [RFC 9/9] Add Popcorn Message Layer and socket support Javier Malave
2020-05-07 17:46   ` [RFC 0/9] Popcorn Linux Distributed Thread Execution Pavel Machek

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=1d44b88fe4435a6ff0db629ac6883e6b01844019.1588127445.git.javier.malave@narfindustries.com \
    --to=javier.malave@narfindustries.com \
    --cc=ah@narfindustries.com \
    --cc=bx@narfindustries.com \
    --cc=linux-kernel@vger.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git