Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704Ab2F1NHp (ORCPT ); Thu, 28 Jun 2012 09:07:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34223 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754412Ab2F1M53 (ORCPT ); Thu, 28 Jun 2012 08:57:29 -0400 From: Andrea Arcangeli 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 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3030 Lines: 90 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/