mm/mempool: minor coding style tweaks
Various coding style tweaks to various files under mm/ [daizhiyuan@phytium.com.cn: mm/swapfile: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614223624-16055-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/sparse: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614227288-19363-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/vmscan: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614227649-19853-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/compaction: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614228218-20770-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/oom_kill: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614228360-21168-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/shmem: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614228504-21491-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/page_alloc: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614228613-21754-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/filemap: minor coding style tweaks] Link: https://lkml.kernel.org/r/1614228936-22337-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/mlock: minor coding style tweaks] Link: https://lkml.kernel.org/r/1613956588-2453-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/frontswap: minor coding style tweaks] Link: https://lkml.kernel.org/r/1613962668-15045-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/vmalloc: minor coding style tweaks] Link: https://lkml.kernel.org/r/1613963379-15988-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/memory_hotplug: minor coding style tweaks] Link: https://lkml.kernel.org/r/1613971784-24878-1-git-send-email-daizhiyuan@phytium.com.cn [daizhiyuan@phytium.com.cn: mm/mempolicy: minor coding style tweaks] Link: https://lkml.kernel.org/r/1613972228-25501-1-git-send-email-daizhiyuan@phytium.com.cn Link: https://lkml.kernel.org/r/1614222374-13805-1-git-send-email-daizhiyuan@phytium.com.cn Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Родитель
9727688dbf
Коммит
68d68ff6eb
|
@ -2885,7 +2885,7 @@ void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx)
|
||||||
*/
|
*/
|
||||||
static int kcompactd(void *p)
|
static int kcompactd(void *p)
|
||||||
{
|
{
|
||||||
pg_data_t *pgdat = (pg_data_t*)p;
|
pg_data_t *pgdat = (pg_data_t *)p;
|
||||||
struct task_struct *tsk = current;
|
struct task_struct *tsk = current;
|
||||||
unsigned int proactive_defer = 0;
|
unsigned int proactive_defer = 0;
|
||||||
|
|
||||||
|
|
|
@ -3267,7 +3267,7 @@ const struct vm_operations_struct generic_file_vm_ops = {
|
||||||
|
|
||||||
/* This is used for a general mmap of a disk file */
|
/* This is used for a general mmap of a disk file */
|
||||||
|
|
||||||
int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
|
int generic_file_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
struct address_space *mapping = file->f_mapping;
|
struct address_space *mapping = file->f_mapping;
|
||||||
|
|
||||||
|
@ -3292,11 +3292,11 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
|
||||||
{
|
{
|
||||||
return VM_FAULT_SIGBUS;
|
return VM_FAULT_SIGBUS;
|
||||||
}
|
}
|
||||||
int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
|
int generic_file_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
int generic_file_readonly_mmap(struct file * file, struct vm_area_struct * vma)
|
int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
@ -3724,7 +3724,7 @@ EXPORT_SYMBOL(generic_perform_write);
|
||||||
ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||||
{
|
{
|
||||||
struct file *file = iocb->ki_filp;
|
struct file *file = iocb->ki_filp;
|
||||||
struct address_space * mapping = file->f_mapping;
|
struct address_space *mapping = file->f_mapping;
|
||||||
struct inode *inode = mapping->host;
|
struct inode *inode = mapping->host;
|
||||||
ssize_t written = 0;
|
ssize_t written = 0;
|
||||||
ssize_t err;
|
ssize_t err;
|
||||||
|
|
|
@ -60,16 +60,20 @@ static u64 frontswap_succ_stores;
|
||||||
static u64 frontswap_failed_stores;
|
static u64 frontswap_failed_stores;
|
||||||
static u64 frontswap_invalidates;
|
static u64 frontswap_invalidates;
|
||||||
|
|
||||||
static inline void inc_frontswap_loads(void) {
|
static inline void inc_frontswap_loads(void)
|
||||||
|
{
|
||||||
data_race(frontswap_loads++);
|
data_race(frontswap_loads++);
|
||||||
}
|
}
|
||||||
static inline void inc_frontswap_succ_stores(void) {
|
static inline void inc_frontswap_succ_stores(void)
|
||||||
|
{
|
||||||
data_race(frontswap_succ_stores++);
|
data_race(frontswap_succ_stores++);
|
||||||
}
|
}
|
||||||
static inline void inc_frontswap_failed_stores(void) {
|
static inline void inc_frontswap_failed_stores(void)
|
||||||
|
{
|
||||||
data_race(frontswap_failed_stores++);
|
data_race(frontswap_failed_stores++);
|
||||||
}
|
}
|
||||||
static inline void inc_frontswap_invalidates(void) {
|
static inline void inc_frontswap_invalidates(void)
|
||||||
|
{
|
||||||
data_race(frontswap_invalidates++);
|
data_race(frontswap_invalidates++);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -834,7 +834,7 @@ static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn
|
||||||
return movable_node_enabled ? movable_zone : kernel_zone;
|
return movable_node_enabled ? movable_zone : kernel_zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zone * zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
|
struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
|
||||||
unsigned long nr_pages)
|
unsigned long nr_pages)
|
||||||
{
|
{
|
||||||
if (online_type == MMOP_ONLINE_KERNEL)
|
if (online_type == MMOP_ONLINE_KERNEL)
|
||||||
|
|
|
@ -330,7 +330,7 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
|
||||||
else if (pol->flags & MPOL_F_RELATIVE_NODES)
|
else if (pol->flags & MPOL_F_RELATIVE_NODES)
|
||||||
mpol_relative_nodemask(&tmp, &pol->w.user_nodemask, nodes);
|
mpol_relative_nodemask(&tmp, &pol->w.user_nodemask, nodes);
|
||||||
else {
|
else {
|
||||||
nodes_remap(tmp, pol->v.nodes,pol->w.cpuset_mems_allowed,
|
nodes_remap(tmp, pol->v.nodes, pol->w.cpuset_mems_allowed,
|
||||||
*nodes);
|
*nodes);
|
||||||
pol->w.cpuset_mems_allowed = *nodes;
|
pol->w.cpuset_mems_allowed = *nodes;
|
||||||
}
|
}
|
||||||
|
@ -1161,7 +1161,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
|
||||||
|
|
||||||
tmp = *from;
|
tmp = *from;
|
||||||
while (!nodes_empty(tmp)) {
|
while (!nodes_empty(tmp)) {
|
||||||
int s,d;
|
int s, d;
|
||||||
int source = NUMA_NO_NODE;
|
int source = NUMA_NO_NODE;
|
||||||
int dest = 0;
|
int dest = 0;
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ EXPORT_SYMBOL(mempool_init);
|
||||||
mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
|
mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
|
||||||
mempool_free_t *free_fn, void *pool_data)
|
mempool_free_t *free_fn, void *pool_data)
|
||||||
{
|
{
|
||||||
return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,
|
return mempool_create_node(min_nr, alloc_fn, free_fn, pool_data,
|
||||||
GFP_KERNEL, NUMA_NO_NODE);
|
GFP_KERNEL, NUMA_NO_NODE);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(mempool_create);
|
EXPORT_SYMBOL(mempool_create);
|
||||||
|
|
|
@ -559,7 +559,7 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
|
||||||
vm_flags_t flags)
|
vm_flags_t flags)
|
||||||
{
|
{
|
||||||
unsigned long nstart, end, tmp;
|
unsigned long nstart, end, tmp;
|
||||||
struct vm_area_struct * vma, * prev;
|
struct vm_area_struct *vma, *prev;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
VM_BUG_ON(offset_in_page(start));
|
VM_BUG_ON(offset_in_page(start));
|
||||||
|
@ -737,7 +737,7 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
|
||||||
*/
|
*/
|
||||||
static int apply_mlockall_flags(int flags)
|
static int apply_mlockall_flags(int flags)
|
||||||
{
|
{
|
||||||
struct vm_area_struct * vma, * prev = NULL;
|
struct vm_area_struct *vma, *prev = NULL;
|
||||||
vm_flags_t to_add = 0;
|
vm_flags_t to_add = 0;
|
||||||
|
|
||||||
current->mm->def_flags &= VM_LOCKED_CLEAR_MASK;
|
current->mm->def_flags &= VM_LOCKED_CLEAR_MASK;
|
||||||
|
|
|
@ -993,7 +993,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)
|
||||||
if (oom_group) {
|
if (oom_group) {
|
||||||
mem_cgroup_print_oom_group(oom_group);
|
mem_cgroup_print_oom_group(oom_group);
|
||||||
mem_cgroup_scan_tasks(oom_group, oom_kill_memcg_member,
|
mem_cgroup_scan_tasks(oom_group, oom_kill_memcg_member,
|
||||||
(void*)message);
|
(void *)message);
|
||||||
mem_cgroup_put(oom_group);
|
mem_cgroup_put(oom_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8808,7 +8808,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
|
||||||
ret = __alloc_contig_migrate_range(&cc, start, end);
|
ret = __alloc_contig_migrate_range(&cc, start, end);
|
||||||
if (ret && ret != -EBUSY)
|
if (ret && ret != -EBUSY)
|
||||||
goto done;
|
goto done;
|
||||||
ret =0;
|
ret = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pages from [start, end) are within a MAX_ORDER_NR_PAGES
|
* Pages from [start, end) are within a MAX_ORDER_NR_PAGES
|
||||||
|
|
|
@ -3508,7 +3508,7 @@ static int shmem_parse_options(struct fs_context *fc, void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*this_char) {
|
if (*this_char) {
|
||||||
char *value = strchr(this_char,'=');
|
char *value = strchr(this_char, '=');
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,7 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en
|
||||||
if (unlikely(!mem_section)) {
|
if (unlikely(!mem_section)) {
|
||||||
unsigned long size, align;
|
unsigned long size, align;
|
||||||
|
|
||||||
size = sizeof(struct mem_section*) * NR_SECTION_ROOTS;
|
size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
|
||||||
align = 1 << (INTERNODE_CACHE_SHIFT);
|
align = 1 << (INTERNODE_CACHE_SHIFT);
|
||||||
mem_section = memblock_alloc(size, align);
|
mem_section = memblock_alloc(size, align);
|
||||||
if (!mem_section)
|
if (!mem_section)
|
||||||
|
|
|
@ -2780,7 +2780,7 @@ static int swap_show(struct seq_file *swap, void *v)
|
||||||
unsigned int bytes, inuse;
|
unsigned int bytes, inuse;
|
||||||
|
|
||||||
if (si == SEQ_START_TOKEN) {
|
if (si == SEQ_START_TOKEN) {
|
||||||
seq_puts(swap,"Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
|
seq_puts(swap, "Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3284,7 +3284,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
|
||||||
sizeof(long),
|
sizeof(long),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
||||||
if (p->bdev &&(swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
|
if (p->bdev && (swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
|
||||||
/*
|
/*
|
||||||
* When discard is enabled for swap with no particular
|
* When discard is enabled for swap with no particular
|
||||||
* policy flagged, we set all swap discard flags here in
|
* policy flagged, we set all swap discard flags here in
|
||||||
|
|
|
@ -3083,7 +3083,7 @@ EXPORT_SYMBOL(vzalloc_node);
|
||||||
* 64b systems should always have either DMA or DMA32 zones. For others
|
* 64b systems should always have either DMA or DMA32 zones. For others
|
||||||
* GFP_DMA32 should do the right thing and use the normal zone.
|
* GFP_DMA32 should do the right thing and use the normal zone.
|
||||||
*/
|
*/
|
||||||
#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
|
#define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4059,7 +4059,7 @@ static int kswapd(void *p)
|
||||||
{
|
{
|
||||||
unsigned int alloc_order, reclaim_order;
|
unsigned int alloc_order, reclaim_order;
|
||||||
unsigned int highest_zoneidx = MAX_NR_ZONES - 1;
|
unsigned int highest_zoneidx = MAX_NR_ZONES - 1;
|
||||||
pg_data_t *pgdat = (pg_data_t*)p;
|
pg_data_t *pgdat = (pg_data_t *)p;
|
||||||
struct task_struct *tsk = current;
|
struct task_struct *tsk = current;
|
||||||
const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);
|
const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче