Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Shakeel Butt
g Please follow Michal's suggestion to update the commit message. After that: Reviewed-by: Shakeel Butt > --- > kernel/fork.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/kernel/fork.c b/kernel/fork.c > index d66cd1014211..6e2201fe

Re: [External] Re: [PATCH] mm: memcontrol: fix kernel stack account

2021-03-02 Thread Shakeel Butt
On Tue, Mar 2, 2021 at 1:34 AM Michal Hocko wrote: > [snip] > > Yeah, imprecision may > > not be a problem. But if this is what we did deliberately, I think that > > it is better to add a comment there. Thanks. > > Yes the comment is quite confusing. I suspect it meant to say > /* All

Re: possible deadlock in sk_clone_lock

2021-03-02 Thread Shakeel Butt
On Tue, Mar 2, 2021 at 1:44 AM Michal Hocko wrote: > > On Mon 01-03-21 17:16:29, Mike Kravetz wrote: > > On 3/1/21 9:23 AM, Michal Hocko wrote: > > > On Mon 01-03-21 08:39:22, Shakeel Butt wrote: > > >> On Mon, Mar 1, 2021 at 7:57 AM Michal Hocko wrote: > >

[PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-03 Thread Shakeel Butt
and mem_cgroup_finish_swapin_page() completes the charging process. So, the kernel starts the charging process of the page for swapin with mem_cgroup_charge_swapin_page(), adds the page to the swapcache and on success completes the charging process with mem_cgroup_finish_swapin_page(). Signed-off-by: Shakeel

Re: possible deadlock in sk_clone_lock

2021-03-03 Thread Shakeel Butt
On Tue, Mar 2, 2021 at 1:19 PM Mike Kravetz wrote: > > On 3/2/21 6:29 AM, Michal Hocko wrote: > > On Tue 02-03-21 06:11:51, Shakeel Butt wrote: > >> On Tue, Mar 2, 2021 at 1:44 AM Michal Hocko wrote: > >>> > >>> On Mon 01-03-21 17:16:29, Mike Kravetz

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-04 Thread Shakeel Butt
On Thu, Mar 4, 2021 at 7:48 AM Johannes Weiner wrote: > > On Wed, Mar 03, 2021 at 05:42:29PM -0800, Shakeel Butt wrote: > > Currently the kernel adds the page, allocated for swapin, to the > > swapcache before charging the page. This is fine but now we want a > > per-me

Re: [v8 PATCH 06/13] mm: memcontrol: rename shrinker_map to shrinker_info

2021-03-07 Thread Shakeel Butt
h adding nr_deferred cleaner and readable and > make > review easier. Also remove the "memcg_" prefix. > > Acked-by: Vlastimil Babka > Acked-by: Kirill Tkhai > Acked-by: Roman Gushchin > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 03/13] mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation

2021-03-07 Thread Shakeel Butt
Kirill Tkhai > Acked-by: Roman Gushchin > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 05/13] mm: vmscan: use kvfree_rcu instead of call_rcu

2021-03-07 Thread Shakeel Butt
On Tue, Feb 16, 2021 at 4:13 PM Yang Shi wrote: > > Using kvfree_rcu() to free the old shrinker_maps instead of call_rcu(). > We don't have to define a dedicated callback for call_rcu() anymore. > > Signed-off-by: Yang Shi > --- > mm/vmscan.c | 7 +-- > 1 file changed, 1 insertion(+), 6

Re: [v8 PATCH 07/13] mm: vmscan: add shrinker_info_protected() helper

2021-03-07 Thread Shakeel Butt
o[nid]->shrinker_info. And the later patch > will add more dereference places. > > So extract the dereference into a helper to make the code more readable. No > functional change. > > Acked-by: Roman Gushchin > Acked-by: Kirill Tkhai > Acked-by: Vlastimil Babka > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 04/13] mm: vmscan: remove memcg_shrinker_map_size

2021-03-07 Thread Shakeel Butt
r_max is also used by > iterating the > bit map. > > Acked-by: Kirill Tkhai > Acked-by: Roman Gushchin > Acked-by: Vlastimil Babka > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 08/13] mm: vmscan: use a new flag to indicate shrinker is registered

2021-03-08 Thread Shakeel Butt
ed-by: Vlastimil Babka > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 10/13] mm: vmscan: use per memcg nr_deferred of shrinker

2021-03-08 Thread Shakeel Butt
ameter > > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 09/13] mm: vmscan: add per memcg shrinker nr_deferred

2021-03-08 Thread Shakeel Butt
On Mon, Mar 8, 2021 at 12:30 PM Yang Shi wrote: > > On Mon, Mar 8, 2021 at 11:12 AM Shakeel Butt wrote: > > > > On Tue, Feb 16, 2021 at 4:13 PM Yang Shi wrote: > > > > > > Currently the number of deferred objects are per shrinker, but some > > > sla

Re: [v8 PATCH 05/13] mm: vmscan: use kvfree_rcu instead of call_rcu

2021-03-08 Thread Shakeel Butt
On Mon, Mar 8, 2021 at 12:22 PM Yang Shi wrote: > > On Mon, Mar 8, 2021 at 8:49 AM Roman Gushchin wrote: > > > > On Sun, Mar 07, 2021 at 10:13:04PM -0800, Shakeel Butt wrote: > > > On Tue, Feb 16, 2021 at 4:13 PM Yang Shi wrote: > > > > > > > &g

Re: [v8 PATCH 09/13] mm: vmscan: add per memcg shrinker nr_deferred

2021-03-08 Thread Shakeel Butt
On Tue, Feb 16, 2021 at 4:13 PM Yang Shi wrote: > > Currently the number of deferred objects are per shrinker, but some slabs, > for example, > vfs inode/dentry cache are per memcg, this would result in poor isolation > among memcgs. > > The deferred objects typically are generated by

Re: [v8 PATCH 11/13] mm: vmscan: don't need allocate shrinker->nr_deferred for memcg aware shrinkers

2021-03-08 Thread Shakeel Butt
CONFIG_MEMCG or memcg > is disabled > by kernel command line, then shrinker's SHRINKER_MEMCG_AWARE flag would be > cleared. > This makes the implementation of this patch simpler. > > Acked-by: Vlastimil Babka > Reviewed-by: Kirill Tkhai > Acked-by: Roman Gushchin > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: [v8 PATCH 12/13] mm: memcontrol: reparent nr_deferred when memcg offline

2021-03-08 Thread Shakeel Butt
gt; Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: possible deadlock in sk_clone_lock

2021-03-01 Thread Shakeel Butt
On Mon, Mar 1, 2021 at 4:12 AM Michal Hocko wrote: > > On Fri 26-02-21 16:00:30, Shakeel Butt wrote: > > On Fri, Feb 26, 2021 at 3:14 PM Mike Kravetz > > wrote: > > > > > > Cc: Michal > > > > > > On 2/26/21 2:44 PM, Shakeel Butt

Re: possible deadlock in sk_clone_lock

2021-03-01 Thread Shakeel Butt
On Mon, Mar 1, 2021 at 7:57 AM Michal Hocko wrote: > > On Mon 01-03-21 07:10:11, Shakeel Butt wrote: > > On Mon, Mar 1, 2021 at 4:12 AM Michal Hocko wrote: > > > > > > On Fri 26-02-21 16:00:30, Shakeel Butt wrote: > > > > On Fri, Feb 26, 20

Re: [PATCH] mm: memcontrol: fix slub memory accounting

2021-02-23 Thread Shakeel Butt
which is from memory.stat. Fix it by using mod_lruvec_page_state instead > of mod_node_page_state. > > Fixes: 6a486c0ad4dc ("mm, sl[ou]b: improve memory accounting") > Signed-off-by: Muchun Song Reviewed-by: Shakeel Butt

Re: [PATCH v2] memcg: charge before adding to swapcache on swapin

2021-02-23 Thread Shakeel Butt
On Mon, Feb 22, 2021 at 9:55 PM Shakeel Butt wrote: [snip] > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -596,6 +596,9 @@ static inline bool mem_cgroup_below_min(struct mem_cgroup > *memcg) > } > > int mem_cgroup_charge(struct page *page,

[PATCH v2] memcg: charge before adding to swapcache on swapin

2021-02-22 Thread Shakeel Butt
and mem_cgroup_finish_swapin_page() completes the charging process. So, the kernel starts the charging process of the page for swapin with mem_cgroup_charge_swapin_page(), adds the page to the swapcache and on success completes the charging process with mem_cgroup_finish_swapin_page(). Signed-off-by: Shakeel

Re: [PATCH] mm: memcontrol: fix get_active_memcg return value

2021-02-23 Thread Shakeel Butt
t in the interrupt context) is ignored. This is not what we want. > So fix it. > > Fixes: 37d5985c003d ("mm: kmem: prepare remote memcg charging infra for > interrupt contexts") > Signed-off-by: Muchun Song Good catch. Cc: sta...@vger.kernel.org Reviewed-by: S

[PATCH] memcg: enable memcg oom-kill for __GFP_NOFAIL

2021-02-23 Thread Shakeel Butt
he limit")), we can again allow __GFP_NOFAIL allocations to trigger memcg oom-kill. This will make memcg oom behavior closer to page allocator oom behavior. Signed-off-by: Shakeel Butt --- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/m

[PATCH] memcg: cleanup root memcg checks

2021-02-23 Thread Shakeel Butt
Replace the implicit checking of root memcg with explicit root memcg checking i.e. !css->parent with mem_cgroup_is_root(). Signed-off-by: Shakeel Butt --- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index dcb5665ae

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 8:25 AM Johannes Weiner wrote: > [...] > I'd also rename cgroup_memory_noswap to cgroup_swapaccount - to match > the commandline and (hopefully) make a bit clearer what it effects. Do we really need to keep supporting "swapaccount=0"? Is swap page_counter really a

Re: [PATCH v3 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 9:37 AM David Hildenbrand wrote: > > On 04.03.21 01:03, Shakeel Butt wrote: > > On Wed, Mar 3, 2021 at 3:34 PM Suren Baghdasaryan wrote: > >> > >> On Wed, Mar 3, 2021 at 3:17 PM Shakeel Butt wrote: > >>> > >>&

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 8:25 AM Johannes Weiner wrote: > > On Fri, Mar 05, 2021 at 12:06:31AM -0800, Hugh Dickins wrote: > > On Wed, 3 Mar 2021, Shakeel Butt wrote: > > > > > Currently the kernel adds the page, allocated for swapin, to the > > > swapcache be

[PATCH v4] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
and mem_cgroup_finish_swapin_page() completes the charging process. So, the kernel starts the charging process of the page for swapin with mem_cgroup_charge_swapin_page(), adds the page to the swapcache and on success completes the charging process with mem_cgroup_finish_swapin_page(). Signed-off-by: Shakeel

Re: [PATCH v4] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Shakeel Butt
On Fri, Mar 5, 2021 at 1:26 PM Shakeel Butt wrote: > > Currently the kernel adds the page, allocated for swapin, to the > swapcache before charging the page. This is fine but now we want a > per-memcg swapcache stat which is essential for folks who wants to > transparently migrate

Re: [PATCH v2 1/2] mm/memcg: rename mem_cgroup_split_huge_fixup to split_page_memcg

2021-03-04 Thread Shakeel Butt
nfo(memcg and flag) of > the memcg needs to be set to the tail pages. > > Signed-off-by: Zhou Guanghui Reviewed-by: Shakeel Butt

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-04 Thread Shakeel Butt
rged. > > Therefore, the memcg of the tail page needs to be set when split page. > > Signed-off-by: Zhou Guanghui Reviewed-by: Shakeel Butt

Re: [PATCH] doc: memcontrol: add description for oom_kill

2021-02-26 Thread Shakeel Butt
> > The cgroup v2 documents it, but the description is missed for cgroup v1. > > Signed-off-by: Yang Shi Reviewed-by: Shakeel Butt

Re: High kmalloc-32 slab cache consumption with 10k containers

2021-04-07 Thread Shakeel Butt
On Wed, Apr 7, 2021 at 4:55 AM Michal Hocko wrote: > > On Mon 05-04-21 11:18:48, Bharata B Rao wrote: > > Hi, > > > > When running 1 (more-or-less-empty-)containers on a bare-metal Power9 > > server(160 CPUs, 2 NUMA nodes, 256G memory), it is seen that memory > > consumption increases quite a

Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory

2021-04-08 Thread Shakeel Butt
Hi Tim, On Mon, Apr 5, 2021 at 11:08 AM Tim Chen wrote: > > Traditionally, all memory is DRAM. Some DRAM might be closer/faster than > others NUMA wise, but a byte of media has about the same cost whether it > is close or far. But, with new memory tiers such as Persistent Memory > (PMEM).

Re: [PATCH] mm: page_counter: mitigate consequences of a page_counter underflow

2021-04-08 Thread Shakeel Butt
imping along. > > [ We used to do this with the original res_counter, where it was a > more straight-forward correction inside the spinlock section. I > didn't carry it forward into the lockless page counters for > simplicity, but it turns out this is quite useful in practice. ] > > Signed-off-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [RFC bpf-next 0/1] bpf: Add page cache iterator

2021-04-08 Thread Shakeel Butt
On Wed, Apr 7, 2021 at 2:47 PM Daniel Xu wrote: > > There currently does not exist a way to answer the question: "What is in > the page cache?". There are various heuristics and counters but nothing > that can tell you anything like: > > * 3M from /home/dxu/foo.txt > * 5K from ... > * etc.

Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory

2021-04-08 Thread Shakeel Butt
On Thu, Apr 8, 2021 at 11:01 AM Yang Shi wrote: > > On Thu, Apr 8, 2021 at 10:19 AM Shakeel Butt wrote: > > > > Hi Tim, > > > > On Mon, Apr 5, 2021 at 11:08 AM Tim Chen wrote: > > > > > > Traditionally, all memory is DRAM. Some DRAM mi

Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory

2021-04-12 Thread Shakeel Butt
On Thu, Apr 8, 2021 at 4:52 AM Michal Hocko wrote: > [...] > > What I am trying to say (and I have brought that up when demotion has been > discussed at LSFMM) is that the implementation shouldn't be PMEM aware. > The specific technology shouldn't be imprinted into the interface. > Fundamentally

Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory

2021-04-12 Thread Shakeel Butt
On Thu, Apr 8, 2021 at 1:50 PM Yang Shi wrote: > [...] > > > > The low and min limits have semantics similar to the v1's soft limit > > for this situation i.e. letting the low priority job occupy top tier > > memory and depending on reclaim to take back the excess top tier > > memory use of such

Re: [PATCH 2/5] mm/memcg: Introduce obj_cgroup_uncharge_mod_state()

2021-04-12 Thread Shakeel Butt
ent. Introduce a new function obj_cgroup_uncharge_mod_state() > that combines them with a single irq_save/irq_restore cycle. > > Signed-off-by: Waiman Long Reviewed-by: Shakeel Butt

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-10 Thread Shakeel Butt
On Sat, Apr 10, 2021 at 9:16 AM Ilias Apalodimas wrote: > > Hi Matthew > > On Sat, Apr 10, 2021 at 04:48:24PM +0100, Matthew Wilcox wrote: > > On Sat, Apr 10, 2021 at 12:37:58AM +0200, Matteo Croce wrote: > > > This is needed by the page_pool to avoid recycling a page not allocated > > > via

Re: [RFC PATCH v2 02/18] mm: memcontrol: bail out early when !mm in get_mem_cgroup_from_mm

2021-04-10 Thread Shakeel Butt
d-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [External] Re: [RFC PATCH v2 09/18] mm: vmscan: remove noinline_for_stack

2021-04-10 Thread Shakeel Butt
r > > > > Since this patch is somewhat independent of the rest of the series, > > you may want to put it in the very beginning, or even submit it > > separately, to keep the main series as compact as possible. Reviewers > > can be more hesitant to get involved with larger series ;) > > OK. I will gather all the cleanup patches into a separate series. > Thanks for your suggestion. That would be best. For this patch: Reviewed-by: Shakeel Butt

Re: [RFC PATCH v2 01/18] mm: memcontrol: fix page charging in page replacement

2021-04-10 Thread Shakeel Butt
a WARN_ON_ONCE in the page_counter_cancel(). Who knows if it > will trigger? So it is better to fix it. > > Signed-off-by: Muchun Song > Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [PATCH 1/5] mm/memcg: Pass both memcg and lruvec to mod_memcg_lruvec_state()

2021-04-12 Thread Shakeel Butt
to allow either of the two parameters to be set to null. This > makes mod_memcg_lruvec_state() equivalent to mod_memcg_state() if lruvec > is null. > > Signed-off-by: Waiman Long Similar to Roman's suggestion: instead of what this patch is doing the 'why' would be better in the changelog. Reviewed-by: Shakeel Butt

Re: [RFC PATCH v1 00/11] Manage the top tier memory in a tiered memory

2021-04-12 Thread Shakeel Butt
On Fri, Apr 9, 2021 at 4:26 PM Tim Chen wrote: > > > On 4/8/21 4:52 AM, Michal Hocko wrote: > > >> The top tier memory used is reported in > >> > >> memory.toptier_usage_in_bytes > >> > >> The amount of top tier memory usable by each cgroup without > >> triggering page reclaim is controlled by

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-19 Thread Shakeel Butt
On Sun, Apr 18, 2021 at 10:12 PM Ilias Apalodimas wrote: > > On Wed, Apr 14, 2021 at 01:09:47PM -0700, Shakeel Butt wrote: > > On Wed, Apr 14, 2021 at 12:42 PM Jesper Dangaard Brouer > > wrote: > > > > > [...] > > > > > > > > &

Re: [External] [PATCH v4 5/5] mm/memcg: Improve refill_obj_stock() performance

2021-04-19 Thread Shakeel Butt
On Sun, Apr 18, 2021 at 11:07 PM Muchun Song wrote: > > On Mon, Apr 19, 2021 at 8:01 AM Waiman Long wrote: > > > > There are two issues with the current refill_obj_stock() code. First of > > all, when nr_bytes reaches over PAGE_SIZE, it calls drain_obj_stock() to > > atomically flush out

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-19 Thread Shakeel Butt
On Mon, Apr 19, 2021 at 8:43 AM Ilias Apalodimas wrote: > [...] > > Pages mapped into the userspace have their refcnt elevated, so the > > page_ref_count() check by the drivers indicates to not reuse such > > pages. > > > > When tcp_zerocopy_receive() is invoked it will call >

Re: [PATCH v4 1/5] mm/memcg: Move mod_objcg_state() to memcontrol.c

2021-04-19 Thread Shakeel Butt
ff-by: Waiman Long Reviewed-by: Shakeel Butt

[RFC] memory reserve for userspace oom-killer

2021-04-19 Thread Shakeel Butt
Proposal: Provide memory guarantees to userspace oom-killer. Background: Issues with kernel oom-killer: 1. Very conservative and prefer to reclaim. Applications can suffer for a long time. 2. Borrows the context of the allocator which can be resource limited (low sched priority or limited CPU

Re: [PATCH 6/7] mm: memcontrol: move obj_cgroup_uncharge_pages() out of css_set_lock

2021-04-13 Thread Shakeel Butt
On Mon, Apr 12, 2021 at 11:58 PM Muchun Song wrote: > > The css_set_lock is used to guard the list of inherited objcgs. So there > is no need to uncharge kernel memory under css_set_lock. Just move it > out of the lock. > > Signed-off-by: Muchun Song Reviewed-by: Shakeel Butt

Re: [PATCH 5/7] mm: memcontrol: simplify the logic of objcg pinning memcg

2021-04-13 Thread Shakeel Butt
is also > impossible for the two to run in parallel. So xchg() is unnecessary > and it is enough to use WRITE_ONCE(). > > Signed-off-by: Muchun Song > Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [page-reclaim] Re: [PATCH v2 00/16] Multigenerational LRU Framework

2021-04-14 Thread Shakeel Butt
On Wed, Apr 14, 2021 at 6:52 AM Rik van Riel wrote: > > On Wed, 2021-04-14 at 16:27 +0800, Huang, Ying wrote: > > Yu Zhao writes: > > > > > On Wed, Apr 14, 2021 at 12:15 AM Huang, Ying > > > wrote: > > > > > > > NUMA Optimization > > > - > > > Support NUMA policies and per-node

Re: [PATCH 3/7] mm: memcontrol: remove the pgdata parameter of mem_cgroup_page_lruvec

2021-04-13 Thread Shakeel Butt
local variable of @pgdat. So mem_cgroup_page_lruvec() do not > need the pgdat parameter. Just remove it to simplify the code. > > Signed-off-by: Muchun Song > Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [PATCH 4/7] mm: memcontrol: simplify lruvec_holds_page_lru_lock

2021-04-13 Thread Shakeel Butt
roup_disabled() and > CONFIG_MEMCG. > > Signed-off-by: Muchun Song > Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-14 Thread Shakeel Butt
On Wed, Apr 14, 2021 at 12:42 PM Jesper Dangaard Brouer wrote: > [...] > > > > > > Can this page_pool be used for TCP RX zerocopy? If yes then PageType > > > can not be used. > > > > Yes it can, since it's going to be used as your default allocator for > > payloads, which might end up on an SKB.

Re: [RFC] memory reserve for userspace oom-killer

2021-04-20 Thread Shakeel Butt
On Mon, Apr 19, 2021 at 11:46 PM Michal Hocko wrote: > > On Mon 19-04-21 18:44:02, Shakeel Butt wrote: [...] > > memory.min. However a new allocation from userspace oom-killer can > > still get stuck in the reclaim and policy rich oom-killer do trigger > > new allocations

Re: [PATCH v2 5/8] mm: memcontrol: rename lruvec_holds_page_lru_lock to page_matches_lruvec

2021-04-16 Thread Shakeel Butt
On Thu, Apr 15, 2021 at 10:16 PM Muchun Song wrote: > > lruvec_holds_page_lru_lock() doesn't check anything about locking and is > used to check whether the page belongs to the lruvec. So rename it to > page_matches_lruvec(). > > Signed-off-by: Muchun Song Reviewed-by: Shakeel Butt

Re: [PATCH v2 3/5] mm/memcg: Cache vmstat data in percpu memcg_stock_pcp

2021-04-12 Thread Shakeel Butt
ime when __mod_obj_stock_state() is called leads to an actual call to > mod_objcg_state() after initial boot. When doing parallel kernel build, > the figure was about 16% (21894614 out of 139780628). So caching the > vmstat data reduces the number of calls to mod_objcg_state() by more > than 80%. > > Signed-off-by: Waiman Long Reviewed-by: Shakeel Butt

Re: [PATCH v2 4/5] mm/memcg: Separate out object stock data into its own struct

2021-04-12 Thread Shakeel Butt
> Acked-by: Roman Gushchin Reviewed-by: Shakeel Butt

Re: [PATCH v2 5/5] mm/memcg: Optimize user context object stock access

2021-04-12 Thread Shakeel Butt
On Mon, Apr 12, 2021 at 3:55 PM Waiman Long wrote: > > Most kmem_cache_alloc() calls are from user context. With instrumentation > enabled, the measured amount of kmem_cache_alloc() calls from non-task > context was about 0.01% of the total. > > The irq disable/enable sequence used in this case

Re: [PATCH v2 5/5] mm/memcg: Optimize user context object stock access

2021-04-12 Thread Shakeel Butt
On Mon, Apr 12, 2021 at 4:10 PM Shakeel Butt wrote: > > On Mon, Apr 12, 2021 at 3:55 PM Waiman Long wrote: > > > > Most kmem_cache_alloc() calls are from user context. With instrumentation > > enabled, the measured amount of kmem_cache_alloc() calls from non-task &g

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-12 Thread Shakeel Butt
CCing more folks. On Fri, Feb 12, 2021 at 9:14 AM Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > If a swap cache page is charged successful, and then we uncharge > the swap counter. It is wrong on cgroup v2. Because the swap > entry is not freed. > >

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Shakeel Butt
consumed swap when shared > pages are partially swapped back in. This in turn allows a cgroup to > consume more swap than its configured limit intends. > > Add the do_memsw_account() check back to fix this problem. > --- > > > Fixes: 2d1c498072de ("mm: memcontrol: make

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Shakeel Butt
On Fri, Feb 12, 2021 at 10:48 PM Muchun Song wrote: > > On Sat, Feb 13, 2021 at 2:57 AM Shakeel Butt wrote: > > > > CCing more folks. > > > > On Fri, Feb 12, 2021 at 9:14 AM Muchun Song > > wrote: > > > > > > The swap charges the actua

Re: [RFC PATCH] mm, oom: introduce vm.sacrifice_hugepage_on_oom

2021-02-17 Thread Shakeel Butt
On Tue, Feb 16, 2021 at 5:25 PM David Rientjes wrote: > > On Tue, 16 Feb 2021, Michal Hocko wrote: > > > > Hugepages can be preallocated to avoid unpredictable allocation latency. > > > If we run into 4k page shortage, the kernel can trigger OOM even though > > > there were free hugepages. When

Re: [PATCH v2] mm: memcontrol: fix swap undercounting in cgroup2

2021-02-17 Thread Shakeel Butt
ed by physical capacity. This in turn allows cgroups to > significantly overconsume their alloted swap space. > > Add the do_memsw_account() check back to fix this problem. > > Fixes: 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of > memory control"

Re: [External] Re: [PATCH] mm: memcontrol: remove rcu_read_lock from get_mem_cgroup_from_page

2021-02-05 Thread Shakeel Butt
+Cc Roman On Fri, Feb 5, 2021 at 2:49 AM Michal Hocko wrote: > [snip] > > > > Also, css_get is enough because page > > > > has a reference to the memcg. > > > > > > tryget used to be there to guard against offlined memcg but we have > > > concluded this is impossible in this path. tryget stayed

Re: [External] Re: [PATCH] mm: memcontrol: remove rcu_read_lock from get_mem_cgroup_from_page

2021-02-05 Thread Shakeel Butt
On Fri, Feb 5, 2021 at 10:31 AM Johannes Weiner wrote: > > On Fri, Feb 05, 2021 at 11:32:24AM +0100, Michal Hocko wrote: > > On Fri 05-02-21 17:14:30, Muchun Song wrote: > > > On Fri, Feb 5, 2021 at 4:36 PM Michal Hocko wrote: > > > > > > > > On Fri 05-02-21 14:27:19, Muchun Song wrote: > > > >

Re: [PATCH 4/8] cgroup: rstat: support cgroup1

2021-02-05 Thread Shakeel Butt
unmount, the css moves back to the default hierarchy. Annotate > rebind_subsystems() to move the root css linkage along between roots. > > Signed-off-by: Johannes Weiner > Reviewed-by: Roman Gushchin Reviewed-by: Shakeel Butt

Re: [PATCH v2] mm: memcontrol: replace the loop with a list_for_each_entry()

2021-02-05 Thread Shakeel Butt
t_for_each_entry(). > > There is only one caller of the uncharge_list(). So just fold it into > mem_cgroup_uncharge_list() and remove it. > > Signed-off-by: Muchun Song Reviewed-by: Shakeel Butt

[PATCH] mm/list_lru.c: remove kvfree_rcu_local()

2021-02-07 Thread Shakeel Butt
global one. Signed-off-by: Shakeel Butt --- mm/list_lru.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index fe230081690b..6f067b6b935f 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -373,21 +373,13 @@ static void memcg_destroy_lis

[PATCH] memcg: charge before adding to swapcache on swapin

2021-02-19 Thread Shakeel Butt
accounting code and then we would need to add additional parameter to tell to not touch NR_SWAPCACHE stat as that code patch bypass swapcache. This patch added memcg charging API explicitly foe swapin pages and cleaned up do_swap_page() to not set and reset PageSwapCache bit. Signed-off-by: Shakeel

Re: [PATCH] memcg: charge before adding to swapcache on swapin

2021-02-19 Thread Shakeel Butt
On Fri, Feb 19, 2021 at 2:44 PM Shakeel Butt wrote: [snip] > mode change 100644 => 100755 scripts/cc-version.sh [snip > diff --git a/scripts/cc-version.sh b/scripts/cc-version.sh > old mode 100644 > new mode 100755 Please ignore these unintended mode changes. I will remove th

Re: [PATCH] memcg: charge before adding to swapcache on swapin

2021-02-22 Thread Shakeel Butt
On Fri, Feb 19, 2021 at 4:34 PM Johannes Weiner wrote: > > On Fri, Feb 19, 2021 at 02:44:05PM -0800, Shakeel Butt wrote: > > Currently the kernel adds the page, allocated for swapin, to the > > swapcache before charging the page. This is fine but now we want a > > per-me

Re: [PATCH net-next v3 2/3] net: introduce abstraction for network memory

2023-12-21 Thread Shakeel Butt
On Wed, Dec 20, 2023 at 01:45:01PM -0800, Mina Almasry wrote: > Add the netmem_ref type, an abstraction for network memory. > > To add support for new memory types to the net stack, we must first > abstract the current memory type. Currently parts of the net stack > use struct page directly: > >

Re: [PATCH net-next v3 3/3] net: add netmem_ref to skb_frag_t

2023-12-21 Thread Shakeel Butt
On Wed, Dec 20, 2023 at 01:45:02PM -0800, Mina Almasry wrote: > diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c > index 65d1f6755f98..3180a54b2c68 100644 > --- a/net/kcm/kcmsock.c > +++ b/net/kcm/kcmsock.c > @@ -636,9 +636,15 @@ static int kcm_write_msgs(struct kcm_sock *kcm) >

Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2023-12-21 Thread Shakeel Butt
age. > > Signed-off-by: Mina Almasry Reviewed-by: Shakeel Butt

Re: [PATCH net-next v3 2/3] net: introduce abstraction for network memory

2024-01-10 Thread Shakeel Butt
On Thu, Jan 4, 2024 at 1:44 PM Jakub Kicinski wrote: > [...] > > You seem to be trying hard to make struct netmem a thing. > Perhaps you have a reason I'm not getting? Mina already went with your suggestion and that is fine. To me, struct netmem is more aesthetically aligned with the existing

Re: 回复:general protection fault in refill_obj_stock

2024-04-13 Thread Shakeel Butt
On Tue, Apr 02, 2024 at 09:50:54AM +0800, Ubisectech Sirius wrote: > > On Mon, Apr 01, 2024 at 03:04:46PM +0800, Ubisectech Sirius wrote: > > Hello. > > We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. > > Recently, our team has discovered a issue in Linux kernel 6.7.

[tip: sched/core] psi: Reduce calls to sched_clock() in psi

2021-03-23 Thread tip-bot2 for Shakeel Butt
The following commit has been merged into the sched/core branch of tip: Commit-ID: df77430639c9cf73559bac0f25084518bf9a812d Gitweb: https://git.kernel.org/tip/df77430639c9cf73559bac0f25084518bf9a812d Author:Shakeel Butt AuthorDate:Sun, 21 Mar 2021 13:51:56 -07:00

<    7   8   9   10   11   12