[PATCH V2] sched,psi: fix the 'int' underflow for psi

2021-04-16 Thread Charan Teja Reddy
enting the ->tasks count only when it is non-zero. Signed-off-by: Charan Teja Reddy --- Changes in V1: https://lore.kernel.org/patchwork/patch/1413894/ kernel/sched/psi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c inde

[PATCH] sched,psi: fix the 'int' underflow for psi

2021-04-15 Thread Charan Teja Reddy
enting the ->tasks count only when it is non-zero. Signed-off-by: Charan Teja Reddy --- kernel/sched/psi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 967732c..f925468 100644 --- a/kernel/sched/psi.c +++ b/kernel/sc

[PATCH RFC 0/1] mm: balancing the node zones occupancy

2021-02-18 Thread Charan Teja Reddy
mory pressure events in the system. Charan Teja Reddy (1): mm: proof-of-concept for balancing node zones occupancy include/linux/migrate.h | 8 +- include/linux/mm.h | 3 + include/linux/mmzone.h | 2 + kernel/sysctl.c | 11 ++ mm/compaction.c | 4 +- mm/memory

[PATCH 1/1] mm: proof-of-concept for balancing node zones occupancy

2021-02-18 Thread Charan Teja Reddy
This is a Proof-of-concept code for balancing the node zones occupancy whose imbalance may be caused by the memory hotplug. Signed-off-by: Charan Teja Reddy --- include/linux/migrate.h | 8 +- include/linux/mm.h | 3 + include/linux/mmzone.h | 2 + kernel/sysctl.c | 11

[PATCH V2] mm: compaction: update the COMPACT[STALL|FAIL] events properly

2021-02-12 Thread Charan Teja Reddy
is not even tried. There is a corner case where compaction is skipped but still count COMPACTSTALL event, which is that IRQ came and freed the page and the same is captured in capture_control. Signed-off-by: Charan Teja Reddy --- changes in V1: https://lore.kernel.org/patchwork/patch/1373665

[PATCH] mm: page_alloc: update the COMPACT[STALL|FAIL] events properly

2021-02-01 Thread Charan Teja Reddy
is not even tried. Signed-off-by: Charan Teja Reddy --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 519a60d..531f244 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4152,6 +4152,8 @@ __alloc_pages_direct_compact(gfp_t

[PATCH V3] mm/compaction: correct deferral logic for proactive compaction

2021-01-18 Thread Charan Teja Reddy
k_high, then individual score (not adjusted) of atleast one zone has to be above wmark_high. Thus it avoids the unnecessary trigger and deferrals of the proactive compaction. Fix-suggested-by: Vlastimil Babka Signed-off-by: Charan Teja Reddy --- Changes in V3: Addressed suggestions from Vla

[PATCH V2] mm/compaction: correct deferral logic for proactive compaction

2021-01-18 Thread Charan Teja Reddy
k_high, then individual score (not adjusted) of atleast one zone has to be above wmark_high. Thus it avoids the unnecessary trigger and deferrals of the proactive compaction. Fix-suggested-by: Vlastimil Babka Signed-off-by: Charan Teja Reddy --- Changes in V2: Addressed comments from vlastimil C

[PATCH] mm/compaction: return proper state in should_proactive_compact_node

2021-01-13 Thread Charan Teja Reddy
active compaction on the node zones only when atleast one of the zones fragmentation score is greater than wmark_low. This avoids the unnecessary deferral and retries of the compaction. Signed-off-by: Charan Teja Reddy --- mm/compaction.c | 27 +-- 1 file changed, 25 inse

[PATCH V2] dmabuf: fix use-after-free of dmabuf's file->f_inode

2021-01-05 Thread Charan Teja Reddy
release() to f_op->release(). This ensures that dma_buf's file->f_inode is not accessed after it is released. Cc: # 5.4+ Fixes: 4ab59c3c638c ("dma-buf: Move dma_buf_release() from fops to dentry_ops") Acked-by: Christian König Signed-off-by: Charan Teja Reddy --- V2: Resending with st

[PATCH] dmabuf: fix use-after-free of dmabuf's file->f_inode

2021-01-04 Thread Charan Teja Reddy
release() to f_op->release(). This ensures that dma_buf's file->f_inode is not accessed after it is released. Fixes: 4ab59c3c638c ("dma-buf: Move dma_buf_release() from fops to dentry_ops") Signed-off-by: Charan Teja Reddy --- drivers/dma-buf/dma-buf.c | 21 + 1

[PATCH] mm: cma: improve pr_debug log in cma_release()

2020-11-25 Thread Charan Teja Reddy
printed in cma_release(). We are printing the count value in the trace logs, just extend the same to pr_debug logs too. Signed-off-by: Charan Teja Reddy --- mm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 7f415d7..07c904b 100644 --- a/mm/cma.c

[PATCH] mm: memory_hotplug: put migration failure information under DEBUG_VM

2020-11-23 Thread Charan Teja Reddy
is sufficient to know the causes for failures of migration or isolation, place the page owner information under DEBUG_VM. Signed-off-by: Charan Teja Reddy --- mm/memory_hotplug.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm

[PATCH] iommu: of: skip iommu_device_list traversal in of_iommu_xlate()

2020-09-23 Thread Charan Teja Reddy
In of_iommu_xlate(), check if iommu device is enabled before traversing the iommu_device_list through iommu_ops_from_fwnode(). It is of no use in traversing the iommu_device_list only to return NO_IOMMU because of iommu device node is disabled. Signed-off-by: Charan Teja Reddy --- drivers/iommu

[PATCH] dmabuf: fix NULL pointer dereference in dma_buf_release()

2020-09-18 Thread Charan Teja Reddy
ile drivers/dma-buf/dma-buf.c:473 [inline] dma_buf_export+0x25c/0x3ec drivers/dma-buf/dma-buf.c:585 Fix this by checking for the valid pointer in the dentry->d_fsdata. Fixes: 4ab59c3c638c ("dma-buf: Move dma_buf_release() from fops to dentry_ops") Cc: [5.7+] Signed-off-by: C

[PATCH V2] mm, page_alloc: fix core hung in free_pcppages_bulk()

2020-08-11 Thread Charan Teja Reddy
rrow as we update the pcp struct values for the first memory block online itself. [1]: https://patchwork.kernel.org/patch/11696389/ Signed-off-by: Charan Teja Reddy --- v1: https://patchwork.kernel.org/patch/11707637/ mm/page_alloc.c | 5 + 1 file changed, 5 insertions(+) diff --g

[PATCH] mm, page_alloc: fix core hung in free_pcppages_bulk()

2020-08-10 Thread Charan Teja Reddy
rrow as we update the pcp struct values for the first memory block online itself. [1]: https://patchwork.kernel.org/patch/11696389/ Signed-off-by: Charan Teja Reddy --- mm/page_alloc.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc

[PATCH] mm, memory_hotplug: update pcp lists everytime onlining a memory block

2020-08-02 Thread Charan Teja Reddy
memory block in a zone. Correct this by always updating the pcp lists when memory block is onlined. Signed-off-by: Charan Teja Reddy --- mm/memory_hotplug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index dcdf327..7f62d69 100

[PATCH] mm, page_alloc: skip ->waternark_boost for atomic order-0 allocations

2020-05-19 Thread Charan Teja Reddy
ark caluculations for atomic order-0 allocations. Signed-off-by: Charan Teja Reddy --- mm/page_alloc.c | 12 1 file changed, 12 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d001d61..5193d7e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3709,6 +3709,18 @@ static

[PATCH v2] mm, page_alloc: reset the zone->watermark_boost early

2020-05-14 Thread Charan Teja Reddy
ter, when kswapd woke up, it resets the zone->watermark_boost to zero. In step 2), we use the min_wmark_pages() macro to store the watermarks in the zone structure thus the values are always offsetted by ->watermark_boost value. This can be avoided by resetting the ->watermark_boost to zero

[PATCH] mm, page_alloc: reset the zone->watermark_boost early

2020-05-11 Thread Charan Teja Reddy
ned-off-by: Charan Teja Reddy --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1b265b09..822e262 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7746,9 +7746,9 @@ static void __setup_per_zone_wmarks(v

[PATCH v2] dma-buf: fix use-after-free in dmabuffs_dname

2020-05-08 Thread Charan Teja Reddy
en+0xa0/0xd0 path_openat+0x12ee/0x3490 do_filp_open+0x192/0x260 do_sys_openat2+0x5eb/0x7e0 do_sys_open+0xf2/0x180 Fixes: bb2bb9030425 ("dma-buf: add DMA_BUF_SET_NAME ioctls") Reported-by: syzbot+3643a18836bce555b...@syzkaller.appspotmail.com Cc: [5.3+] Signed-off-by: Charan Teja Red