Skip to content

Commit a153e67

Browse files
committed
Merge branch 'akpm' (patches from Andrew Morton)
Merge fixes from Andrew Morton: "Bunch of fixes. And a reversion of mhocko's "Soft limit rework" patch series. This is actually your fault for opening the merge window when I was off racing ;) I didn't read the email thread before sending everything off. Johannes Weiner raised significant issues: http://www.spinics.net/lists/cgroups/msg08813.html and we agreed to back it all out" I clearly need to be more aware of Andrew's racing schedule. * akpm: MAINTAINERS: update mach-bcm related email address checkpatch: make extern in .h prototypes quieter cciss: fix info leak in cciss_ioctl32_passthru() cpqarray: fix info leak in ida_locked_ioctl() kernel/reboot.c: re-enable the function of variable reboot_default audit: fix endless wait in audit_log_start() revert "memcg, vmscan: integrate soft reclaim tighter with zone shrinking code" revert "memcg: get rid of soft-limit tree infrastructure" revert "vmscan, memcg: do softlimit reclaim also for targeted reclaim" revert "memcg: enhance memcg iterator to support predicates" revert "memcg: track children in soft limit excess to improve soft limit" revert "memcg, vmscan: do not attempt soft limit reclaim if it would not scan anything" revert "memcg: track all children over limit in the root" revert "memcg, vmscan: do not fall into reclaim-all pass too quickly" fs/ocfs2/super.c: use a bigger nodestr in ocfs2_dismount_volume watchdog: update watchdog_thresh properly watchdog: update watchdog attributes atomically
2 parents e288e93 + 497a045 commit a153e67

File tree

12 files changed

+527
-262
lines changed

12 files changed

+527
-262
lines changed

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,8 @@ S: Supported
18121812
F: drivers/net/ethernet/broadcom/bnx2x/
18131813

18141814
BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE
1815-
M: Christian Daudt <[email protected]>
1815+
M: Christian Daudt <[email protected]>
1816+
18161817
T: git git://git.github.com/broadcom/bcm11351
18171818
S: Maintained
18181819
F: arch/arm/mach-bcm/

drivers/block/cciss.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode,
11891189
int err;
11901190
u32 cp;
11911191

1192+
memset(&arg64, 0, sizeof(arg64));
11921193
err = 0;
11931194
err |=
11941195
copy_from_user(&arg64.LUN_info, &arg32->LUN_info,

drivers/block/cpqarray.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned in
11931193
ida_pci_info_struct pciinfo;
11941194

11951195
if (!arg) return -EINVAL;
1196+
memset(&pciinfo, 0, sizeof(pciinfo));
11961197
pciinfo.bus = host->pci_dev->bus->number;
11971198
pciinfo.dev_fn = host->pci_dev->devfn;
11981199
pciinfo.board_id = host->board_id;

fs/ocfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err)
19241924
{
19251925
int tmp, hangup_needed = 0;
19261926
struct ocfs2_super *osb = NULL;
1927-
char nodestr[8];
1927+
char nodestr[12];
19281928

19291929
trace_ocfs2_dismount_volume(sb);
19301930

include/linux/memcontrol.h

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,6 @@ struct mem_cgroup_reclaim_cookie {
5353
unsigned int generation;
5454
};
5555

56-
enum mem_cgroup_filter_t {
57-
VISIT, /* visit current node */
58-
SKIP, /* skip the current node and continue traversal */
59-
SKIP_TREE, /* skip the whole subtree and continue traversal */
60-
};
61-
62-
/*
63-
* mem_cgroup_filter_t predicate might instruct mem_cgroup_iter_cond how to
64-
* iterate through the hierarchy tree. Each tree element is checked by the
65-
* predicate before it is returned by the iterator. If a filter returns
66-
* SKIP or SKIP_TREE then the iterator code continues traversal (with the
67-
* next node down the hierarchy or the next node that doesn't belong under the
68-
* memcg's subtree).
69-
*/
70-
typedef enum mem_cgroup_filter_t
71-
(*mem_cgroup_iter_filter)(struct mem_cgroup *memcg, struct mem_cgroup *root);
72-
7356
#ifdef CONFIG_MEMCG
7457
/*
7558
* All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -137,18 +120,9 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
137120
extern void mem_cgroup_end_migration(struct mem_cgroup *memcg,
138121
struct page *oldpage, struct page *newpage, bool migration_ok);
139122

140-
struct mem_cgroup *mem_cgroup_iter_cond(struct mem_cgroup *root,
141-
struct mem_cgroup *prev,
142-
struct mem_cgroup_reclaim_cookie *reclaim,
143-
mem_cgroup_iter_filter cond);
144-
145-
static inline struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
146-
struct mem_cgroup *prev,
147-
struct mem_cgroup_reclaim_cookie *reclaim)
148-
{
149-
return mem_cgroup_iter_cond(root, prev, reclaim, NULL);
150-
}
151-
123+
struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *,
124+
struct mem_cgroup *,
125+
struct mem_cgroup_reclaim_cookie *);
152126
void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *);
153127

154128
/*
@@ -260,9 +234,9 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
260234
mem_cgroup_update_page_stat(page, idx, -1);
261235
}
262236

263-
enum mem_cgroup_filter_t
264-
mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg,
265-
struct mem_cgroup *root);
237+
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
238+
gfp_t gfp_mask,
239+
unsigned long *total_scanned);
266240

267241
void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
268242
static inline void mem_cgroup_count_vm_event(struct mm_struct *mm,
@@ -376,15 +350,6 @@ static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
376350
struct page *oldpage, struct page *newpage, bool migration_ok)
377351
{
378352
}
379-
static inline struct mem_cgroup *
380-
mem_cgroup_iter_cond(struct mem_cgroup *root,
381-
struct mem_cgroup *prev,
382-
struct mem_cgroup_reclaim_cookie *reclaim,
383-
mem_cgroup_iter_filter cond)
384-
{
385-
/* first call must return non-NULL, second return NULL */
386-
return (struct mem_cgroup *)(unsigned long)!prev;
387-
}
388353

389354
static inline struct mem_cgroup *
390355
mem_cgroup_iter(struct mem_cgroup *root,
@@ -471,11 +436,11 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
471436
}
472437

473438
static inline
474-
enum mem_cgroup_filter_t
475-
mem_cgroup_soft_reclaim_eligible(struct mem_cgroup *memcg,
476-
struct mem_cgroup *root)
439+
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
440+
gfp_t gfp_mask,
441+
unsigned long *total_scanned)
477442
{
478-
return VISIT;
443+
return 0;
479444
}
480445

481446
static inline void mem_cgroup_split_huge_fixup(struct page *head)

include/linux/smp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
155155

156156
static inline void kick_all_cpus_sync(void) { }
157157

158+
static inline void __smp_call_function_single(int cpuid,
159+
struct call_single_data *data, int wait)
160+
{
161+
on_each_cpu(data->func, data->info, wait);
162+
}
163+
158164
#endif /* !SMP */
159165

160166
/*

kernel/audit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
11171117

11181118
sleep_time = timeout_start + audit_backlog_wait_time -
11191119
jiffies;
1120-
if ((long)sleep_time > 0)
1120+
if ((long)sleep_time > 0) {
11211121
wait_for_auditd(sleep_time);
1122-
continue;
1122+
continue;
1123+
}
11231124
}
11241125
if (audit_rate_check() && printk_ratelimit())
11251126
printk(KERN_WARNING

kernel/reboot.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ EXPORT_SYMBOL(cad_pid);
3232
#endif
3333
enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
3434

35-
int reboot_default;
35+
/*
36+
* This variable is used privately to keep track of whether or not
37+
* reboot_type is still set to its default value (i.e., reboot= hasn't
38+
* been set on the command line). This is needed so that we can
39+
* suppress DMI scanning for reboot quirks. Without it, it's
40+
* impossible to override a faulty reboot quirk without recompiling.
41+
*/
42+
int reboot_default = 1;
3643
int reboot_cpu;
3744
enum reboot_type reboot_type = BOOT_ACPI;
3845
int reboot_force;

kernel/watchdog.c

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,52 @@ static struct smp_hotplug_thread watchdog_threads = {
486486
.unpark = watchdog_enable,
487487
};
488488

489-
static int watchdog_enable_all_cpus(void)
489+
static void restart_watchdog_hrtimer(void *info)
490+
{
491+
struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
492+
int ret;
493+
494+
/*
495+
* No need to cancel and restart hrtimer if it is currently executing
496+
* because it will reprogram itself with the new period now.
497+
* We should never see it unqueued here because we are running per-cpu
498+
* with interrupts disabled.
499+
*/
500+
ret = hrtimer_try_to_cancel(hrtimer);
501+
if (ret == 1)
502+
hrtimer_start(hrtimer, ns_to_ktime(sample_period),
503+
HRTIMER_MODE_REL_PINNED);
504+
}
505+
506+
static void update_timers(int cpu)
507+
{
508+
struct call_single_data data = {.func = restart_watchdog_hrtimer};
509+
/*
510+
* Make sure that perf event counter will adopt to a new
511+
* sampling period. Updating the sampling period directly would
512+
* be much nicer but we do not have an API for that now so
513+
* let's use a big hammer.
514+
* Hrtimer will adopt the new period on the next tick but this
515+
* might be late already so we have to restart the timer as well.
516+
*/
517+
watchdog_nmi_disable(cpu);
518+
__smp_call_function_single(cpu, &data, 1);
519+
watchdog_nmi_enable(cpu);
520+
}
521+
522+
static void update_timers_all_cpus(void)
523+
{
524+
int cpu;
525+
526+
get_online_cpus();
527+
preempt_disable();
528+
for_each_online_cpu(cpu)
529+
update_timers(cpu);
530+
preempt_enable();
531+
put_online_cpus();
532+
}
533+
534+
static int watchdog_enable_all_cpus(bool sample_period_changed)
490535
{
491536
int err = 0;
492537

@@ -496,6 +541,8 @@ static int watchdog_enable_all_cpus(void)
496541
pr_err("Failed to create watchdog threads, disabled\n");
497542
else
498543
watchdog_running = 1;
544+
} else if (sample_period_changed) {
545+
update_timers_all_cpus();
499546
}
500547

501548
return err;
@@ -520,13 +567,15 @@ int proc_dowatchdog(struct ctl_table *table, int write,
520567
void __user *buffer, size_t *lenp, loff_t *ppos)
521568
{
522569
int err, old_thresh, old_enabled;
570+
static DEFINE_MUTEX(watchdog_proc_mutex);
523571

572+
mutex_lock(&watchdog_proc_mutex);
524573
old_thresh = ACCESS_ONCE(watchdog_thresh);
525574
old_enabled = ACCESS_ONCE(watchdog_user_enabled);
526575

527576
err = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
528577
if (err || !write)
529-
return err;
578+
goto out;
530579

531580
set_sample_period();
532581
/*
@@ -535,7 +584,7 @@ int proc_dowatchdog(struct ctl_table *table, int write,
535584
* watchdog_*_all_cpus() function takes care of this.
536585
*/
537586
if (watchdog_user_enabled && watchdog_thresh)
538-
err = watchdog_enable_all_cpus();
587+
err = watchdog_enable_all_cpus(old_thresh != watchdog_thresh);
539588
else
540589
watchdog_disable_all_cpus();
541590

@@ -544,7 +593,8 @@ int proc_dowatchdog(struct ctl_table *table, int write,
544593
watchdog_thresh = old_thresh;
545594
watchdog_user_enabled = old_enabled;
546595
}
547-
596+
out:
597+
mutex_unlock(&watchdog_proc_mutex);
548598
return err;
549599
}
550600
#endif /* CONFIG_SYSCTL */
@@ -554,5 +604,5 @@ void __init lockup_detector_init(void)
554604
set_sample_period();
555605

556606
if (watchdog_user_enabled)
557-
watchdog_enable_all_cpus();
607+
watchdog_enable_all_cpus(false);
558608
}

0 commit comments

Comments
 (0)