From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx207.postini.com [74.125.245.207]) by kanga.kvack.org (Postfix) with SMTP id E7DBC6B009B for ; Thu, 28 Jun 2012 08:57:09 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 10/40] autonuma: mm_autonuma and sched_autonuma data structures Date: Thu, 28 Jun 2012 14:55:50 +0200 Message-Id: <1340888180-15355-11-git-send-email-aarcange@redhat.com> In-Reply-To: <1340888180-15355-1-git-send-email-aarcange@redhat.com> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt Define the two data structures that collect the per-process (in the mm) and per-thread (in the task_struct) statistical information that are the input of the CPU follow memory algorithms in the NUMA scheduler. Signed-off-by: Andrea Arcangeli --- include/linux/autonuma_types.h | 68 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) create mode 100644 include/linux/autonuma_types.h diff --git a/include/linux/autonuma_types.h b/include/linux/autonuma_types.h new file mode 100644 index 0000000..9e697e3 --- /dev/null +++ b/include/linux/autonuma_types.h @@ -0,0 +1,68 @@ +#ifndef _LINUX_AUTONUMA_TYPES_H +#define _LINUX_AUTONUMA_TYPES_H + +#ifdef CONFIG_AUTONUMA + +#include + +/* + * Per-mm (process) structure dynamically allocated only if autonuma + * is not impossible. This links the mm to scan into the + * knuma_scand.mm_head and it contains the NUMA memory placement + * statistics for the process (generated by knuma_scand). + */ +struct mm_autonuma { + /* list node to link the "mm" into the knuma_scand.mm_head */ + struct list_head mm_node; + struct mm_struct *mm; + unsigned long mm_numa_fault_pass; /* zeroed from here during allocation */ + unsigned long mm_numa_fault_tot; + unsigned long mm_numa_fault[0]; +}; + +extern int alloc_mm_autonuma(struct mm_struct *mm); +extern void free_mm_autonuma(struct mm_struct *mm); +extern void __init mm_autonuma_init(void); + +/* + * Per-task (thread) structure dynamically allocated only if autonuma + * is not impossible. This contains the preferred autonuma_node where + * the userland thread should be scheduled into (only relevant if + * tsk->mm is not null) and the per-thread NUMA accesses statistics + * (generated by the NUMA hinting page faults). + */ +struct task_autonuma { + int autonuma_node; + /* zeroed from the below field during allocation */ + unsigned long task_numa_fault_pass; + unsigned long task_numa_fault_tot; + unsigned long task_numa_fault[0]; +}; + +extern int alloc_task_autonuma(struct task_struct *tsk, + struct task_struct *orig, + int node); +extern void __init task_autonuma_init(void); +extern void free_task_autonuma(struct task_struct *tsk); + +#else /* CONFIG_AUTONUMA */ + +static inline int alloc_mm_autonuma(struct mm_struct *mm) +{ + return 0; +} +static inline void free_mm_autonuma(struct mm_struct *mm) {} +static inline void mm_autonuma_init(void) {} + +static inline int alloc_task_autonuma(struct task_struct *tsk, + struct task_struct *orig, + int node) +{ + return 0; +} +static inline void task_autonuma_init(void) {} +static inline void free_task_autonuma(struct task_struct *tsk) {} + +#endif /* CONFIG_AUTONUMA */ + +#endif /* _LINUX_AUTONUMA_TYPES_H */ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org