Re: [patch v2] mm, hugetlb: abort __get_user_pages if current has been oom killed

2015-03-09 Thread Greg Thelen
On Mon, Mar 09 2015, David Rientjes wrote: If __get_user_pages() is faulting a significant number of hugetlb pages, usually as the result of mmap(MAP_LOCKED), it can potentially allocate a very large amount of memory. If the process has been oom killed, this will cause a lot of memory to

Re: [patch v3] mm, hugetlb: abort __get_user_pages if current has been oom killed

2015-03-09 Thread Greg Thelen
page faults now terminate when the process has been oom killed. Cc: Greg Thelen gthe...@google.com Cc: Naoya Horiguchi n-horigu...@ah.jp.nec.com Cc: Davidlohr Bueso d...@stgolabs.net Acked-by: Kirill A. Shutemov kir...@shutemov.name Signed-off-by: David Rientjes rient...@google.com Looks good

Re: [patch 2/2] mm: memcontrol: default hierarchy interface for memory

2015-01-13 Thread Greg Thelen
On Thu, Jan 08 2015, Johannes Weiner wrote: Introduce the basic control files to account, partition, and limit memory using cgroups in default hierarchy mode. This interface versioning allows us to address fundamental design issues in the existing memory cgroup interface, further explained

Re: [RFC] Making memcg track ownership per address_space or anon_vma

2015-01-29 Thread Greg Thelen
On Thu, Jan 29 2015, Tejun Heo wrote: Hello, Since the cgroup writeback patchset[1] have been posted, several people brought up concerns about the complexity of allowing an inode to be dirtied against multiple cgroups is necessary for the purpose of writeback and it is true that a

Re: [RFC 4/8] jbd, jbd2: Do not fail journal because of frozen_buffer allocation failure

2015-08-05 Thread Greg Thelen
mho...@kernel.org wrote: From: Michal Hocko mho...@suse.com Journal transaction might fail prematurely because the frozen_buffer is allocated by GFP_NOFS request: [ 72.440013] do_get_write_access: OOM for frozen_buffer [ 72.440014] EXT4-fs: ext4_reserve_inode_write:4729: aborting

Re: 4.3-rc1 dirty page count underflow (cgroup-related?)

2015-09-18 Thread Greg Thelen
Dave Hansen wrote: > I've been seeing some strange behavior with 4.3-rc1 kernels on my Ubuntu > 14.04.3 system. The system will run fine for a few hours, but suddenly > start becoming horribly I/O bound. A compile of perf for instance takes > 20-30 minutes and the compile seems entirely I/O

Re: [PATCH 1/5] mm: uncharge kmem pages from generic free_page path

2015-09-30 Thread Greg Thelen
Vladimir Davydov wrote: > Currently, to charge a page to kmemcg one should use alloc_kmem_pages > helper. When the page is not needed anymore it must be freed with > free_kmem_pages helper, which will uncharge the page before freeing it. > Such a design is acceptable for thread info pages and

Re: 4.3-rc1 dirty page count underflow (cgroup-related?)

2015-09-21 Thread Greg Thelen
Dave Hansen wrote: > On 09/17/2015 11:09 PM, Greg Thelen wrote: >> I'm not denying the issue, bug the WARNING splat isn't necessarily >> catching a problem. The corresponding code comes from your debug patch: >> + >> WARN_ONCE(__this_cpu_read(memcg->sta

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-22 Thread Greg Thelen
Andrew Morton wrote: > On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen <gthe...@google.com> wrote: > >> mem_cgroup_read_stat() returns a page count by summing per cpu page >> counters. The summing is racy wrt. updates, so a transient negative sum >> is possible

[PATCH] memcg: remove pcp_counter_lock

2015-09-22 Thread Greg Thelen
Commit 733a572e66d2 ("memcg: make mem_cgroup_read_{stat|event}() iterate possible cpus instead of online") removed the last use of the per memcg pcp_counter_lock but forgot to remove the variable. Kill the vestigial variable. Signed-off-by: Greg Thelen <gthe...@google.com> --

[PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-22 Thread Greg Thelen
shouldn't show confusing negative usage. - tree_usage() already avoids negatives. Avoid returning negative page counts from mem_cgroup_read_stat() and convert it to unsigned. Signed-off-by: Greg Thelen <gthe...@google.com> --- mm/memcontrol.c | 30 ++ 1 file chang

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-23 Thread Greg Thelen
Andrew Morton wrote: > On Tue, 22 Sep 2015 17:42:13 -0700 Greg Thelen <gthe...@google.com> wrote: > >> Andrew Morton wrote: >> >> > On Tue, 22 Sep 2015 15:16:32 -0700 Greg Thelen <gthe...@google.com> wrote: >> > >> >> mem_cgr

Re: [PATCH] memcg: make mem_cgroup_read_stat() unsigned

2015-09-25 Thread Greg Thelen
Michal Hocko wrote: > On Tue 22-09-15 15:16:32, Greg Thelen wrote: >> mem_cgroup_read_stat() returns a page count by summing per cpu page >> counters. The summing is racy wrt. updates, so a transient negative sum >> is possible. Callers don't want negative values: >

Re: 4.3-rc1 dirty page count underflow (cgroup-related?)

2015-09-18 Thread Greg Thelen
Greg Thelen wrote: > Dave Hansen wrote: > >> I've been seeing some strange behavior with 4.3-rc1 kernels on my Ubuntu >> 14.04.3 system. The system will run fine for a few hours, but suddenly >> start becoming horribly I/O bound. A compile of perf for instanc

[PATCH] fs, seqfile: always allow oom killer

2015-09-25 Thread Greg Thelen
but larger files use the oom killer to avoid ENOMEM. Memory overcommit requires use of the oom killer to select a victim regardless of file size. Enable oom killer for small seq_buf_alloc() allocations. Signed-off-by: David Rientjes <rient...@google.com> Signed-off-by: Greg Thelen <gthe...@

Re: [GIT PULL] ext4 bug fixes for 4.6

2016-04-09 Thread Greg Thelen
Theodore Ts'o wrote: > The following changes since commit 243d50678583100855862bc084b8b307eea67f68: > > Merge branch 'overlayfs-linus' of > git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs (2016-03-22 > 13:11:15 -0700) > n> are available in the git repository at: > >

[PATCH] memcg: fix stale mem_cgroup_force_empty() comment

2016-05-06 Thread Greg Thelen
commit f61c42a7d911 ("memcg: remove tasks/children test from mem_cgroup_force_empty()") removed memory reparenting from the function. Fix the function's comment. Signed-off-by: Greg Thelen <gthe...@google.com> --- mm/memcontrol.c | 3 +-- 1 file changed, 1 insertion(+), 2 de

[PATCH 1/2] kasan: drain quarantine of memcg slab objects

2016-12-20 Thread Greg Thelen
(). This leak only affects destroyed SLAB_ACCOUNT kmem caches when kasan is enabled. So I don't think it's worth patching stable kernels. Signed-off-by: Greg Thelen <gthe...@google.com> --- include/linux/kasan.h | 4 ++-- mm/kasan/kasan.c | 2 +- mm/kasan/quarantine.c | 1 + mm/slab_common

[PATCH 2/2] kasan: add memcg kmem_cache test

2016-12-20 Thread Greg Thelen
ccounted object [ 124.456789] kmem_cache_destroy test_cache: Slab cache still has objects Kernels with fix [1] don't have the "Slab cache still has objects" warning or the underlying leak. The new test runs and passes in the default (root) memcg, though in the root memcg it won't uncover the pro

[PATCH] slab: avoid IPIs when creating kmem caches

2017-04-16 Thread Greg Thelen
quot;cgroup.procs") for i in range(n): os.rmdir(str(i)) patched: 1 loops: 1069 => 1170 (+101 ipis) unpatched: 1 loops: 1192 => 48933 (+47741 ipis) Signed-off-by: Greg Thelen <gthe...@google.com> --- mm/slab.c | 7 ++- 1 file changed, 6 insertions(

[PATCH] net/mlx4: suppress 'may be used uninitialized' warning

2017-04-18 Thread Greg Thelen
in this function [-Wmaybe-uninitialized] mpt->mtt = mtt; I think this warning is a false complaint. mpt is only used when mr_res_start_move_to() return zero, and in all such cases it initializes mpt. But apparently gcc cannot see that. Initialize mpt to avoid the warning. Signed-off-by: G

Re: [PATCH] net/mlx4: suppress 'may be used uninitialized' warning

2017-04-18 Thread Greg Thelen
Leon Romanovsky <l...@kernel.org> wrote: > [ Unknown signature status ] > On Mon, Apr 17, 2017 at 11:21:35PM -0700, Greg Thelen wrote: >> gcc 4.8.4 complains that mlx4_SW2HW_MPT_wrapper() uses an uninitialized >> 'mpt' variable: >> drivers/net/ethernet/me

Re: [PATCH] fs, mm: account filp and names caches to kmemcg

2017-10-09 Thread Greg Thelen
Michal Hocko wrote: > On Fri 06-10-17 12:33:03, Shakeel Butt wrote: >> >> names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0, >> >> - SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); >> >> +

Re: [PATCH] fs, mm: account filp and names caches to kmemcg

2017-10-12 Thread Greg Thelen
Johannes Weiner wrote: > On Tue, Oct 10, 2017 at 04:24:34PM +0200, Michal Hocko wrote: >> On Tue 10-10-17 10:17:33, Johannes Weiner wrote: >> > On Tue, Oct 10, 2017 at 11:14:30AM +0200, Michal Hocko wrote: >> > > On Mon 09-10-17 16:26:13, Johannes Weiner wrote: >> > > > It's

[PATCH] block: tolerate tracing of NULL bio

2017-09-07 Thread Greg Thelen
gendisk pointer and partitions index") Signed-off-by: Greg Thelen <gthe...@google.com> --- include/trace/events/block.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index f815aaaef755..1fd7ff1a46f7 100644

Re: [PATCH v2] mm, shrinker: make shrinker_list lockless

2017-11-08 Thread Greg Thelen
(off list) Shakeel Butt wrote: > In our production, we have observed that the job loader gets stuck for > 10s of seconds while doing mount operation. It turns out that it was > stuck in register_shrinker() and some unrelated job was under memory > pressure and spending time

Re: [PATCH] fs, mm: account filp and names caches to kmemcg

2017-10-25 Thread Greg Thelen
Johannes Weiner wrote: > On Wed, Oct 25, 2017 at 09:00:57PM +0200, Michal Hocko wrote: >> On Wed 25-10-17 14:11:06, Johannes Weiner wrote: >> > "Safe" is a vague term, and it doesn't make much sense to me in this >> > situation. The OOM behavior should be predictable and

Re: [PATCH] fs, mm: account filp and names caches to kmemcg

2017-10-25 Thread Greg Thelen
Michal Hocko wrote: > On Tue 24-10-17 14:58:54, Johannes Weiner wrote: >> On Tue, Oct 24, 2017 at 07:55:58PM +0200, Michal Hocko wrote: >> > On Tue 24-10-17 13:23:30, Johannes Weiner wrote: >> > > On Tue, Oct 24, 2017 at 06:22:13PM +0200, Michal Hocko wrote: >> > [...] >> > >

Re: [PATCH 3/5] ib_srpt: depend on INFINIBAND_ADDR_TRANS

2018-05-03 Thread Greg Thelen
On Tue, May 1, 2018 at 1:48 PM Jason Gunthorpe <j...@ziepe.ca> wrote: > On Tue, May 01, 2018 at 03:08:57AM +0000, Greg Thelen wrote: > > On Mon, Apr 30, 2018 at 4:35 PM Jason Gunthorpe <j...@ziepe.ca> wrote: > > > > > On Wed, Apr 25, 2018 at

Re: [PATCH] IB: Revert "remove redundant INFINIBAND kconfig dependencies"

2018-05-25 Thread Greg Thelen
ib_dealloc_pd' > Fixes: 9533b292a7ac ("IB: remove redundant INFINIBAND kconfig dependencies") > Signed-off-by: Arnd Bergmann <a...@arndb.de> Acked-by: Greg Thelen <gthe...@google.com> Sorry for the 9533b292a7ac problem. At this point the in release cycle, I think A

[PATCH] trace: fix SKIP_STACK_VALIDATION=1 build

2018-06-08 Thread Greg Thelen
akenly set. Relocate endif to balance the newly added -record-mcount check. Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace") Signed-off-by: Greg Thelen --- scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/sc

Re: [PATCH] IB: Revert "remove redundant INFINIBAND kconfig dependencies"

2018-05-28 Thread Greg Thelen
Jason Gunthorpe wrote: On Fri, May 25, 2018 at 05:32:52PM -0700, Greg Thelen wrote: On Fri, May 25, 2018 at 2:32 PM Arnd Bergmann wrote: > Several subsystems depend on INFINIBAND_ADDR_TRANS, which in turn depends > on INFINIBAND. However, when with CONFIG_INIFIBAND=m, this

[PATCH] mm: convert scan_control.priority int => byte

2018-05-28 Thread Greg Thelen
te) rather than u8 to allow for loops like: do { ... } while (--sc.priority >= 0); This reduces sizeof(struct scan_control) from 96 => 88 bytes (x86_64), which saves some stack. scan_control.priority field order is changed to occupy otherwise unused padding. Sig

Re: [PATCH] iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency

2018-05-30 Thread Greg Thelen
rdma_cm.ko? That > > >>> is not correct. > > >> That seems like a reasonable thing to do.. > > > rdma_ucm.ko is for usermode users, rdma_cm.ko is for kernel users, and > > > is required for iwarp drivers. It seems rdma_cm.ko is not being > > > compiled if ADDR_TRANS is not set. > I think the intention was to completely disable rdma-cm, including all > support for rx'ing remote packets? Greg? Yes. That's my goal when INFINIBAND_ADDR_TRANS is unset. > If this is required for iwarp then Arnd's patch is probably the right > way to go.. > Jason Agreed. Acked-by: Greg Thelen

[PATCH v2] mm: condense scan_control

2018-05-30 Thread Greg Thelen
at s8 is capable of storing max values. This reduces sizeof(struct scan_control): * 96 => 80 bytes (x86_64) * 68 => 56 bytes (i386) scan_control structure field order is changed to utilize padding. After this patch there is 1 bit of scan_control padding. Signed-off-by: Greg Thelen Suggested-by: M

Re: [PATCH] mm: convert scan_control.priority int => byte

2018-05-30 Thread Greg Thelen
Matthew Wilcox wrote: > On Mon, May 28, 2018 at 07:40:25PM -0700, Greg Thelen wrote: >> Reclaim priorities range from 0..12(DEF_PRIORITY). >> scan_control.priority is a 4 byte int, which is overkill. >> >> Since commit 6538b8ea886e ("x86_64: expand kerne

Re: [PATCH] iw_cxgb4: add INFINIBAND_ADDR_TRANS dependency

2018-06-07 Thread Greg Thelen
On Mon, Jun 4, 2018 at 4:07 PM Jason Gunthorpe wrote: > > On Thu, May 31, 2018 at 02:40:59PM -0400, Doug Ledford wrote: > > On Wed, 2018-05-30 at 21:03 -0700, Greg Thelen wrote: > > > On Wed, May 30, 2018 at 4:01 PM Jason Gunthorpe wrote: > > > > > > >

Re: [PATCH] memcg, oom: move out_of_memory back to the charge path

2018-06-29 Thread Greg Thelen
Michal Hocko wrote: > On Thu 28-06-18 16:19:07, Greg Thelen wrote: >> Michal Hocko wrote: > [...] >> > + if (mem_cgroup_out_of_memory(memcg, mask, order)) >> > + return OOM_SUCCESS; >> > + >> > + WARN(1,"Memory

[PATCH] writeback: update stale account_page_redirty() comment

2018-06-25 Thread Greg Thelen
commit 93f78d882865 ("writeback: move backing_dev_info->bdi_stat[] into bdi_writeback") replaced BDI_DIRTIED with WB_DIRTIED in account_page_redirty(). Update comment to track that change. BDI_DIRTIED => WB_DIRTIED BDI_WRITTEN => WB_WRITTEN Signed-off-by: Greg T

Re: [PATCH v2] mm: condense scan_control

2018-06-20 Thread Greg Thelen
On Tue, May 29, 2018 at 11:12 PM Greg Thelen wrote: > > Use smaller scan_control fields for order, priority, and reclaim_idx. > Convert fields from int => s8. All easily fit within a byte: > * allocation order range: 0..MAX_ORDER(64?) > * priority range:

Re: [PATCH] memcg, oom: move out_of_memory back to the charge path

2018-07-03 Thread Greg Thelen
Michal Hocko wrote: > On Fri 29-06-18 11:59:04, Greg Thelen wrote: >> Michal Hocko wrote: >> >> > On Thu 28-06-18 16:19:07, Greg Thelen wrote: >> >> Michal Hocko wrote: >> > [...] >> >> > + if (mem_cgroup_out_of_memory(mem

[PATCH 0/6] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-26 Thread Greg Thelen
rans_rdma.c - depends on NET_9P_RDMA => INFINIBAND_ADDR_TRANS net/rds/ib.c net/rds/ib_cm.c net/rds/rdma_transport.c - depends on RDS_RDMA => INFINIBAND_ADDR_TRANS net/sunrpc/xprtrdma/svc_rdma_transport.c net/sunrpc/xprtrdma/transport.c net/sunrpc/xprtrdma/verbs.c - depends on SUNRPC_XP

[PATCH 5/6] ib_srp: depend on INFINIBAND_ADDR_TRANS

2018-04-26 Thread Greg Thelen
INFINIBAND_SRP code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com>

[PATCH 6/6] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-26 Thread Greg Thelen
Allow INFINIBAND without INFINIBAND_ADDR_TRANS because fuzzing has been finding fair number of CM bugs. So provide option to disable it. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drivers/infiniband/Kconfig | 5 - 1 file changed,

[PATCH 4/6] cifs: smbd: depend on INFINIBAND_ADDR_TRANS

2018-04-26 Thread Greg Thelen
CIFS_SMB_DIRECT code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> Reviewed

[PATCH 3/6] ib_srpt: depend on INFINIBAND_ADDR_TRANS

2018-04-26 Thread Greg Thelen
INFINIBAND_SRPT code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com>

[PATCH 1/6] nvme: depend on INFINIBAND_ADDR_TRANS

2018-04-26 Thread Greg Thelen
NVME_RDMA code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drive

[PATCH 2/6] nvmet-rdma: depend on INFINIBAND_ADDR_TRANS

2018-04-26 Thread Greg Thelen
NVME_TARGET_RDMA code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> ---

Re: [PATCH 5/5] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-25 Thread Greg Thelen
On Wed, Apr 25, 2018 at 7:13 PM Bart Van Assche <bart.vanass...@wdc.com> wrote: > On Wed, 2018-04-25 at 15:34 -0700, Greg Thelen wrote: > > Allow INFINIBAND without INFINIBAND_ADDR_TRANS because fuzzing has been > > finding fair number of CM bugs. So provide option to disab

Re: [PATCH 3/5] ib_srpt: depend on INFINIBAND_ADDR_TRANS

2018-04-30 Thread Greg Thelen
On Mon, Apr 30, 2018 at 4:35 PM Jason Gunthorpe <j...@ziepe.ca> wrote: > On Wed, Apr 25, 2018 at 03:33:39PM -0700, Greg Thelen wrote: > > INFINIBAND_SRPT code depends on INFINIBAND_ADDR_TRANS provided symbols. > > So declare the kconfig dependency. This is necessary to a

[PATCH] memcg: mark memcg1_events static const

2018-05-03 Thread Greg Thelen
Mark memcg1_events static: it's only used by memcontrol.c. And mark it const: it's not modified. Signed-off-by: Greg Thelen <gthe...@google.com> --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2bd3df

[PATCH] IB: remove redundant INFINIBAND kconfig dependencies

2018-05-03 Thread Greg Thelen
INFINIBAND_ADDR_TRANS depends on INFINIBAND. So there's no need for options which depend INFINIBAND_ADDR_TRANS to also depend on INFINIBAND. Remove the unnecessary INFINIBAND depends. Signed-off-by: Greg Thelen <gthe...@google.com> --- drivers/infiniband/ulp/srpt/Kconfig | 2 +- driver

Re: [PATCH] fs, mm: account filp and names caches to kmemcg

2017-10-26 Thread Greg Thelen
Michal Hocko wrote: > Greg Thelen wrote: > > So a force charge fallback might be a needed even with oom killer successful > > invocations. Or we'll need to teach out_of_memory() to return three values > > (e.g. NO_VICTIM, NEW_VICTIM, PENDING_VICTIM) and try_charge() can l

Re: [PATCH] memcg, oom: move out_of_memory back to the charge path

2018-07-03 Thread Greg Thelen
Michal Hocko wrote: > On Tue 03-07-18 00:08:05, Greg Thelen wrote: >> Michal Hocko wrote: >> >> > On Fri 29-06-18 11:59:04, Greg Thelen wrote: >> >> Michal Hocko wrote: >> >> >> >> > On Thu 28-

[PATCH v2] writeback: safer lock nesting

2018-04-06 Thread Greg Thelen
table if there's any reason to modify the kernel. I suggest we should to prevent future surprises. Reported-by: Wang Long <wanglon...@meituan.com> Signed-off-by: Greg Thelen <gthe...@google.com> --- Changelog since v1: - add wb_lock_cookie to record lock context. fs/fs-writeback.c

Re: [PATCH] writeback: safer lock nesting

2018-04-06 Thread Greg Thelen
On Fri, Apr 6, 2018 at 1:07 AM Michal Hocko <mho...@kernel.org> wrote: > On Fri 06-04-18 01:03:24, Greg Thelen wrote: > [...] > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > > index d4d04fee568a..d51bae5a53e2 100644 > > --- a/fs/fs-writeback.c > > ++

[PATCH] writeback: safer lock nesting

2018-04-06 Thread Greg Thelen
table if there's any reason to modify the kernel. I suggest we should to prevent future surprises. Reported-by: Wang Long <wanglon...@meituan.com> Signed-off-by: Greg Thelen <gthe...@google.com> --- fs/fs-writeback.c | 5 +++-- include/linux/backing-dev.h | 18 -

[PATCH v4] writeback: safer lock nesting

2018-04-11 Thread Greg Thelen
patch see "[PATCH for-4.4] writeback: safer lock nesting" https://lkml.org/lkml/2018/4/11/146 Fixes: 682aa8e1a6a1 ("writeback: implement unlocked_inode_to_wb transaction and use it for stat updates") Cc: sta...@vger.kernel.org # v4.2+ Reported-by: Wang Long <wanglon...@meitua

[PATCH for-4.4] writeback: safer lock nesting

2018-04-11 Thread Greg Thelen
be able to cherry pick the upstream "writeback: safer lock nesting" patch. ] Fixes: 682aa8e1a6a1 ("writeback: implement unlocked_inode_to_wb transaction and use it for stat updates") Cc: sta...@vger.kernel.org # v4.2+ Reported-by: Wang Long <wanglon...@meituan.com> S

Re: [PATCH for-4.4] writeback: safer lock nesting

2018-04-11 Thread Greg Thelen
On Wed, Apr 11, 2018 at 1:45 AM Greg Thelen <gthe...@google.com> wrote: > lock_page_memcg()/unlock_page_memcg() use spin_lock_irqsave/restore() if > the page's memcg is undergoing move accounting, which occurs when a > process leaves its memcg for a n

[PATCH v2] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-13 Thread Greg Thelen
Allow INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> Change-Id: I6fbbf8a432e467710fa65e4904b7d61880b914e5 --- drivers/infiniband/Kconfig | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH v2] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-14 Thread Greg Thelen
On Sat, Apr 14, 2018 at 8:13 AM Dennis Dalessandro < dennis.dalessan...@intel.com> wrote: > On 4/13/2018 1:27 PM, Greg Thelen wrote: > > Allow INFINIBAND without INFINIBAND_ADDR_TRANS. > > > > Signed-off-by: Greg Thelen <gthe...@google.com> > > Cc: Tarick B

[PATCH v3] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-14 Thread Greg Thelen
Allow INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drivers/infiniband/Kconfig | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/Kconfig b/drivers/infini

[PATCH v3] writeback: safer lock nesting

2018-04-09 Thread Greg Thelen
table if there's any reason to modify the kernel. I suggest we should to prevent future surprises. Reported-by: Wang Long <wanglon...@meituan.com> Signed-off-by: Greg Thelen <gthe...@google.com> Change-Id: Ibb773e8045852978f6207074491d262f1b3fb613 --- Changelog since v2: - explicit

[PATCH] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-13 Thread Greg Thelen
Allow INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drivers/infiniband/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/K

Re: [PATCH v3] writeback: safer lock nesting

2018-04-10 Thread Greg Thelen
On Tue, Apr 10, 2018 at 1:38 PM Andrew Morton <a...@linux-foundation.org> wrote: > On Mon, 9 Apr 2018 17:59:08 -0700 Greg Thelen <gthe...@google.com> wrote: > > lock_page_memcg()/unlock_page_memcg() use spin_lock_irqsave/restore() if > > the page's memcg is underg

Re: [PATCH] writeback: safer lock nesting

2018-04-10 Thread Greg Thelen
On Tue, Apr 10, 2018 at 7:44 PM Wang Long wrote: > > Hi, > > > > [This is an automated email] > > > > This commit has been processed by the -stable helper bot and determined > > to be a high probability candidate for -stable trees. (score: 44.5575) > > > > The bot has

Re: [PATCH v3] writeback: safer lock nesting

2018-04-10 Thread Greg Thelen
On Tue, Apr 10, 2018 at 1:15 AM Wang Long wrote: > > lock_page_memcg()/unlock_page_memcg() use spin_lock_irqsave/restore() if > > the page's memcg is undergoing move accounting, which occurs when a > > process leaves its memcg for a new one that has > >

Re: [PATCH] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-15 Thread Greg Thelen
On Sun, Apr 15, 2018 at 5:06 AM Christoph Hellwig <h...@infradead.org> wrote: > On Fri, Apr 13, 2018 at 12:06:44AM -0700, Greg Thelen wrote: > > Allow INFINIBAND without INFINIBAND_ADDR_TRANS. > Why? We are pushing everyone heavily to use RDMA/CM, so making it > optional

[RFC PATCH 0/2] memory.low,min reclaim

2018-04-22 Thread Greg Thelen
"${CGPATH}/i/K/memory.${LIM}" echo 2G > "${CGPATH}/L/memory.${LIM}" echo 4G > "${CGPATH}/L/memory.max" echo 3G > "${CGPATH}/L/m/memory.${LIM}" echo 1G > "${CGPATH}/L/N/memory.${LIM}" vmtouch A/b /file_b 2G vmtouch A/C /file_C 2G

[RFC PATCH 1/2] memcg: fix memory.low

2018-04-22 Thread Greg Thelen
When targeting reclaim to a memcg, protect that memcg from reclaim is memory consumption of any level is below respective memory.low. Signed-off-by: Greg Thelen <gthe...@google.com> --- mm/memcontrol.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --gi

[RFC PATCH 2/2] memcg: add memory.min

2018-04-22 Thread Greg Thelen
The new memory.min limit is similar to memory.low, just no bypassing it when reclaim is desparate. Prefer oom kills before reclaim memory below memory.min. Sharing more code with memory_cgroup_low() is possible, but the idea is posted here for simplicity. Signed-off-by: Greg Thelen <g

Re: [RFC PATCH 0/2] memory.low,min reclaim

2018-04-23 Thread Greg Thelen
On Mon, Apr 23, 2018 at 3:38 AM Roman Gushchin <g...@fb.com> wrote: > Hi, Greg! > On Sun, Apr 22, 2018 at 01:26:10PM -0700, Greg Thelen wrote: > > Roman's previously posted memory.low,min patches add per memcg effective > > low limit to detect overcommitment of parental

Re: [RFC] Is it correctly that the usage for spin_{lock|unlock}_irq in clear_page_dirty_for_io

2018-04-03 Thread Greg Thelen
On Tue, Apr 3, 2018 at 5:03 AM Michal Hocko wrote: > On Mon 02-04-18 19:50:50, Wang Long wrote: > > > > Hi, Johannes Weiner and Tejun Heo > > > > I use linux-4.4.y to test the new cgroup controller io and the current > > stable kernel linux-4.4.y has the follow logic > > > >

[PATCH] RDMA/ucma: reject AF_IB ip multicast requests

2018-03-29 Thread Greg Thelen
. RDMA_USER_CM_CMD_JOIN_MCAST is interface for AF_IB multicast. And add a buffer length safety check. Fixes: 5bc2b7b397b0 ("RDMA/ucma: Allow user space to specify AF_IB when joining multicast") Signed-off-by: Greg Thelen <gthe...@google.com> --- drivers/infiniband/core/ucma.c | 10 +- 1

Re: [PATCH] RDMA/ucma: reject AF_IB ip multicast requests

2018-03-30 Thread Greg Thelen
On Thu, Mar 29, 2018 at 9:24 PM, Greg Thelen <gthe...@google.com> wrote: > syzbot discovered that ucma_join_ip_multicast() mishandles AF_IB request > addresses. If an RDMA_USER_CM_CMD_JOIN_IP_MCAST request has > cmd.addr.sa_family=AF_IB then ucma_join_ip_multicast() reads beyond t

[PATCH 5/5] IB: make INFINIBAND_ADDR_TRANS configurable

2018-04-25 Thread Greg Thelen
Allow INFINIBAND without INFINIBAND_ADDR_TRANS because fuzzing has been finding fair number of CM bugs. So provide option to disable it. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drivers/infiniband/Kconfig | 5 - 1 file changed,

[PATCH 1/5] nvme: depend on INFINIBAND_ADDR_TRANS

2018-04-25 Thread Greg Thelen
NVME_RDMA code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- drive

[PATCH 2/5] nvmet-rdma: depend on INFINIBAND_ADDR_TRANS

2018-04-25 Thread Greg Thelen
NVME_TARGET_RDMA code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> ---

[PATCH 3/5] ib_srpt: depend on INFINIBAND_ADDR_TRANS

2018-04-25 Thread Greg Thelen
INFINIBAND_SRPT code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com>

[PATCH 4/5] cifs: smbd: depend on INFINIBAND_ADDR_TRANS

2018-04-25 Thread Greg Thelen
CIFS_SMB_DIRECT code depends on INFINIBAND_ADDR_TRANS provided symbols. So declare the kconfig dependency. This is necessary to allow for enabling INFINIBAND without INFINIBAND_ADDR_TRANS. Signed-off-by: Greg Thelen <gthe...@google.com> Cc: Tarick Bedeir <tar...@google.com> --- fs/

Re: [PATCH] memcg, oom: move out_of_memory back to the charge path

2018-06-28 Thread Greg Thelen
now > - s@mem_cgroup_oom_enable@mem_cgroup_enter_user_fault@g > s@mem_cgroup_oom_disable@mem_cgroup_exit_user_fault@g as per Johannes > - make oom_kill_disable an exceptional case because it should be rare > and the normal oom handling a core of the function - per Johannes >

Re: [PATCH] vfs: dcache: cond_resched in shrink_dentry_list

2013-04-09 Thread Greg Thelen
On Mon, Mar 25 2013, Greg Thelen wrote: > On Mon, Mar 25 2013, Dave Chinner wrote: > >> On Mon, Mar 25, 2013 at 05:39:13PM -0700, Greg Thelen wrote: >>> On Mon, Mar 25 2013, Dave Chinner wrote: >>> > On Mon, Mar 25, 2013 at 10:22:31AM -0700, Greg Thelen wrote

[PATCH] memcg: fix multiple large threshold notifications

2013-08-31 Thread Greg Thelen
ntroduction of memcg threshold notifications in v2.6.34-rc1-116-g2e72b6347c94 "memcg: implement memory thresholds" Signed-off-by: Greg Thelen --- mm/memcontrol.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 08

Re: [PATCH v2 1/3] percpu: add test module for various percpu operations

2013-11-07 Thread Greg Thelen
On Mon, Nov 04 2013, Andrew Morton wrote: > On Sun, 27 Oct 2013 10:30:15 -0700 Greg Thelen wrote: > >> Tests various percpu operations. > > Could you please take a look at the 32-bit build (this is i386): > > lib/percpu_test.c: In function 'percpu_test_init': > li

[PATCH] ipc,shm: fix shm_file deletion races

2013-11-18 Thread Greg Thelen
82a51 ("ipc,shm: shorten critical region for shmctl") Signed-off-by: Greg Thelen Cc: # 3.10.17+ 3.11.6+ --- ipc/shm.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/ipc/shm.c b/ipc/shm.c index d69739610fd4..0bdf21c6814e 100644

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-05 Thread Greg Thelen
On Tue, Feb 05 2013, Michal Hocko wrote: > On Tue 05-02-13 15:49:47, azurIt wrote: > [...] >> Just to be sure - am i supposed to apply this two patches? >> http://watchdog.sk/lkml/patches/ > > 5-memcg-fix-1.patch is not complete. It doesn't contain the folloup I > mentioned in a follow up email.

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-05 Thread Greg Thelen
On Tue, Feb 05 2013, Michal Hocko wrote: > On Tue 05-02-13 08:48:23, Greg Thelen wrote: >> On Tue, Feb 05 2013, Michal Hocko wrote: >> >> > On Tue 05-02-13 15:49:47, azurIt wrote: >> > [...] >> >> Just to be sure - am i supposed to apply this two p

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-07 Thread Greg Thelen
On Tue, Feb 05 2013, Michal Hocko wrote: > On Tue 05-02-13 10:09:57, Greg Thelen wrote: >> On Tue, Feb 05 2013, Michal Hocko wrote: >> >> > On Tue 05-02-13 08:48:23, Greg Thelen wrote: >> >> On Tue, Feb 05 2013, Michal Hocko wrote: >> >>

Re: [PATCHv10 1/4] debugfs: add get/set for atomic types

2013-05-09 Thread Greg Thelen
On Wed, May 08 2013, Seth Jennings wrote: > debugfs currently lack the ability to create attributes > that set/get atomic_t values. > > This patch adds support for this through a new > debugfs_create_atomic_t() function. > > Signed-off-by: Seth Jennings > Acked-by: Greg Kroah-Hartman >

Re: [PATCH] memcg: implement low limits

2013-02-27 Thread Greg Thelen
On Wed, Feb 27 2013, Roman Gushchin wrote: > Hi, all! > > I've implemented low limits for memory cgroups. The primary goal was to add > an ability > to protect some memory from reclaiming without using mlock(). A kind of "soft > mlock()". > > I think this patch will be helpful when it's

Re: [PATCH] vfs: dcache: cond_resched in shrink_dentry_list

2013-04-10 Thread Greg Thelen
On Wed, Apr 10 2013, Andrew Morton wrote: > On Tue, 09 Apr 2013 17:37:20 -0700 Greg Thelen wrote: > >> > Call cond_resched() in shrink_dcache_parent() to maintain >> > interactivity. >> > >> > Before this patch: >> > >> > void shrin

[PATCH] vfs: dcache: cond_resched in shrink_dentry_list

2013-03-25 Thread Greg Thelen
system("rm -rf x"); if (gettimeofday(, NULL)) err(1, "gettimeofday"); diff = (((double)t2.tv_sec * 100 + t2.tv_usec) - ((double)t1.tv_sec * 100 + t1.tv_usec)); printf(

Re: [PATCH] vfs: dcache: cond_resched in shrink_dentry_list

2013-03-25 Thread Greg Thelen
On Mon, Mar 25 2013, Dave Chinner wrote: > On Mon, Mar 25, 2013 at 10:22:31AM -0700, Greg Thelen wrote: >> Call cond_resched() from shrink_dentry_list() to preserve >> shrink_dcache_parent() interactivity. >> >> void shrink_dcache_parent(struct dentry * parent)

Re: [PATCH] vfs: dcache: cond_resched in shrink_dentry_list

2013-03-25 Thread Greg Thelen
On Mon, Mar 25 2013, Dave Chinner wrote: > On Mon, Mar 25, 2013 at 05:39:13PM -0700, Greg Thelen wrote: >> On Mon, Mar 25 2013, Dave Chinner wrote: >> > On Mon, Mar 25, 2013 at 10:22:31AM -0700, Greg Thelen wrote: >> >> Call cond_resched() from sh

[PATCH 1/2 v4] memcg: refactor mem_control_numa_stat_show()

2013-09-16 Thread Greg Thelen
11,736,855 b31717 vmlinux.after Signed-off-by: Greg Thelen Signed-off-by: Ying Han --- Changelog since v3: - Use ARRAY_SIZE(stats) rather than array terminator. - rebased to latest linus/master (d8efd82) to incorporate 182446d08 "cgroup: pass around cgroup_subsys_state instead of cgroup in file me

[PATCH 2/2 v4] memcg: support hierarchical memory.numa_stats

2013-09-16 Thread Greg Thelen
0 N3=0 hierarchical_total=908 N0=552 N1=317 N2=39 N3=0 hierarchical_file=850 N0=549 N1=301 N2=0 N3=0 hierarchical_anon=58 N0=3 N1=16 N2=39 N3=0 hierarchical_unevictable=0 N0=0 N1=0 N2=0 N3=0 Signed-off-by: Ying Han Signed-off-by: Greg Thelen --- Changelog since v3: - push 'iter' local variabl

Re: RIP: mem_cgroup_move_account+0xf4/0x290

2013-10-26 Thread Greg Thelen
a6 00 00 00 48 8b b2 30 02 00 00 45 89 ca <4c> 39 56 18 0f 8c 36 >> 01 00 00 44 89 c9 >> f7 d9 89 cf 65 48 01 7e >> [ 7691.528638] RIP [] mem_cgroup_move_account+0xf4/0x290 >> >> Add the required __this_cpu_read(). > > Sorry for my mistake and thanks for the fix up,

[PATCH 2/3] percpu counter: cast this_cpu_sub() adjustment

2013-10-27 Thread Greg Thelen
); Signed-off-by: Greg Thelen --- arch/x86/include/asm/percpu.h | 3 ++- include/linux/percpu.h| 8 lib/percpu_test.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 0da5200

[PATCH 1/3] percpu counter: test module

2013-10-27 Thread Greg Thelen
Tests various percpu operations. Enable with CONFIG_PERCPU_TEST=m. Signed-off-by: Greg Thelen --- lib/Kconfig.debug | 9 lib/Makefile | 2 + lib/percpu_test.c | 138 ++ 3 files changed, 149 insertions(+) create mode 100644 lib

<    1   2   3   4   >