Commit b0dd1eb2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:

 - A few y2038 fixes which missed the merge window while dependencies
   in NFS were being sorted out.

 - A bunch of fixes. Some minor, some not.

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  MAINTAINERS: use tabs for SAFESETID
  lib/stackdepot.c: fix global out-of-bounds in stack_slabs
  mm/sparsemem: pfn_to_page is not valid yet on SPARSEMEM
  mm/vmscan.c: don't round up scan size for online memory cgroup
  lib/string.c: update match_string() doc-strings with correct behavior
  mm/memcontrol.c: lost css_put in memcg_expand_shrinker_maps()
  mm/swapfile.c: fix a comment in sys_swapon()
  scripts/get_maintainer.pl: deprioritize old Fixes: addresses
  get_maintainer: remove uses of P: for maintainer name
  selftests/vm: add missed tests in run_vmtests
  include/uapi/linux/swab.h: fix userspace breakage, use __BITS_PER_LONG for swap
  Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"
  y2038: hide timeval/timespec/itimerval/itimerspec types
  y2038: remove unused time32 interfaces
  y2038: remove ktime to/from timespec/timeval conversion
parents 63fb9623 bb8d00ff
...@@ -248,15 +248,6 @@ typedef struct compat_siginfo { ...@@ -248,15 +248,6 @@ typedef struct compat_siginfo {
} _sifields; } _sifields;
} compat_siginfo_t; } compat_siginfo_t;
/*
* These functions operate on 32- or 64-bit specs depending on
* COMPAT_USE_64BIT_TIME, hence the void user pointer arguments.
*/
extern int compat_get_timespec(struct timespec *, const void __user *);
extern int compat_put_timespec(const struct timespec *, void __user *);
extern int compat_get_timeval(struct timeval *, const void __user *);
extern int compat_put_timeval(const struct timeval *, void __user *);
struct compat_iovec { struct compat_iovec {
compat_uptr_t iov_base; compat_uptr_t iov_base;
compat_size_t iov_len; compat_size_t iov_len;
...@@ -416,26 +407,6 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const kernel_siginf ...@@ -416,26 +407,6 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const kernel_siginf
int get_compat_sigevent(struct sigevent *event, int get_compat_sigevent(struct sigevent *event,
const struct compat_sigevent __user *u_event); const struct compat_sigevent __user *u_event);
static inline int old_timeval32_compare(struct old_timeval32 *lhs,
struct old_timeval32 *rhs)
{
if (lhs->tv_sec < rhs->tv_sec)
return -1;
if (lhs->tv_sec > rhs->tv_sec)
return 1;
return lhs->tv_usec - rhs->tv_usec;
}
static inline int old_timespec32_compare(struct old_timespec32 *lhs,
struct old_timespec32 *rhs)
{
if (lhs->tv_sec < rhs->tv_sec)
return -1;
if (lhs->tv_sec > rhs->tv_sec)
return 1;
return lhs->tv_nsec - rhs->tv_nsec;
}
extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat); extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat);
/* /*
......
...@@ -66,33 +66,15 @@ static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs) ...@@ -66,33 +66,15 @@ static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
*/ */
#define ktime_sub_ns(kt, nsval) ((kt) - (nsval)) #define ktime_sub_ns(kt, nsval) ((kt) - (nsval))
/* convert a timespec to ktime_t format: */
static inline ktime_t timespec_to_ktime(struct timespec ts)
{
return ktime_set(ts.tv_sec, ts.tv_nsec);
}
/* convert a timespec64 to ktime_t format: */ /* convert a timespec64 to ktime_t format: */
static inline ktime_t timespec64_to_ktime(struct timespec64 ts) static inline ktime_t timespec64_to_ktime(struct timespec64 ts)
{ {
return ktime_set(ts.tv_sec, ts.tv_nsec); return ktime_set(ts.tv_sec, ts.tv_nsec);
} }
/* convert a timeval to ktime_t format: */
static inline ktime_t timeval_to_ktime(struct timeval tv)
{
return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC);
}
/* Map the ktime_t to timespec conversion to ns_to_timespec function */
#define ktime_to_timespec(kt) ns_to_timespec((kt))
/* Map the ktime_t to timespec conversion to ns_to_timespec function */ /* Map the ktime_t to timespec conversion to ns_to_timespec function */
#define ktime_to_timespec64(kt) ns_to_timespec64((kt)) #define ktime_to_timespec64(kt) ns_to_timespec64((kt))
/* Map the ktime_t to timeval conversion to ns_to_timeval function */
#define ktime_to_timeval(kt) ns_to_timeval((kt))
/* Convert ktime_t to nanoseconds */ /* Convert ktime_t to nanoseconds */
static inline s64 ktime_to_ns(const ktime_t kt) static inline s64 ktime_to_ns(const ktime_t kt)
{ {
...@@ -215,25 +197,6 @@ static inline ktime_t ktime_sub_ms(const ktime_t kt, const u64 msec) ...@@ -215,25 +197,6 @@ static inline ktime_t ktime_sub_ms(const ktime_t kt, const u64 msec)
extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
/**
* ktime_to_timespec_cond - convert a ktime_t variable to timespec
* format only if the variable contains data
* @kt: the ktime_t variable to convert
* @ts: the timespec variable to store the result in
*
* Return: %true if there was a successful conversion, %false if kt was 0.
*/
static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
struct timespec *ts)
{
if (kt) {
*ts = ktime_to_timespec(kt);
return true;
} else {
return false;
}
}
/** /**
* ktime_to_timespec64_cond - convert a ktime_t variable to timespec64 * ktime_to_timespec64_cond - convert a ktime_t variable to timespec64
* format only if the variable contains data * format only if the variable contains data
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include <linux/time64.h> #include <linux/time64.h>
#include <linux/timex.h> #include <linux/timex.h>
#define TIME_T_MAX (__kernel_old_time_t)((1UL << ((sizeof(__kernel_old_time_t) << 3) - 1)) - 1)
typedef s32 old_time32_t; typedef s32 old_time32_t;
struct old_timespec32 { struct old_timespec32 {
...@@ -73,162 +71,12 @@ struct __kernel_timex; ...@@ -73,162 +71,12 @@ struct __kernel_timex;
int get_old_timex32(struct __kernel_timex *, const struct old_timex32 __user *); int get_old_timex32(struct __kernel_timex *, const struct old_timex32 __user *);
int put_old_timex32(struct old_timex32 __user *, const struct __kernel_timex *); int put_old_timex32(struct old_timex32 __user *, const struct __kernel_timex *);
#if __BITS_PER_LONG == 64
/* timespec64 is defined as timespec here */
static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64)
{
return *(const struct timespec *)&ts64;
}
static inline struct timespec64 timespec_to_timespec64(const struct timespec ts)
{
return *(const struct timespec64 *)&ts;
}
#else
static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64)
{
struct timespec ret;
ret.tv_sec = (time_t)ts64.tv_sec;
ret.tv_nsec = ts64.tv_nsec;
return ret;
}
static inline struct timespec64 timespec_to_timespec64(const struct timespec ts)
{
struct timespec64 ret;
ret.tv_sec = ts.tv_sec;
ret.tv_nsec = ts.tv_nsec;
return ret;
}
#endif
static inline int timespec_equal(const struct timespec *a,
const struct timespec *b)
{
return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
}
/*
* lhs < rhs: return <0
* lhs == rhs: return 0
* lhs > rhs: return >0
*/
static inline int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
{
if (lhs->tv_sec < rhs->tv_sec)
return -1;
if (lhs->tv_sec > rhs->tv_sec)
return 1;
return lhs->tv_nsec - rhs->tv_nsec;
}
/*
* Returns true if the timespec is norm, false if denorm:
*/
static inline bool timespec_valid(const struct timespec *ts)
{
/* Dates before 1970 are bogus */
if (ts->tv_sec < 0)
return false;
/* Can't have more nanoseconds then a second */
if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
return false;
return true;
}
/**
* timespec_to_ns - Convert timespec to nanoseconds
* @ts: pointer to the timespec variable to be converted
*
* Returns the scalar nanosecond representation of the timespec
* parameter.
*/
static inline s64 timespec_to_ns(const struct timespec *ts)
{
return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
}
/** /**
* ns_to_timespec - Convert nanoseconds to timespec * ns_to_kernel_old_timeval - Convert nanoseconds to timeval
* @nsec: the nanoseconds value to be converted
*
* Returns the timespec representation of the nsec parameter.
*/
extern struct timespec ns_to_timespec(const s64 nsec);
/**
* timespec_add_ns - Adds nanoseconds to a timespec
* @a: pointer to timespec to be incremented
* @ns: unsigned nanoseconds value to be added
*
* This must always be inlined because its used from the x86-64 vdso,
* which cannot call other kernel functions.
*/
static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
{
a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
a->tv_nsec = ns;
}
static inline unsigned long mktime(const unsigned int year,
const unsigned int mon, const unsigned int day,
const unsigned int hour, const unsigned int min,
const unsigned int sec)
{
return mktime64(year, mon, day, hour, min, sec);
}
static inline bool timeval_valid(const struct timeval *tv)
{
/* Dates before 1970 are bogus */
if (tv->tv_sec < 0)
return false;
/* Can't have more microseconds then a second */
if (tv->tv_usec < 0 || tv->tv_usec >= USEC_PER_SEC)
return false;
return true;
}
/**
* timeval_to_ns - Convert timeval to nanoseconds
* @ts: pointer to the timeval variable to be converted
*
* Returns the scalar nanosecond representation of the timeval
* parameter.
*/
static inline s64 timeval_to_ns(const struct timeval *tv)
{
return ((s64) tv->tv_sec * NSEC_PER_SEC) +
tv->tv_usec * NSEC_PER_USEC;
}
/**
* ns_to_timeval - Convert nanoseconds to timeval
* @nsec: the nanoseconds value to be converted * @nsec: the nanoseconds value to be converted
* *
* Returns the timeval representation of the nsec parameter. * Returns the timeval representation of the nsec parameter.
*/ */
extern struct timeval ns_to_timeval(const s64 nsec);
extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec); extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec);
/*
* Old names for the 32-bit time_t interfaces, these will be removed
* when everything uses the new names.
*/
#define compat_time_t old_time32_t
#define compat_timeval old_timeval32
#define compat_timespec old_timespec32
#define compat_itimerspec old_itimerspec32
#define ns_to_compat_timeval ns_to_old_timeval32
#define get_compat_itimerspec64 get_old_itimerspec32
#define put_compat_itimerspec64 put_old_itimerspec32
#define compat_get_timespec64 get_old_timespec32
#define compat_put_timespec64 put_old_timespec32
#endif #endif
...@@ -11,36 +11,4 @@ static inline unsigned long get_seconds(void) ...@@ -11,36 +11,4 @@ static inline unsigned long get_seconds(void)
return ktime_get_real_seconds(); return ktime_get_real_seconds();
} }
static inline void getnstimeofday(struct timespec *ts)
{
struct timespec64 ts64;
ktime_get_real_ts64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void ktime_get_ts(struct timespec *ts)
{
struct timespec64 ts64;
ktime_get_ts64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void getrawmonotonic(struct timespec *ts)
{
struct timespec64 ts64;
ktime_get_raw_ts64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
static inline void getboottime(struct timespec *ts)
{
struct timespec64 ts64;
getboottime64(&ts64);
*ts = timespec64_to_timespec(ts64);
}
#endif #endif
...@@ -65,11 +65,6 @@ typedef __kernel_ssize_t ssize_t; ...@@ -65,11 +65,6 @@ typedef __kernel_ssize_t ssize_t;
typedef __kernel_ptrdiff_t ptrdiff_t; typedef __kernel_ptrdiff_t ptrdiff_t;
#endif #endif
#ifndef _TIME_T
#define _TIME_T
typedef __kernel_old_time_t time_t;
#endif
#ifndef _CLOCK_T #ifndef _CLOCK_T
#define _CLOCK_T #define _CLOCK_T
typedef __kernel_clock_t clock_t; typedef __kernel_clock_t clock_t;
......
...@@ -87,7 +87,9 @@ typedef struct { ...@@ -87,7 +87,9 @@ typedef struct {
typedef __kernel_long_t __kernel_off_t; typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t; typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t; typedef __kernel_long_t __kernel_old_time_t;
#ifndef __KERNEL__
typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_time_t;
#endif
typedef long long __kernel_time64_t; typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t; typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t; typedef int __kernel_timer_t;
......
...@@ -135,9 +135,9 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val) ...@@ -135,9 +135,9 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val)
static __always_inline unsigned long __swab(const unsigned long y) static __always_inline unsigned long __swab(const unsigned long y)
{ {
#if BITS_PER_LONG == 64 #if __BITS_PER_LONG == 64
return __swab64(y); return __swab64(y);
#else /* BITS_PER_LONG == 32 */ #else /* __BITS_PER_LONG == 32 */
return __swab32(y); return __swab32(y);
#endif #endif
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/time_types.h> #include <linux/time_types.h>
#ifndef __KERNEL__
#ifndef _STRUCT_TIMESPEC #ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC #define _STRUCT_TIMESPEC
struct timespec { struct timespec {
...@@ -18,6 +19,17 @@ struct timeval { ...@@ -18,6 +19,17 @@ struct timeval {
__kernel_suseconds_t tv_usec; /* microseconds */ __kernel_suseconds_t tv_usec; /* microseconds */
}; };
struct itimerspec {
struct timespec it_interval;/* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval {
struct timeval it_interval;/* timer interval */
struct timeval it_value; /* current value */
};
#endif
struct timezone { struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */ int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */ int tz_dsttime; /* type of dst correction */
...@@ -31,16 +43,6 @@ struct timezone { ...@@ -31,16 +43,6 @@ struct timezone {
#define ITIMER_VIRTUAL 1 #define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2 #define ITIMER_PROF 2
struct itimerspec {
struct timespec it_interval; /* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
/* /*
* The IDs of the various system clocks (for POSIX.1b interval timers): * The IDs of the various system clocks (for POSIX.1b interval timers):
*/ */
......
...@@ -2384,11 +2384,9 @@ void exit_sem(struct task_struct *tsk) ...@@ -2384,11 +2384,9 @@ void exit_sem(struct task_struct *tsk)
ipc_assert_locked_object(&sma->sem_perm); ipc_assert_locked_object(&sma->sem_perm);
list_del(&un->list_id); list_del(&un->list_id);
/* we are the last process using this ulp, acquiring ulp->lock spin_lock(&ulp->lock);
* isn't required. Besides that, we are also protected against
* IPC_RMID as we hold sma->sem_perm lock now
*/
list_del_rcu(&un->list_proc); list_del_rcu(&un->list_proc);
spin_unlock(&ulp->lock);
/* perform adjustments registered in un */ /* perform adjustments registered in un */
for (i = 0; i < sma->sem_nsems; i++) { for (i = 0; i < sma->sem_nsems; i++) {
......
...@@ -26,70 +26,6 @@ ...@@ -26,70 +26,6 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
static int __compat_get_timeval(struct timeval *tv, const struct old_timeval32 __user *ctv)
{
return (!access_ok(ctv, sizeof(*ctv)) ||
__get_user(tv->tv_sec, &ctv->tv_sec) ||
__get_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
}
static int __compat_put_timeval(const struct timeval *tv, struct old_timeval32 __user *ctv)
{
return (!access_ok(ctv, sizeof(*ctv)) ||
__put_user(tv->tv_sec, &ctv->tv_sec) ||
__put_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
}
static int __compat_get_timespec(struct timespec *ts, const struct old_timespec32 __user *cts)
{
return (!access_ok(cts, sizeof(*cts)) ||
__get_user(ts->tv_sec, &cts->tv_sec) ||
__get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
}
static int __compat_put_timespec(const struct timespec *ts, struct old_timespec32 __user *cts)
{
return (!access_ok(cts, sizeof(*cts)) ||
__put_user(ts->tv_sec, &cts->tv_sec) ||
__put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
}
int compat_get_timeval(struct timeval *tv, const void __user *utv)
{
if (COMPAT_USE_64BIT_TIME)
return copy_from_user(tv, utv, sizeof(*tv)) ? -EFAULT : 0;
else
return __compat_get_timeval(tv, utv);
}
EXPORT_SYMBOL_GPL(compat_get_timeval);
int compat_put_timeval(const struct timeval *tv, void __user *utv)
{
if (COMPAT_USE_64BIT_TIME)
return copy_to_user(utv, tv, sizeof(*tv)) ? -EFAULT : 0;
else
return __compat_put_timeval(tv, utv);
}
EXPORT_SYMBOL_GPL(compat_put_timeval);
int compat_get_timespec(struct timespec *ts, const void __user *uts)
{
if (COMPAT_USE_64BIT_TIME)
return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0;
else
return __compat_get_timespec(ts, uts);
}
EXPORT_SYMBOL_GPL(compat_get_timespec);
int compat_put_timespec(const struct timespec *ts, void __user *uts)
{
if (COMPAT_USE_64BIT_TIME)
return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0;
else
return __compat_put_timespec(ts, uts);
}
EXPORT_SYMBOL_GPL(compat_put_timespec);
#ifdef __ARCH_WANT_SYS_SIGPROCMASK #ifdef __ARCH_WANT_SYS_SIGPROCMASK
/* /*
......
...@@ -449,49 +449,6 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0, ...@@ -449,49 +449,6 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0,
} }
EXPORT_SYMBOL(mktime64); EXPORT_SYMBOL(mktime64);
/**
* ns_to_timespec - Convert nanoseconds to timespec
* @nsec: the nanoseconds value to be converted
*
* Returns the timespec representation of the nsec parameter.
*/
struct timespec ns_to_timespec(const s64 nsec)
{
struct timespec ts;
s32 rem;
if (!nsec)
return (struct timespec) {0, 0};
ts.tv_sec = div_s64_rem(nsec, NSEC_PER_SEC, &rem);
if (unlikely(rem < 0)) {
ts.tv_sec--;
rem += NSEC_PER_SEC;
}
ts.tv_nsec = rem;
return ts;
}
EXPORT_SYMBOL(ns_to_timespec);
/**
* ns_to_timeval - Convert nanoseconds to timeval
* @nsec: the nanoseconds value to be converted
*
* Returns the timeval representation of the nsec parameter.
*/
struct timeval ns_to_timeval(const s64 nsec)
{
struct timespec ts = ns_to_timespec(nsec);
struct timeval tv;
tv.tv_sec = ts.tv_sec;
tv.tv_usec = (suseconds_t) ts.tv_nsec / 1000;
return tv;
}
EXPORT_SYMBOL(ns_to_timeval);
struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec) struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec)
{ {
struct timespec64 ts = ns_to_timespec64(nsec); struct timespec64 ts = ns_to_timespec64(nsec);
......
...@@ -83,15 +83,19 @@ static bool init_stack_slab(void **prealloc) ...@@ -83,15 +83,19 @@ static bool init_stack_slab(void **prealloc)
return true; return true;
if (stack_slabs[depot_index] == NULL) { if (stack_slabs[depot_index] == NULL) {
stack_slabs[depot_index] = *prealloc; stack_slabs[depot_index] = *prealloc;
*prealloc = NULL;
} else { } else {
/* If this is the last depot slab, do not touch the next one. */
if (depot_index + 1 < STACK_ALLOC_MAX_SLABS) {
stack_slabs[depot_index + 1] = *prealloc; stack_slabs[depot_index + 1] = *prealloc;
*prealloc = NULL;
}
/* /*
* This smp_store_release pairs with smp_load_acquire() from * This smp_store_release pairs with smp_load_acquire() from
* |next_slab_inited| above and in stack_depot_save(). * |next_slab_inited| above and in stack_depot_save().
*/ */
smp_store_release(&next_slab_inited, 1); smp_store_release(&next_slab_inited, 1);
} }
*prealloc = NULL;
return true; return true;
} }
......
...@@ -699,6 +699,14 @@ EXPORT_SYMBOL(sysfs_streq); ...@@ -699,6 +699,14 @@ EXPORT_SYMBOL(sysfs_streq);
* @n: number of strings in the array or -1 for NULL terminated arrays * @n: number of strings in the array or -1 for NULL terminated arrays
* @string: string to match with * @string: string to match with
* *
* This routine will look for a string in an array of strings up to the
* n-th element in the array or until the first NULL element.
*
* Historically the value of -1 for @n, was used to search in arrays that
* are NULL terminated. However, the function does not make a distinction
* when finishing the search: either @n elements have been compared OR
* the first NULL element was found.
*
* Return: * Return:
* index of a @string in the @array if matches, or %-EINVAL otherwise. * index of a @string in the @array if matches, or %-EINVAL otherwise.
*/ */
...@@ -727,6 +735,14 @@ EXPORT_SYMBOL(match_string); ...@@ -727,6 +735,14 @@ EXPORT_SYMBOL(match_string);
* *
* Returns index of @str in the @array or -EINVAL, just like match_string(). * Returns index of @str in the @array or -EINVAL, just like match_string().
* Uses sysfs_streq instead of strcmp for matching. * Uses sysfs_streq instead of strcmp for matching.
*
* This routine will look for a string in an array of strings up to the
* n-th element in the array or until the first NULL element.
*
* Historically the value of -1 for @n, was used to search in arrays that
* are NULL terminated. However, the function does not make a distinction
* when finishing the search: either @n elements have been compared OR
* the first NULL element was found.
*/ */
int __sysfs_match_string(const char * const *array, size_t n, const char *str) int __sysfs_match_string(const char * const *array, size_t n, const char *str)
{ {
......
...@@ -409,9 +409,11 @@ int memcg_expand_shrinker_maps(int new_id) ...@@ -409,9 +409,11 @@ int memcg_expand_shrinker_maps(int new_id)
if (mem_cgroup_is_root(memcg)) if (mem_cgroup_is_root(memcg))
continue; continue;
ret = memcg_expand_one_shrinker_map(memcg, size, old_size); ret = memcg_expand_one_shrinker_map(memcg, size, old_size);
if (ret) if (ret) {
mem_cgroup_iter_break(NULL, memcg);
goto unlock; goto unlock;
} }
}
unlock: unlock:
if (!ret) if (!ret)
memcg_shrinker_map_size = size; memcg_shrinker_map_size = size;
......
...@@ -876,7 +876,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, ...@@ -876,7 +876,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn,
* Poison uninitialized struct pages in order to catch invalid flags * Poison uninitialized struct pages in order to catch invalid flags
* combinations. * combinations.
*/ */
page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages); page_init_poison(memmap, sizeof(struct page) * nr_pages);
ms = __nr_to_section(section_nr); ms = __nr_to_section(section_nr);
set_section_nid(section_nr, nid); set_section_nid(section_nr, nid);
......
...@@ -3157,7 +3157,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) ...@@ -3157,7 +3157,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
mapping = swap_file->f_mapping; mapping = swap_file->f_mapping;
inode = mapping->host; inode = mapping->host;
/* If S_ISREG(inode->i_mode) will do inode_lock(inode); */ /* will take i_rwsem; */
error = claim_swapfile(p, inode); error = claim_swapfile(p, inode);
if (unlikely(error)) if (unlikely(error))
goto bad_swap; goto bad_swap;
......
...@@ -2415,10 +2415,13 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, ...@@ -2415,10 +2415,13 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
/* /*
* Scan types proportional to swappiness and * Scan types proportional to swappiness and
* their relative recent reclaim efficiency. * their relative recent reclaim efficiency.
* Make sure we don't miss the last page * Make sure we don't miss the last page on
* because of a round-off error. * the offlined memory cgroups because of a
* round-off error.
*/ */
scan = DIV64_U64_ROUND_UP(scan * fraction[file], scan = mem_cgroup_online(memcg) ?
div64_u64(scan * fraction[file], denominator) :
DIV64_U64_ROUND_UP(scan * fraction[file],
denominator); denominator);
break; break;
case SCAN_FILE: case SCAN_FILE:
......
...@@ -932,10 +932,6 @@ sub get_maintainers { ...@@ -932,10 +932,6 @@ sub get_maintainers {
} }
} }
foreach my $fix (@fixes) {
vcs_add_commit_signers($fix, "blamed_fixes");
}
foreach my $email (@email_to, @list_to) { foreach my $email (@email_to, @list_to) {
$email->[0] = deduplicate_email($email->[0]); $email->[0] = deduplicate_email($email->[0]);
} }
...@@ -974,6 +970,10 @@ sub get_maintainers { ...@@ -974,6 +970,10 @@ sub get_maintainers {
} }
} }
foreach my $fix (@fixes) {
vcs_add_commit_signers($fix, "blamed_fixes");
}
my @to = (); my @to = ();
if ($email || $email_list) { if ($email || $email_list) {
if ($email) { if ($email) {
...@@ -1341,35 +1341,11 @@ sub add_categories { ...@@ -1341,35 +1341,11 @@ sub add_categories {
} }
} }
} elsif ($ptype eq "M") { } elsif ($ptype eq "M") {
my ($name, $address) = parse_email($pvalue);
if ($name eq "") {
if ($i > 0) {
my $tv = $typevalue[$i - 1];
if ($tv =~ m/^([A-Z]):\s*(.*)/) {
if ($1 eq "P") {
$name = $2;
$pvalue = format_email($name, $address, $email_usename);
}
}
}
}
if ($email_maintainer) { if ($email_maintainer) {
my $role = get_maintainer_role($i); my $role = get_maintainer_role($i);
push_email_addresses($pvalue, $role); push_email_addresses($pvalue, $role);
} }
} elsif ($ptype eq "R") { } elsif ($ptype eq "R") {
my ($name, $address) = parse_email($pvalue);
if ($name eq "") {
if ($i > 0) {
my $tv = $typevalue[$i - 1];
if ($tv =~ m/^([A-Z]):\s*(.*)/) {
if ($1 eq "P") {
$name = $2;
$pvalue = format_email($name, $address, $email_usename);
}
}
}
}
if ($email_reviewer) { if ($email_reviewer) {
my $subsystem = get_subsystem_name($i); my $subsystem = get_subsystem_name($i);
push_email_addresses($pvalue, "reviewer:$subsystem"); push_email_addresses($pvalue, "reviewer:$subsystem");
......
...@@ -112,6 +112,17 @@ echo "NOTE: The above hugetlb tests provide minimal coverage. Use" ...@@ -112,6 +112,17 @@ echo "NOTE: The above hugetlb tests provide minimal coverage. Use"
echo " https://github.com/libhugetlbfs/libhugetlbfs.git for" echo " https://github.com/libhugetlbfs/libhugetlbfs.git for"
echo " hugetlb regression testing." echo " hugetlb regression testing."
echo "---------------------------"
echo "running map_fixed_noreplace"
echo "---------------------------"
./map_fixed_noreplace
if [ $? -ne 0 ]; then
echo "[FAIL]"
exitcode=1
else
echo "[PASS]"
fi
echo "-------------------" echo "-------------------"
echo "running userfaultfd" echo "running userfaultfd"
echo "-------------------" echo "-------------------"
...@@ -186,6 +197,17 @@ else ...@@ -186,6 +197,17 @@ else
echo "[PASS]" echo "[PASS]"
fi fi
echo "-------------------------"
echo "running mlock-random-test"
echo "-------------------------"
./mlock-random-test
if [ $? -ne 0 ]; then
echo "[FAIL]"
exitcode=1
else
echo "[PASS]"
fi
echo "--------------------" echo "--------------------"
echo "running mlock2-tests" echo "running mlock2-tests"
echo "--------------------" echo "--------------------"
...@@ -197,6 +219,17 @@ else ...@@ -197,6 +219,17 @@ else
echo "[PASS]" echo "[PASS]"
fi fi
echo "-----------------"
echo "running thuge-gen"
echo "-----------------"
./thuge-gen
if [ $? -ne 0 ]; then
echo "[FAIL]"
exitcode=1
else
echo "[PASS]"
fi
if [ $VADDR64 -ne 0 ]; then if [ $VADDR64 -ne 0 ]; then
echo "-----------------------------" echo "-----------------------------"
echo "running virtual_address_range" echo "running virtual_address_range"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment