15 Sep, 2013

1 commit

  • Matt found that commit 27a7c642174e ("partitions/efi: account for pmbr
    size in lba") caused his GPT formatted eMMC device not to boot. The
    reason is that this commit enforced Linux to always check the lesser of
    the whole disk or 2Tib for the pMBR size in LBA. While most disk
    partitioning tools out there create a pMBR with these characteristics,
    Microsoft does not, as it always sets the entry to the maximum 32-bit
    limitation - even though a drive may be smaller than that[1].

    Loosen this check and only verify that the size is either the whole disk
    or 0xFFFFFFFF. No tool in its right mind would set it to any value
    other than these.

    [1] http://thestarman.pcministry.com/asm/mbr/GPT.htm#GPTPT

    Reported-and-tested-by: Matt Porter
    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     

14 Sep, 2013

5 commits

  • Pull writeback fix from Wu Fengguang:
    "A trivial writeback fix"

    * tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Do not sort b_io list only because of block device inode

    Linus Torvalds
     
  • The LRU list changes interacted badly with our nr_dentry_unused
    accounting, and even worse with the new DCACHE_LRU_LIST bit logic.

    This introduces helper functions to make sure everything follows the
    proper dcache d_lru list rules: the dentry cache is complicated by the
    fact that some of the hotpaths don't even want to look at the LRU list
    at all, and the fact that we use the same list entry in the dentry for
    both the LRU list and for our temporary shrinking lists when removing
    things from the LRU.

    The helper functions temporarily have some extra sanity checking for the
    flag bits that have to match the current LRU state of the dentry. We'll
    remove that before the final 3.12 release, but considering how easy it
    is to get wrong, this first cleanup version has some very particular
    sanity checking.

    Acked-by: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull hwmon fixes from Guenter Roeck:
    "Some more low risk cleanup patches:

    - Remove unnecessary pci_set_drvdata in k10temp driver from Jingoo Han
    - Fix return values in several drivers from Sachin Kamat
    - Remove redundant break in amc6821 driver from Sachin Kamat"

    * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    hwmon: (k10temp) remove unnecessary pci_set_drvdata()
    hwmon: (tmp421) Fix return value
    hwmon: (amc6821) Remove redundant break
    hwmon: (amc6821) Fix return value
    hwmon: (ibmaem) Fix return value
    hwmon: (emc2103) Fix return value

    Linus Torvalds
     
  • Pull Xtensa updates from Chris Zankel.

    * tag 'xtensa-next-20130912' of git://github.com/czankel/xtensa-linux:
    xtensa: Fix broken allmodconfig build
    xtensa: remove CCOUNT_PER_JIFFY
    xtensa: fix !CONFIG_XTENSA_CALIBRATE_CCOUNT build failure
    xtensa: don't use echo -e needlessly
    xtensa: new fast_alloca handler
    xtensa: keep a3 and excsave1 on entry to exception handlers
    xtensa: enable kernel preemption
    xtensa: check thread flags atomically on return from user exception

    Linus Torvalds
     
  • Pull aio changes from Ben LaHaise:
    "First off, sorry for this pull request being late in the merge window.
    Al had raised a couple of concerns about 2 items in the series below.
    I addressed the first issue (the race introduced by Gu's use of
    mm_populate()), but he has not provided any further details on how he
    wants to rework the anon_inode.c changes (which were sent out months
    ago but have yet to be commented on).

    The bulk of the changes have been sitting in the -next tree for a few
    months, with all the issues raised being addressed"

    * git://git.kvack.org/~bcrl/aio-next: (22 commits)
    aio: rcu_read_lock protection for new rcu_dereference calls
    aio: fix race in ring buffer page lookup introduced by page migration support
    aio: fix rcu sparse warnings introduced by ioctx table lookup patch
    aio: remove unnecessary debugging from aio_free_ring()
    aio: table lookup: verify ctx pointer
    staging/lustre: kiocb->ki_left is removed
    aio: fix error handling and rcu usage in "convert the ioctx list to table lookup v3"
    aio: be defensive to ensure request batching is non-zero instead of BUG_ON()
    aio: convert the ioctx list to table lookup v3
    aio: double aio_max_nr in calculations
    aio: Kill ki_dtor
    aio: Kill ki_users
    aio: Kill unneeded kiocb members
    aio: Kill aio_rw_vect_retry()
    aio: Don't use ctx->tail unnecessarily
    aio: io_cancel() no longer returns the io_event
    aio: percpu ioctx refcount
    aio: percpu reqs_available
    aio: reqs_active -> reqs_available
    aio: fix build when migration is disabled
    ...

    Linus Torvalds
     

13 Sep, 2013

34 commits

  • Pull generic hardirq option removal from Martin Schwidefsky:
    "All architectures now use generic hardirqs, s390 has been last to
    switch.

    With that the code under !CONFIG_GENERIC_HARDIRQS and the related
    HAVE_GENERIC_HARDIRQS and GENERIC_HARDIRQS config options can be
    removed. Yay!"

    * 'genirq' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    Remove GENERIC_HARDIRQ config option

    Linus Torvalds
     
  • Pull kconfig fix from Michal Marek:
    "This is a fix for a regression caused by my previous pull request.

    A sed command in scripts/config that used colons as separator was
    accidentally changed to use slashes, which fails when you use slashes
    in a value. Changing it back to colons is of course not a proper fix,
    but at least it will be broken in the same way it had been for four
    years. A proper fix is pending"

    * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts/config: fix variable substitution command

    Linus Torvalds
     
  • …realmz6/blackfin-linux

    Pull blackfin updates from Steven Miao.

    * tag 'blackfin-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/realmz6/blackfin-linux:
    blackfin: Ignore generated uImages
    blackfin: Add STMMAC platform data to enable dwmac1000 driver on BF60x.
    bf609: adv7343: add S-Video and Component output support
    bf609: add adv7343 video encoder support
    clock: add stmmac clock for ethernet driver
    blackfin: scb: Add SCB1 to SCB9 config options and data.
    blackfin: scb: Add system crossbar init code.

    Linus Torvalds
     
  • Pull crypto fixes from Herbert Xu:
    "This fixes a 7+ year race condition in the crypto API that causes
    sporadic crashes when multiple threads load the same algorithm.

    It also fixes the crct10dif algorithm again to prevent boot failures
    on systems where the initramfs tool ignores module softdeps"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: crct10dif - Add fallback for broken initrds
    crypto: api - Fix race condition in larval lookup

    Linus Torvalds
     
  • After the last architecture switched to generic hard irqs the config
    options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
    for !CONFIG_GENERIC_HARDIRQS can be removed.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Commit 229455bc02b87f7128f190c4491b4ceffff38648 accidentally changed the
    separator between sed `s' command and its parameters from ':' to '/'.

    Revert this change.

    Reported-and-tested-by: Linus Walleij
    Signed-off-by: Clement Chauplannaz
    Signed-off-by: Michal Marek

    Clement Chauplannaz
     
  • We have the build infrastructure to generate uImages so we should ignore
    the resulting generated files.

    Signed-off-by: Mark Brown
    Acked-by: Mike Frysinger

    Mark Brown
     
  • - Enable GMAC
    - Set propler DMA PBL
    - Disable DMA store and forward mode
    - Select PTP input clock from MII
    clock.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Steven Miao

    Sonic Zhang
     
  • Signed-off-by: Scott Jiang

    Scott Jiang
     
  • Signed-off-by: Scott Jiang

    Scott Jiang
     
  • Signed-off-by: Steven Miao

    Steven Miao
     
  • Signed-off-by: Sonic Zhang

    Sonic Zhang
     
  • If SCB exists in select blackfin cpu, developer can change the SCB
    priority in kernel configuration.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Steven Miao

    Steven Miao
     
  • Pull MIPS updates from Ralf Baechle:
    "This has been sitting in -next for a while with no objections and all
    MIPS defconfigs except one are building fine; that one platform got
    broken by another patch in your tree and I'm going to submit a patch
    separately.

    - a handful of fixes that didn't make 3.11
    - a few bits of Octeon 3 support with more to come for a later
    release
    - platform enhancements for Octeon, ath79, Lantiq, Netlogic and
    Ralink SOCs
    - a GPIO driver for the Octeon
    - some dusting off of the DECstation code
    - the usual dose of cleanups"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (65 commits)
    MIPS: DMA: Fix BUG due to smp_processor_id() in preemptible code
    MIPS: kexec: Fix random crashes while loading crashkernel
    MIPS: kdump: Skip walking indirection page for crashkernels
    MIPS: DECstation HRT calibration bug fixes
    MIPS: Export copy_from_user_page() (needed by lustre)
    MIPS: Add driver for the built-in PCI controller of the RT3883 SoC
    MIPS: DMA: For BMIPS5000 cores flush region just like non-coherent R10000
    MIPS: ralink: Add support for reset-controller API
    MIPS: ralink: mt7620: Add cpu-feature-override header
    MIPS: ralink: mt7620: Add spi clock definition
    MIPS: ralink: mt7620: Add wdt clock definition
    MIPS: ralink: mt7620: Improve clock frequency detection
    MIPS: ralink: mt7620: This SoC has EHCI and OHCI hosts
    MIPS: ralink: mt7620: Add verbose ram info
    MIPS: ralink: Probe clocksources from OF
    MIPS: ralink: Add support for systick timer found on newer ralink SoC
    MIPS: ralink: Add support for periodic timer irq
    MIPS: Netlogic: Built-in DTB for XLP2xx SoC boards
    MIPS: Netlogic: Add support for USB on XLP2xx
    MIPS: Netlogic: XLP2xx update for I2C controller
    ...

    Linus Torvalds
     
  • Pull xfs update #2 from Ben Myers:
    "Here we have defrag support for v5 superblock, a number of bugfixes
    and a cleanup or two.

    - defrag support for CRC filesystems
    - fix endian worning in xlog_recover_get_buf_lsn
    - fixes for sparse warnings
    - fix for assert in xfs_dir3_leaf_hdr_from_disk
    - fix for log recovery of remote symlinks
    - fix for log recovery of btree root splits
    - fixes formemory allocation failures with ACLs
    - fix for assert in xfs_buf_item_relse
    - fix for assert in xfs_inode_buf_verify
    - fix an assignment in an assert that should be a test in
    xfs_bmbt_change_owner
    - remove dead code in xlog_recover_inode_pass2"

    * tag 'xfs-for-linus-v3.12-rc1-2' of git://oss.sgi.com/xfs/xfs:
    xfs: remove dead code from xlog_recover_inode_pass2
    xfs: = vs == typo in ASSERT()
    xfs: don't assert fail on bad inode numbers
    xfs: aborted buf items can be in the AIL.
    xfs: factor all the kmalloc-or-vmalloc fallback allocations
    xfs: fix memory allocation failures with ACLs
    xfs: ensure we copy buffer type in da btree root splits
    xfs: set remote symlink buffer type for recovery
    xfs: recovery of swap extents operations for CRC filesystems
    xfs: swap extents operations for CRC filesystems
    xfs: check magic numbers in dir3 leaf verifier first
    xfs: fix some minor sparse warnings
    xfs: fix endian warning in xlog_recover_get_buf_lsn()

    Linus Torvalds
     
  • Pull SCSI target updates from Nicholas Bellinger:
    "Lots of activity again this round for I/O performance optimizations
    (per-cpu IDA pre-allocation for vhost + iscsi/target), and the
    addition of new fabric independent features to target-core
    (COMPARE_AND_WRITE + EXTENDED_COPY).

    The main highlights include:

    - Support for iscsi-target login multiplexing across individual
    network portals
    - Generic Per-cpu IDA logic (kent + akpm + clameter)
    - Conversion of vhost to use per-cpu IDA pre-allocation for
    descriptors, SGLs and userspace page pointer list
    - Conversion of iscsi-target + iser-target to use per-cpu IDA
    pre-allocation for descriptors
    - Add support for generic COMPARE_AND_WRITE (AtomicTestandSet)
    emulation for virtual backend drivers
    - Add support for generic EXTENDED_COPY (CopyOffload) emulation for
    virtual backend drivers.
    - Add support for fast memory registration mode to iser-target (Vu)

    The patches to add COMPARE_AND_WRITE and EXTENDED_COPY support are of
    particular significance, which make us the first and only open source
    target to support the full set of VAAI primitives.

    Currently Linux clients are lacking upstream support to actually
    utilize these primitives. However, with server side support now in
    place for folks like MKP + ZAB working on the client, this logic once
    reserved for the highest end of storage arrays, can now be run in VMs
    on their laptops"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (50 commits)
    target/iscsi: Bump versions to v4.1.0
    target: Update copyright ownership/year information to 2013
    iscsi-target: Bump default TCP listen backlog to 256
    target: Fix >= v3.9+ regression in PR APTPL + ALUA metadata write-out
    iscsi-target; Bump default CmdSN Depth to 64
    iscsi-target: Remove unnecessary wait_for_completion in iscsi_get_thread_set
    iscsi-target: Add thread_set->ts_activate_sem + use common deallocate
    iscsi-target: Fix race with thread_pre_handler flush_signals + ISCSI_THREAD_SET_DIE
    target: remove unused including
    iser-target: introduce fast memory registration mode (FRWR)
    iser-target: generalize rdma memory registration and cleanup
    iser-target: move rdma wr processing to a shared function
    target: Enable global EXTENDED_COPY setup/release
    target: Add Third Party Copy (3PC) bit in INQUIRY response
    target: Enable EXTENDED_COPY setup in spc_parse_cdb
    target: Add support for EXTENDED_COPY copy offload emulation
    target: Avoid non-existent tg_pt_gp_mem in target_alua_state_check
    target: Add global device list for EXTENDED_COPY
    target: Make helpers non static for EXTENDED_COPY command setup
    target: Make spc_parse_naa_6h_vendor_specific non static
    ...

    Linus Torvalds
     
  • Merge more patches from Andrew Morton:
    "The rest of MM. Plus one misc cleanup"

    * emailed patches from Andrew Morton : (35 commits)
    mm/Kconfig: add MMU dependency for MIGRATION.
    kernel: replace strict_strto*() with kstrto*()
    mm, thp: count thp_fault_fallback anytime thp fault fails
    thp: consolidate code between handle_mm_fault() and do_huge_pmd_anonymous_page()
    thp: do_huge_pmd_anonymous_page() cleanup
    thp: move maybe_pmd_mkwrite() out of mk_huge_pmd()
    mm: cleanup add_to_page_cache_locked()
    thp: account anon transparent huge pages into NR_ANON_PAGES
    truncate: drop 'oldsize' truncate_pagecache() parameter
    mm: make lru_add_drain_all() selective
    memcg: document cgroup dirty/writeback memory statistics
    memcg: add per cgroup writeback pages accounting
    memcg: check for proper lock held in mem_cgroup_update_page_stat
    memcg: remove MEMCG_NR_FILE_MAPPED
    memcg: reduce function dereference
    memcg: avoid overflow caused by PAGE_ALIGN
    memcg: rename RESOURCE_MAX to RES_COUNTER_MAX
    memcg: correct RESOURCE_MAX to ULLONG_MAX
    mm: memcg: do not trap chargers with full callstack on OOM
    mm: memcg: rework and document OOM waiting and wakeup
    ...

    Linus Torvalds
     
  • MIGRATION must depend on MMU, or allmodconfig for the nommu sh
    architecture fails to build:

    CC mm/migrate.o
    mm/migrate.c: In function 'remove_migration_pte':
    mm/migrate.c:134:3: error: implicit declaration of function 'pmd_trans_huge' [-Werror=implicit-function-declaration]
    if (pmd_trans_huge(*pmd))
    ^
    mm/migrate.c:149:2: error: implicit declaration of function 'is_swap_pte' [-Werror=implicit-function-declaration]
    if (!is_swap_pte(pte))
    ^
    ...

    Also let CMA depend on MMU, or when NOMMU, if we select CMA, it will
    select MIGRATION by force.

    Signed-off-by: Chen Gang
    Reviewed-by: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gang
     
  • The usage of strict_strto*() is not preferred, because strict_strto*() is
    obsolete. Thus, kstrto*() should be used.

    Signed-off-by: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Currently, thp_fault_fallback in vmstat only gets incremented if a
    hugepage allocation fails. If current's memcg hits its limit or the page
    fault handler returns an error, it is incorrectly accounted as a
    successful thp_fault_alloc.

    Count thp_fault_fallback anytime the page fault handler falls back to
    using regular pages and only count thp_fault_alloc when a hugepage has
    actually been faulted.

    Signed-off-by: David Rientjes
    Cc: Mel Gorman
    Cc: Andrea Arcangeli
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • do_huge_pmd_anonymous_page() has copy-pasted piece of handle_mm_fault()
    to handle fallback path.

    Let's consolidate code back by introducing VM_FAULT_FALLBACK return
    code.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Hillf Danton
    Cc: Andrea Arcangeli
    Cc: Al Viro
    Cc: Hugh Dickins
    Cc: Wu Fengguang
    Cc: Jan Kara
    Cc: Mel Gorman
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Dave Hansen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Minor cleanup: unindent most code of the fucntion by inverting one
    condition. It's preparation for the next patch.

    No functional changes.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Hillf Danton
    Cc: Andrea Arcangeli
    Cc: Al Viro
    Cc: Hugh Dickins
    Cc: Wu Fengguang
    Cc: Jan Kara
    Cc: Mel Gorman
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Dave Hansen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • It's confusing that mk_huge_pmd() has semantics different from mk_pte() or
    mk_pmd(). I spent some time on debugging issue cased by this
    inconsistency.

    Let's move maybe_pmd_mkwrite() out of mk_huge_pmd() and adjust prototype
    to match mk_pte().

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Dave Hansen
    Cc: Andrea Arcangeli
    Cc: Al Viro
    Cc: Hugh Dickins
    Cc: Wu Fengguang
    Cc: Jan Kara
    Cc: Mel Gorman
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Hillf Danton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Make add_to_page_cache_locked() cleaner:

    - unindent most code of the function by inverting one condition;
    - streamline code no-error path;
    - move insert error path outside normal code path;
    - call radix_tree_preload_end() earlier;

    No functional changes.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Dave Hansen
    Cc: Andrea Arcangeli
    Cc: Al Viro
    Cc: Hugh Dickins
    Cc: Wu Fengguang
    Cc: Jan Kara
    Cc: Mel Gorman
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Hillf Danton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • We use NR_ANON_PAGES as base for reporting AnonPages to user. There's
    not much sense in not accounting transparent huge pages there, but add
    them on printing to user.

    Let's account transparent huge pages in NR_ANON_PAGES in the first place.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Dave Hansen
    Cc: Andrea Arcangeli
    Cc: Al Viro
    Cc: Hugh Dickins
    Cc: Wu Fengguang
    Cc: Jan Kara
    Cc: Mel Gorman
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Hillf Danton
    Cc: Ning Qu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • truncate_pagecache() doesn't care about old size since commit
    cedabed49b39 ("vfs: Fix vmtruncate() regression"). Let's drop it.

    Signed-off-by: Kirill A. Shutemov
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • make lru_add_drain_all() only selectively interrupt the cpus that have
    per-cpu free pages that can be drained.

    This is important in nohz mode where calling mlockall(), for example,
    otherwise will interrupt every core unnecessarily.

    This is important on workloads where nohz cores are handling 10 Gb traffic
    in userspace. Those CPUs do not enter the kernel and place pages into LRU
    pagevecs and they really, really don't want to be interrupted, or they
    drop packets on the floor.

    Signed-off-by: Chris Metcalf
    Reviewed-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Signed-off-by: Sha Zhengju
    Cc: Fengguang Wu
    Cc: Greg Thelen
    Cc: KAMEZAWA Hiroyuki
    Cc: Michal Hocko
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • Add memcg routines to count writeback pages, later dirty pages will also
    be accounted.

    After Kame's commit 89c06bd52fb9 ("memcg: use new logic for page stat
    accounting"), we can use 'struct page' flag to test page state instead
    of per page_cgroup flag. But memcg has a feature to move a page from a
    cgroup to another one and may have race between "move" and "page stat
    accounting". So in order to avoid the race we have designed a new lock:

    mem_cgroup_begin_update_page_stat()
    modify page information -->(a)
    mem_cgroup_update_page_stat() -->(b)
    mem_cgroup_end_update_page_stat()

    It requires both (a) and (b)(writeback pages accounting) to be pretected
    in mem_cgroup_{begin/end}_update_page_stat(). It's full no-op for
    !CONFIG_MEMCG, almost no-op if memcg is disabled (but compiled in), rcu
    read lock in the most cases (no task is moving), and spin_lock_irqsave
    on top in the slow path.

    There're two writeback interfaces to modify: test_{clear/set}_page_writeback().
    And the lock order is:
    --> memcg->move_lock
    --> mapping->tree_lock

    Signed-off-by: Sha Zhengju
    Acked-by: Michal Hocko
    Reviewed-by: Greg Thelen
    Cc: Fengguang Wu
    Cc: KAMEZAWA Hiroyuki
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • We should call mem_cgroup_begin_update_page_stat() before
    mem_cgroup_update_page_stat() to get proper locks, however the latter
    doesn't do any checking that we use proper locking, which would be hard.
    Suggested by Michal Hock we could at least test for rcu_read_lock_held()
    because RCU is held if !mem_cgroup_disabled().

    Signed-off-by: Sha Zhengju
    Acked-by: Michal Hocko
    Reviewed-by: Greg Thelen
    Cc: Fengguang Wu
    Cc: KAMEZAWA Hiroyuki
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • While accounting memcg page stat, it's not worth to use
    MEMCG_NR_FILE_MAPPED as an extra layer of indirection because of the
    complexity and presumed performance overhead. We can use
    MEM_CGROUP_STAT_FILE_MAPPED directly.

    Signed-off-by: Sha Zhengju
    Acked-by: KAMEZAWA Hiroyuki
    Acked-by: Michal Hocko
    Acked-by: Fengguang Wu
    Reviewed-by: Greg Thelen
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • This function dereferences res far too often, so optimize it.

    Signed-off-by: Sha Zhengju
    Signed-off-by: Qiang Huang
    Acked-by: Michal Hocko
    Cc: Daisuke Nishimura
    Cc: Jeff Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • Since PAGE_ALIGN is aligning up(the next page boundary), so after
    PAGE_ALIGN, the value might be overflow, such as write the MAX value to
    *.limit_in_bytes.

    $ cat /cgroup/memory/memory.limit_in_bytes
    18446744073709551615

    # echo 18446744073709551615 > /cgroup/memory/memory.limit_in_bytes
    bash: echo: write error: Invalid argument

    Some user programs might depend on such behaviours(like libcg, we read
    the value in snapshot, then use the value to reset cgroup later), and
    that will cause confusion. So we need to fix it.

    Signed-off-by: Sha Zhengju
    Signed-off-by: Qiang Huang
    Acked-by: Michal Hocko
    Cc: Daisuke Nishimura
    Cc: Jeff Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju
     
  • RESOURCE_MAX is far too general name, change it to RES_COUNTER_MAX.

    Signed-off-by: Sha Zhengju
    Signed-off-by: Qiang Huang
    Acked-by: Michal Hocko
    Cc: Daisuke Nishimura
    Cc: Jeff Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sha Zhengju