提交 a816f831 编写于 作者: X Xunlei Pang 提交者: Caspar Zhang

alinux: hotfix: Add Cloud Kernel hotfix enhancement

We reserve some fields beforehand for core structures prone to change,
so that we won't hurt when extra fields have to be added for hotfix,
thereby inceasing the success rate, we even can hot add features with
this enhancement.

After reserving, normally cache does not matter as the reserved fields
(usually at tail) are not accessed at all.

Currently involve the following structures:
    MM:
    struct zone
    struct pglist_data
    struct mm_struct
    struct vm_area_struct
    struct mem_cgroup
    struct writeback_control

    Block:
    struct gendisk
    struct backing_dev_info
    struct bio
    struct queue_limits
    struct request_queue
    struct blkcg
    struct blkcg_policy
    struct blk_mq_hw_ctx
    struct blk_mq_tag_set
    struct blk_mq_queue_data
    struct blk_mq_ops
    struct elevator_mq_ops
    struct inode
    struct dentry
    struct address_space
    struct block_device
    struct hd_struct
    struct bio_set

    Network:
    struct sk_buff
    struct sock
    struct net_device_ops
    struct xt_target
    struct dst_entry
    struct dst_ops
    struct fib_rule

    Scheduler:
    struct task_struct
    struct cfs_rq
    struct rq
    struct sched_statistics
    struct sched_entity
    struct signal_struct
    struct task_group
    struct cpuacct

    cgroup:
    struct cgroup_root
    struct cgroup_subsys_state
    struct cgroup_subsys
    struct css_set
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NXunlei Pang <xlpang@linux.alibaba.com>
[ caspar: use SPDX-License-Identifier ]
Signed-off-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 ec642e37
/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (c) 2019 Xunlei Pang <xlpang@linux.alibaba.com>
*/
#ifndef _LINUX_ALI_HOTFIX_H
#define _LINUX_ALI_HOTFIX_H
#include <linux/compiler.h>
/*
* ALI_HOTFIX_RESERVE* - reserve fields for core structures prone to change
* ALI_HOTFIX_USE* - use the reserved field in your hotfix
* ALI_HOTFIX_REPLACE - replacement of _orig with a union of _orig and _new
*/
#define _ALI_HOTFIX_REPLACE(_orig, _new) \
union { \
_new; \
struct { \
_orig; \
} __UNIQUE_ID(ali_hotfix_hide); \
}
#define ALI_HOTFIX_REPLACE(_orig, _new) _ALI_HOTFIX_REPLACE(_orig, _new);
/*
* We tried to standardize on alikernel reserved names. These wrappers leverage
* those common names making it easier to read and find in the code.
*/
#define _ALI_HOTFIX_RESERVE(n) unsigned long ali_reserved##n
#define _ALI_HOTFIX_RESERVE_P(n) void (*ali_reserved##n)(void)
#define ALI_HOTFIX_RESERVE(n) _ALI_HOTFIX_RESERVE(n);
#define ALI_HOTFIX_RESERVE_P(n) _ALI_HOTFIX_RESERVE_P(n);
/*
* Wrappers to replace standard alikernel reserved elements.
*/
#define ALI_HOTFIX_USE(n, _new) \
ALI_HOTFIX_REPLACE(_ALI_HOTFIX_RESERVE(n), _new)
#define ALI_HOTFIX_USE_P(n, _new) \
ALI_HOTFIX_REPLACE(_ALI_HOTFIX_RESERVE_P(n), _new)
/*
* Macros for breaking up a reserved element into two smaller chunks using an
* anonymous struct inside an anonymous union.
*/
#define ALI_HOTFIX_USE2(n, _new1, _new2) \
ALI_HOTFIX_REPLACE(_ALI_HOTFIX_RESERVE(n), struct{ _new1; _new2; })
#define ALI_HOTFIX_USE2_P(n, _new1, _new2) \
ALI_HOTFIX_REPLACE(_ALI_HOTFIX_RESERVE_P(n), struct{ _new1; _new2; })
#endif /* _LINUX_ALI_HOTFIX_H */
...@@ -162,6 +162,9 @@ struct bdi_writeback { ...@@ -162,6 +162,9 @@ struct bdi_writeback {
struct rcu_head rcu; struct rcu_head rcu;
}; };
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
struct backing_dev_info { struct backing_dev_info {
...@@ -205,6 +208,9 @@ struct backing_dev_info { ...@@ -205,6 +208,9 @@ struct backing_dev_info {
struct dentry *debug_dir; struct dentry *debug_dir;
struct dentry *debug_stats; struct dentry *debug_stats;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
enum { enum {
......
...@@ -775,6 +775,9 @@ struct bio_set { ...@@ -775,6 +775,9 @@ struct bio_set {
struct bio_list rescue_list; struct bio_list rescue_list;
struct work_struct rescue_work; struct work_struct rescue_work;
struct workqueue_struct *rescue_workqueue; struct workqueue_struct *rescue_workqueue;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
struct biovec_slab { struct biovec_slab {
......
...@@ -58,6 +58,11 @@ struct blkcg { ...@@ -58,6 +58,11 @@ struct blkcg {
struct list_head cgwb_list; struct list_head cgwb_list;
refcount_t cgwb_refcnt; refcount_t cgwb_refcnt;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
/* /*
...@@ -178,6 +183,9 @@ struct blkcg_policy { ...@@ -178,6 +183,9 @@ struct blkcg_policy {
blkcg_pol_free_pd_fn *pd_free_fn; blkcg_pol_free_pd_fn *pd_free_fn;
blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn; blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn;
blkcg_pol_stat_pd_fn *pd_stat_fn; blkcg_pol_stat_pd_fn *pd_stat_fn;
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
}; };
extern struct blkcg blkcg_root; extern struct blkcg blkcg_root;
......
...@@ -70,6 +70,11 @@ struct blk_mq_hw_ctx { ...@@ -70,6 +70,11 @@ struct blk_mq_hw_ctx {
struct dentry *sched_debugfs_dir; struct dentry *sched_debugfs_dir;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
/* Must be the last member - see also blk_mq_hw_ctx_size(). */ /* Must be the last member - see also blk_mq_hw_ctx_size(). */
struct srcu_struct srcu[0]; struct srcu_struct srcu[0];
}; };
...@@ -90,11 +95,18 @@ struct blk_mq_tag_set { ...@@ -90,11 +95,18 @@ struct blk_mq_tag_set {
struct mutex tag_list_lock; struct mutex tag_list_lock;
struct list_head tag_list; struct list_head tag_list;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
struct blk_mq_queue_data { struct blk_mq_queue_data {
struct request *rq; struct request *rq;
bool last; bool last;
ALI_HOTFIX_RESERVE(1)
}; };
typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *, typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
...@@ -181,6 +193,9 @@ struct blk_mq_ops { ...@@ -181,6 +193,9 @@ struct blk_mq_ops {
*/ */
void (*show_rq)(struct seq_file *m, struct request *rq); void (*show_rq)(struct seq_file *m, struct request *rq);
#endif #endif
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
}; };
enum { enum {
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/sched/clock.h> #include <linux/sched/clock.h>
#include <linux/ali_hotfix.h>
struct bio_set; struct bio_set;
struct bio; struct bio;
struct bio_integrity_payload; struct bio_integrity_payload;
...@@ -212,6 +214,9 @@ struct bio { ...@@ -212,6 +214,9 @@ struct bio {
struct bio_set *bi_pool; struct bio_set *bi_pool;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
/* /*
* We can inline a number of vecs at the end of the bio, to avoid * We can inline a number of vecs at the end of the bio, to avoid
* double allocations for a small number of bio_vecs. This member * double allocations for a small number of bio_vecs. This member
......
...@@ -396,6 +396,9 @@ struct queue_limits { ...@@ -396,6 +396,9 @@ struct queue_limits {
unsigned char cluster; unsigned char cluster;
unsigned char raid_partial_stripes_expensive; unsigned char raid_partial_stripes_expensive;
enum blk_zoned_model zoned; enum blk_zoned_model zoned;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
#ifdef CONFIG_BLK_DEV_ZONED #ifdef CONFIG_BLK_DEV_ZONED
...@@ -677,6 +680,11 @@ struct request_queue { ...@@ -677,6 +680,11 @@ struct request_queue {
#define BLK_MAX_WRITE_HINTS 5 #define BLK_MAX_WRITE_HINTS 5
u64 write_hints[BLK_MAX_WRITE_HINTS]; u64 write_hints[BLK_MAX_WRITE_HINTS];
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
#define QUEUE_FLAG_QUEUED 0 /* uses generic tag queueing */ #define QUEUE_FLAG_QUEUED 0 /* uses generic tag queueing */
......
...@@ -161,6 +161,9 @@ struct cgroup_subsys_state { ...@@ -161,6 +161,9 @@ struct cgroup_subsys_state {
struct work_struct destroy_work; struct work_struct destroy_work;
struct rcu_work destroy_rwork; struct rcu_work destroy_rwork;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
/* /*
* PI: the parent css. Placed here for cache proximity to following * PI: the parent css. Placed here for cache proximity to following
* fields of the containing structure. * fields of the containing structure.
...@@ -262,6 +265,9 @@ struct css_set { ...@@ -262,6 +265,9 @@ struct css_set {
/* For RCU-protected deletion */ /* For RCU-protected deletion */
struct rcu_head rcu_head; struct rcu_head rcu_head;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
struct cgroup_base_stat { struct cgroup_base_stat {
...@@ -489,6 +495,9 @@ struct cgroup_root { ...@@ -489,6 +495,9 @@ struct cgroup_root {
/* IDs for cgroups in this hierarchy */ /* IDs for cgroups in this hierarchy */
struct idr cgroup_idr; struct idr cgroup_idr;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
/* The path to use for release notifications. */ /* The path to use for release notifications. */
char release_agent_path[PATH_MAX]; char release_agent_path[PATH_MAX];
...@@ -614,6 +623,9 @@ struct cgroup_subsys { ...@@ -614,6 +623,9 @@ struct cgroup_subsys {
void (*release)(struct task_struct *task); void (*release)(struct task_struct *task);
void (*bind)(struct cgroup_subsys_state *root_css); void (*bind)(struct cgroup_subsys_state *root_css);
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
bool early_init:1; bool early_init:1;
/* /*
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <linux/stringhash.h> #include <linux/stringhash.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/ali_hotfix.h>
struct path; struct path;
struct vfsmount; struct vfsmount;
...@@ -117,6 +119,9 @@ struct dentry { ...@@ -117,6 +119,9 @@ struct dentry {
struct hlist_bl_node d_in_lookup_hash; /* only for in-lookup ones */ struct hlist_bl_node d_in_lookup_hash; /* only for in-lookup ones */
struct rcu_head d_rcu; struct rcu_head d_rcu;
} d_u; } d_u;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} __randomize_layout; } __randomize_layout;
/* /*
......
...@@ -119,6 +119,9 @@ struct elevator_mq_ops { ...@@ -119,6 +119,9 @@ struct elevator_mq_ops {
struct request *(*next_request)(struct request_queue *, struct request *); struct request *(*next_request)(struct request_queue *, struct request *);
void (*init_icq)(struct io_cq *); void (*init_icq)(struct io_cq *);
void (*exit_icq)(struct io_cq *); void (*exit_icq)(struct io_cq *);
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
}; };
#define ELV_NAME_MAX (16) #define ELV_NAME_MAX (16)
......
...@@ -431,6 +431,9 @@ struct address_space { ...@@ -431,6 +431,9 @@ struct address_space {
struct list_head private_list; /* for use by the address_space */ struct list_head private_list; /* for use by the address_space */
void *private_data; /* ditto */ void *private_data; /* ditto */
errseq_t wb_err; errseq_t wb_err;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} __attribute__((aligned(sizeof(long)))) __randomize_layout; } __attribute__((aligned(sizeof(long)))) __randomize_layout;
/* /*
* On most architectures that alignment is already the case; but * On most architectures that alignment is already the case; but
...@@ -475,6 +478,9 @@ struct block_device { ...@@ -475,6 +478,9 @@ struct block_device {
int bd_fsfreeze_count; int bd_fsfreeze_count;
/* Mutex for freeze */ /* Mutex for freeze */
struct mutex bd_fsfreeze_mutex; struct mutex bd_fsfreeze_mutex;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} __randomize_layout; } __randomize_layout;
/* /*
...@@ -694,6 +700,9 @@ struct inode { ...@@ -694,6 +700,9 @@ struct inode {
#endif #endif
void *i_private; /* fs or device private pointer */ void *i_private; /* fs or device private pointer */
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} __randomize_layout; } __randomize_layout;
static inline unsigned int i_blocksize(const struct inode *node) static inline unsigned int i_blocksize(const struct inode *node)
......
...@@ -131,6 +131,9 @@ struct hd_struct { ...@@ -131,6 +131,9 @@ struct hd_struct {
#endif #endif
struct percpu_ref ref; struct percpu_ref ref;
struct rcu_work rcu_work; struct rcu_work rcu_work;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
#define GENHD_FL_REMOVABLE 1 #define GENHD_FL_REMOVABLE 1
...@@ -212,6 +215,9 @@ struct gendisk { ...@@ -212,6 +215,9 @@ struct gendisk {
int node_id; int node_id;
struct badblocks *bb; struct badblocks *bb;
struct lockdep_map lockdep_map; struct lockdep_map lockdep_map;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
static inline struct gendisk *part_to_disk(struct hd_struct *part) static inline struct gendisk *part_to_disk(struct hd_struct *part)
......
...@@ -332,6 +332,10 @@ struct mem_cgroup { ...@@ -332,6 +332,10 @@ struct mem_cgroup {
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #ifdef CONFIG_TRANSPARENT_HUGEPAGE
struct deferred_split deferred_split_queue; struct deferred_split deferred_split_queue;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
struct mem_cgroup_per_node *nodeinfo[0]; struct mem_cgroup_per_node *nodeinfo[0];
/* WARNING: nodeinfo must be the last member here */ /* WARNING: nodeinfo must be the last member here */
......
...@@ -450,6 +450,9 @@ struct vm_operations_struct { ...@@ -450,6 +450,9 @@ struct vm_operations_struct {
*/ */
struct page *(*find_special_page)(struct vm_area_struct *vma, struct page *(*find_special_page)(struct vm_area_struct *vma,
unsigned long addr); unsigned long addr);
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
}; };
static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm) static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm)
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include <asm/mmu.h> #include <asm/mmu.h>
#include <linux/ali_hotfix.h>
#ifndef AT_VECTOR_SIZE_ARCH #ifndef AT_VECTOR_SIZE_ARCH
#define AT_VECTOR_SIZE_ARCH 0 #define AT_VECTOR_SIZE_ARCH 0
#endif #endif
...@@ -329,6 +331,11 @@ struct vm_area_struct { ...@@ -329,6 +331,11 @@ struct vm_area_struct {
struct mempolicy *vm_policy; /* NUMA policy for the VMA */ struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif #endif
struct vm_userfaultfd_ctx vm_userfaultfd_ctx; struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
} __randomize_layout; } __randomize_layout;
struct core_thread { struct core_thread {
...@@ -499,6 +506,9 @@ struct mm_struct { ...@@ -499,6 +506,9 @@ struct mm_struct {
#endif #endif
} __randomize_layout; } __randomize_layout;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
/* /*
* The mm_cpumask needs to be at the end of mm_struct, because it * The mm_cpumask needs to be at the end of mm_struct, because it
* is dynamically sized based on nr_cpu_ids. * is dynamically sized based on nr_cpu_ids.
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/page.h> #include <asm/page.h>
#include <linux/ali_hotfix.h>
/* Free memory management - zoned buddy allocator. */ /* Free memory management - zoned buddy allocator. */
#ifndef CONFIG_FORCE_MAX_ZONEORDER #ifndef CONFIG_FORCE_MAX_ZONEORDER
#define MAX_ORDER 11 #define MAX_ORDER 11
...@@ -507,6 +509,9 @@ struct zone { ...@@ -507,6 +509,9 @@ struct zone {
/* Zone statistics */ /* Zone statistics */
atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS]; atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS];
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} ____cacheline_internodealigned_in_smp; } ____cacheline_internodealigned_in_smp;
enum pgdat_flags { enum pgdat_flags {
...@@ -724,6 +729,9 @@ typedef struct pglist_data { ...@@ -724,6 +729,9 @@ typedef struct pglist_data {
/* Per-node vmstats */ /* Per-node vmstats */
struct per_cpu_nodestat __percpu *per_cpu_nodestats; struct per_cpu_nodestat __percpu *per_cpu_nodestats;
atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS]; atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS];
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} pg_data_t; } pg_data_t;
#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
#include <uapi/linux/pkt_cls.h> #include <uapi/linux/pkt_cls.h>
#include <linux/hashtable.h> #include <linux/hashtable.h>
#include <linux/ali_hotfix.h>
struct netpoll_info; struct netpoll_info;
struct device; struct device;
struct phy_device; struct phy_device;
...@@ -1410,6 +1412,9 @@ struct net_device_ops { ...@@ -1410,6 +1412,9 @@ struct net_device_ops {
u32 flags); u32 flags);
int (*ndo_xsk_async_xmit)(struct net_device *dev, int (*ndo_xsk_async_xmit)(struct net_device *dev,
u32 queue_id); u32 queue_id);
ALI_HOTFIX_RESERVE_P(1)
ALI_HOTFIX_RESERVE_P(2)
}; };
/** /**
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <uapi/linux/netfilter/x_tables.h> #include <uapi/linux/netfilter/x_tables.h>
#include <linux/ali_hotfix.h>
/* Test a struct->invflags and a boolean for inequality */ /* Test a struct->invflags and a boolean for inequality */
#define NF_INVF(ptr, flag, boolean) \ #define NF_INVF(ptr, flag, boolean) \
((boolean) ^ !!((ptr)->invflags & (flag))) ((boolean) ^ !!((ptr)->invflags & (flag)))
...@@ -217,6 +219,9 @@ struct xt_target { ...@@ -217,6 +219,9 @@ struct xt_target {
unsigned short proto; unsigned short proto;
unsigned short family; unsigned short family;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
/* Furniture shopping... */ /* Furniture shopping... */
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <linux/task_io_accounting.h> #include <linux/task_io_accounting.h>
#include <linux/rseq.h> #include <linux/rseq.h>
#include <linux/ali_hotfix.h>
/* task_struct member predeclarations (sorted alphabetically): */ /* task_struct member predeclarations (sorted alphabetically): */
struct audit_context; struct audit_context;
struct backing_dev_info; struct backing_dev_info;
...@@ -440,6 +442,9 @@ struct sched_statistics { ...@@ -440,6 +442,9 @@ struct sched_statistics {
u64 nr_wakeups_affine_attempts; u64 nr_wakeups_affine_attempts;
u64 nr_wakeups_passive; u64 nr_wakeups_passive;
u64 nr_wakeups_idle; u64 nr_wakeups_idle;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
#endif #endif
}; };
...@@ -478,6 +483,9 @@ struct sched_entity { ...@@ -478,6 +483,9 @@ struct sched_entity {
*/ */
struct sched_avg avg; struct sched_avg avg;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
struct sched_rt_entity { struct sched_rt_entity {
...@@ -1209,6 +1217,15 @@ struct task_struct { ...@@ -1209,6 +1217,15 @@ struct task_struct {
void *security; void *security;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
ALI_HOTFIX_RESERVE(5)
ALI_HOTFIX_RESERVE(6)
ALI_HOTFIX_RESERVE(7)
ALI_HOTFIX_RESERVE(8)
/* /*
* New fields for task_struct should be added above here, so that * New fields for task_struct should be added above here, so that
* they are included in the randomized portion of task_struct. * they are included in the randomized portion of task_struct.
......
...@@ -232,6 +232,9 @@ struct signal_struct { ...@@ -232,6 +232,9 @@ struct signal_struct {
struct mutex cred_guard_mutex; /* guard against foreign influences on struct mutex cred_guard_mutex; /* guard against foreign influences on
* credential calculations * credential calculations
* (notably. ptrace) */ * (notably. ptrace) */
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
} __randomize_layout; } __randomize_layout;
/* /*
......
...@@ -849,6 +849,9 @@ struct sk_buff { ...@@ -849,6 +849,9 @@ struct sk_buff {
__u32 headers_end[0]; __u32 headers_end[0];
/* public: */ /* public: */
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
/* These elements must be at the end, see alloc_skb() for details. */ /* These elements must be at the end, see alloc_skb() for details. */
sk_buff_data_t tail; sk_buff_data_t tail;
sk_buff_data_t end; sk_buff_data_t end;
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <linux/debugobjects.h> #include <linux/debugobjects.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <linux/ali_hotfix.h>
struct timer_list { struct timer_list {
/* /*
* All fields that change during normal runtime grouped to the * All fields that change during normal runtime grouped to the
...@@ -21,6 +23,9 @@ struct timer_list { ...@@ -21,6 +23,9 @@ struct timer_list {
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
struct lockdep_map lockdep_map; struct lockdep_map lockdep_map;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
......
...@@ -80,6 +80,9 @@ struct writeback_control { ...@@ -80,6 +80,9 @@ struct writeback_control {
size_t wb_lcand_bytes; /* bytes written by last candidate */ size_t wb_lcand_bytes; /* bytes written by last candidate */
size_t wb_tcand_bytes; /* bytes written by this candidate */ size_t wb_tcand_bytes; /* bytes written by this candidate */
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
static inline int wbc_to_write_flags(struct writeback_control *wbc) static inline int wbc_to_write_flags(struct writeback_control *wbc)
......
...@@ -88,6 +88,11 @@ struct dst_entry { ...@@ -88,6 +88,11 @@ struct dst_entry {
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
atomic_t __refcnt; /* 32-bit offset 64 */ atomic_t __refcnt; /* 32-bit offset 64 */
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
struct dst_metrics { struct dst_metrics {
......
...@@ -39,6 +39,9 @@ struct dst_ops { ...@@ -39,6 +39,9 @@ struct dst_ops {
struct kmem_cache *kmem_cachep; struct kmem_cache *kmem_cachep;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
struct percpu_counter pcpuc_entries ____cacheline_aligned_in_smp; struct percpu_counter pcpuc_entries ____cacheline_aligned_in_smp;
}; };
......
...@@ -43,6 +43,8 @@ struct fib_rule { ...@@ -43,6 +43,8 @@ struct fib_rule {
struct fib_rule_port_range sport_range; struct fib_rule_port_range sport_range;
struct fib_rule_port_range dport_range; struct fib_rule_port_range dport_range;
struct rcu_head rcu; struct rcu_head rcu;
ALI_HOTFIX_RESERVE(1)
}; };
struct fib_lookup_arg { struct fib_lookup_arg {
......
...@@ -511,6 +511,9 @@ struct sock { ...@@ -511,6 +511,9 @@ struct sock {
struct sock_reuseport __rcu *sk_reuseport_cb; struct sock_reuseport __rcu *sk_reuseport_cb;
__be32 sk_toa_data[16]; __be32 sk_toa_data[16];
struct rcu_head sk_rcu; struct rcu_head sk_rcu;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
enum sk_pacing { enum sk_pacing {
......
...@@ -30,6 +30,11 @@ struct cpuacct { ...@@ -30,6 +30,11 @@ struct cpuacct {
/* cpuusage holds pointer to a u64-type object on every CPU */ /* cpuusage holds pointer to a u64-type object on every CPU */
struct cpuacct_usage __percpu *cpuusage; struct cpuacct_usage __percpu *cpuusage;
struct kernel_cpustat __percpu *cpustat; struct kernel_cpustat __percpu *cpustat;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
static inline struct cpuacct *css_ca(struct cgroup_subsys_state *css) static inline struct cpuacct *css_ca(struct cgroup_subsys_state *css)
......
...@@ -392,6 +392,9 @@ struct task_group { ...@@ -392,6 +392,9 @@ struct task_group {
#endif #endif
struct cfs_bandwidth cfs_bandwidth; struct cfs_bandwidth cfs_bandwidth;
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
}; };
#ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_FAIR_GROUP_SCHED
...@@ -565,6 +568,11 @@ struct cfs_rq { ...@@ -565,6 +568,11 @@ struct cfs_rq {
struct list_head throttled_list; struct list_head throttled_list;
#endif /* CONFIG_CFS_BANDWIDTH */ #endif /* CONFIG_CFS_BANDWIDTH */
#endif /* CONFIG_FAIR_GROUP_SCHED */ #endif /* CONFIG_FAIR_GROUP_SCHED */
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
static inline int rt_bandwidth_enabled(void) static inline int rt_bandwidth_enabled(void)
...@@ -915,6 +923,11 @@ struct rq { ...@@ -915,6 +923,11 @@ struct rq {
/* Must be inspected within a rcu lock section */ /* Must be inspected within a rcu lock section */
struct cpuidle_state *idle_state; struct cpuidle_state *idle_state;
#endif #endif
ALI_HOTFIX_RESERVE(1)
ALI_HOTFIX_RESERVE(2)
ALI_HOTFIX_RESERVE(3)
ALI_HOTFIX_RESERVE(4)
}; };
static inline int cpu_of(struct rq *rq) static inline int cpu_of(struct rq *rq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册