Merge tag 'kbuild-fixes-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masah...
[linux-2.6-block.git] / include / linux / sched.h
index c75fd46506df5e2cdd0e18e04b5c26d1cba5590c..61591ac6eab6db1fc41c0e8ab156d46c584bf9f7 100644 (file)
@@ -770,6 +770,10 @@ struct task_struct {
        unsigned int                    flags;
        unsigned int                    ptrace;
 
+#ifdef CONFIG_MEM_ALLOC_PROFILING
+       struct alloc_tag                *alloc_tag;
+#endif
+
 #ifdef CONFIG_SMP
        int                             on_cpu;
        struct __call_single_node       wake_entry;
@@ -810,6 +814,7 @@ struct task_struct {
        struct task_group               *sched_task_group;
 #endif
 
+
 #ifdef CONFIG_UCLAMP_TASK
        /*
         * Clamp values requested for a scheduling entity.
@@ -1444,8 +1449,6 @@ struct task_struct {
 
 #ifdef CONFIG_MEMCG
        struct mem_cgroup               *memcg_in_oom;
-       gfp_t                           memcg_oom_gfp_mask;
-       int                             memcg_oom_order;
 
        /* Number of pages to reclaim on returning to userland: */
        unsigned int                    memcg_nr_pages_over_high;
@@ -2188,4 +2191,23 @@ static inline int sched_core_idle_cpu(int cpu) { return idle_cpu(cpu); }
 
 extern void sched_set_stop_task(int cpu, struct task_struct *stop);
 
+#ifdef CONFIG_MEM_ALLOC_PROFILING
+static inline struct alloc_tag *alloc_tag_save(struct alloc_tag *tag)
+{
+       swap(current->alloc_tag, tag);
+       return tag;
+}
+
+static inline void alloc_tag_restore(struct alloc_tag *tag, struct alloc_tag *old)
+{
+#ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG
+       WARN(current->alloc_tag != tag, "current->alloc_tag was changed:\n");
+#endif
+       current->alloc_tag = old;
+}
+#else
+#define alloc_tag_save(_tag)                   NULL
+#define alloc_tag_restore(_tag, _old)          do {} while (0)
+#endif
+
 #endif