.
Signed-off-by: Kalesh Singh
Reviewed-by: John Hubbard
---
Changes in v2:
- Reduce test time by only validating a certain threshold of the
remapped region (4MB by default). The -t flag can be used to
set a custom threshold in MB or no threshold by passing 0. (-t0).
mremap time
/ PUD in move_page_tables()
with IS_ENABLED(CONFIG_HAVE_MOVE_PMD / PUD), per Kirill.
- Fold Add set_pud_at() patch into patch 4/5, per Kirill.
[1]
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org/thread/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Kalesh Singh (5):
kselftests: vm: Add
ion time drops from ~1.1 milliseconds
to ~59 microseconds on arm64. (~19x speed up).
Signed-off-by: Kalesh Singh
---
Change in v3:
- Add set_pud_at() macro - Used by move_normal_pud().
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/pgtable.h | 1 +
2 files changed, 2 inserti
ead/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Signed-off-by: Kalesh Singh
Reported-by: kernel test robot
---
Changes in v2:
- Update commit message with description of Android GC's use case.
- Move set_pud_at() to a separate patch.
- Use switch() instead of ifs in move_pgt_entry()
- Fix build test error repor
205 microseconds
to ~15 microseconds on x86. (~13x speed up).
Signed-off-by: Kalesh Singh
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7101ac64bb20..ff6e2755cab8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -198,6 +198,7 @@ con
p time for a 1GB sized PMD-aligned region drops from
~9.1 milliseconds to ~1.1 milliseconds. (~8x speedup).
[1] https://lore.kernel.org/r/20181108181201.88826-3-joe...@google.com
[2] https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg140837.html
Signed-off-by: Kalesh Singh
---
arch
On Mon, Aug 03, 2020 at 08:30:59PM -0400, Joel Fernandes wrote:
> On Mon, Aug 3, 2020 at 10:47 AM 'Kalesh Singh' via kernel-team
> wrote:
> >
> > Provides a per process hook for the acquisition of file descriptors,
> > despite the method used to obtain the descriptor.
>
On Tue, Aug 04, 2020 at 02:09:13AM +0100, Al Viro wrote:
> On Mon, Aug 03, 2020 at 11:28:31PM +0100, Al Viro wrote:
>
> > IOW, what the hell is that horror for? You do realize, for example, that
> > there's
> > such thing as dup(), right? And dup2() as well. And while we are at it,
> > how
>
On Tue, Aug 04, 2020 at 07:27:24PM +0100, Al Viro wrote:
> On Tue, Aug 04, 2020 at 03:44:51PM +0000, Kalesh Singh wrote:
>
> > Hi Al. Thank you for the comments. Ultimately what we need is to identify
> > processes
> > that hold a file reference to the dma-buf. Unfortu
/list/kbuild-...@lists.01.org/thread/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Kalesh Singh (6):
kselftests: vm: Add mremap tests
arm64: mremap speedup - Enable HAVE_MOVE_PMD
mm: Speedup mremap on 1GB or larger regions
arm64: Add set_pud_at() functions
arm64: mremap speedup - Enable HAVE_MOVE_PUD
.
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Reduce test time by only validating a certain threshold of the
remapped region (4MB by default). The -t flag can be used to
set a custom threshold in MB or no threshold by passing 0. (-t0).
mremap time is not provided in stdout
ead/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Signed-off-by: Kalesh Singh
Reported-by: kernel test robot
---
Changes in v2:
- Update commit message with description of Android GC's use case.
- Move set_pud_at() to a separate patch.
- Use switch() instead of ifs in move_pgt_entry()
- Fix build test error repor
set_pud_at() is used in move_normal_pud() for remapping
pages at the PUD level.
Signed-off-by: Kalesh Singh
---
arch/arm64/include/asm/pgtable.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index d5d3fbe73953
p time for a 1GB sized PMD-aligned region drops from
~9.1 milliseconds to ~1.1 milliseconds. (~8x speedup).
[1] https://lore.kernel.org/r/20181108181201.88826-3-joe...@google.com
[2] https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg140837.html
Signed-off-by: Kalesh Singh
---
arch
ion time drops from ~1.1 milliseconds
to ~59 microseconds on arm64. (~19x speed up).
Signed-off-by: Kalesh Singh
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 844d089668e3..4d521f0a5863 100644
--- a/arch/arm64/Kconfig
+++ b/a
205 microseconds
to ~15 microseconds on x86. (~13x speed up).
Signed-off-by: Kalesh Singh
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7101ac64bb20..ff6e2755cab8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -198,6 +198,7 @@ con
Hi Kirill, thank you for the feedback.
On Fri, Oct 2, 2020 at 12:51 PM Kirill A. Shutemov
wrote:
>
> On Fri, Oct 02, 2020 at 04:20:48PM +, Kalesh Singh wrote:
> > Android needs to move large memory regions for garbage collection.
> > The GC requires moving physical pages
On Fri, Oct 2, 2020 at 12:52 PM Kirill A. Shutemov
wrote:
>
> On Fri, Oct 02, 2020 at 04:20:49PM +, Kalesh Singh wrote:
> > set_pud_at() is used in move_normal_pud() for remapping
> > pages at the PUD level.
> >
> > Signed-off-by: Kalesh Singh
> > ---
&
On Fri, Oct 2, 2020 at 6:08 PM Kalesh Singh wrote:
>
> Hi Kirill, thank you for the feedback.
>
> On Fri, Oct 2, 2020 at 12:51 PM Kirill A. Shutemov
> wrote:
> >
> > On Fri, Oct 02, 2020 at 04:20:48PM +, Kalesh Singh wrote:
> > > Android needs to m
On Sat, Oct 3, 2020 at 3:13 AM John Hubbard wrote:
>
> On 10/2/20 9:20 AM, Kalesh Singh wrote:
> > Test mremap on regions of various sizes and alignments and validate
> > data after remapping. Also provide total time for remapping
> > the region which is useful fo
HAVE_MOVE_PMD on arm64 : ~ 8x speed up
- Enabling HAVE_MOVE_PUD on arm64 : ~19x speed up
Altogether, HAVE_MOVE_PMD and HAVE_MOVE_PUD
give a total of ~150x speed up on arm64.
Kalesh Singh (5):
kselftests: vm: Add mremap tests
arm64: mremap speedup - Enable HAVE_MOVE_PMD
mm
.
Signed-off-by: Kalesh Singh
---
tools/testing/selftests/vm/.gitignore| 1 +
tools/testing/selftests/vm/Makefile | 1 +
tools/testing/selftests/vm/mremap_test.c | 243 +++
tools/testing/selftests/vm/run_vmtests | 11 +
4 files changed, 256 insertions(+)
create
PUD entry is “folded back” onto the PGD entry.
Add HAVE_MOVE_PUD so that architectures where moving at the PUD level
isn't supported/tested can turn this off by not selecting the config.
Signed-off-by: Kalesh Singh
---
arch/Kconfig | 7 +
arch/arm64/include/asm/pgtable.h |
p time for a 1GB sized PMD-aligned region drops from
~9.1 milliseconds to ~1.1 milliseconds. (~8x speedup).
[1] https://lore.kernel.org/r/20181108181201.88826-3-joe...@google.com
[2] https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg140837.html
Signed-off-by: Kalesh Singh
---
arch
205 microseconds
to ~15 microseconds on x86. (~13x speed up).
Signed-off-by: Kalesh Singh
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7101ac64bb20..ff6e2755cab8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -198,6 +198,7 @@ con
ion time drops from ~1.1 milliseconds
to ~59 microseconds on arm64. (~19x speed up).
Signed-off-by: Kalesh Singh
---
arch/arm64/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 844d089668e3..4d521f0a5863 100644
--- a/arch/arm64/Kconfig
+++ b/a
On Wed, Sep 30, 2020 at 6:47 PM Joel Fernandes wrote:
>
> On Wed, Sep 30, 2020 at 6:42 PM Lokesh Gidra wrote:
> >
> > On Wed, Sep 30, 2020 at 3:32 PM Kirill A. Shutemov
> > wrote:
> > >
> > > On Wed, Sep 30, 2020 at 10:21:17PM +, Kalesh Singh w
On Thu, Oct 1, 2020 at 3:24 AM John Hubbard wrote:
>
> On 9/30/20 3:21 PM, Kalesh Singh wrote:
> > Test mremap on regions of various sizes and alignments and validate
> > data after remapping. Also provide total time for remapping
> > the region which is useful fo
On Thu, Oct 1, 2020 at 8:27 AM Kirill A. Shutemov
wrote:
>
> On Wed, Sep 30, 2020 at 03:42:17PM -0700, Lokesh Gidra wrote:
> > On Wed, Sep 30, 2020 at 3:32 PM Kirill A. Shutemov
> > wrote:
> > >
> > > On Wed, Sep 30, 2020 at 10:21:17PM +, Kalesh
On Thu, Oct 1, 2020 at 8:37 AM Kirill A. Shutemov
wrote:
>
> On Wed, Sep 30, 2020 at 10:21:20PM +, Kalesh Singh wrote:
> > Android needs to move large memory regions for garbage collection.
> > Optimize mremap for >= 1GB-sized regions by moving at the PUD/PGD
&g
On Thu, Oct 1, 2020 at 12:40 PM Kalesh Singh wrote:
>
> On Thu, Oct 1, 2020 at 8:37 AM Kirill A. Shutemov
> wrote:
> >
> > On Wed, Sep 30, 2020 at 10:21:20PM +, Kalesh Singh wrote:
> > > Android needs to move large memory regions for garbage collection.
> >
On Tue, Oct 13, 2020 at 8:54 PM Kalesh Singh wrote:
>
Hi kselftest maintainers,
Could someone ACK this mremap test if there isn't any other concern?
Thanks,
Kalesh
> Test mremap on regions of various sizes and alignments and validate
> data after remapping. Also provide t
Since debugfs doesn't have stable abi. This patch series enables per
process accounting of dma buffers using trace events.
Kalesh Singh (2):
fs: Add fd_install file operation
dmabuf/tracing: Add dma-buf trace events
Documentation/filesystems/vfs.rst | 5 ++
drivers/dma-buf/dma-buf.c
Being able to analyze the per process usage of shared
dma buffers prodives useful insights in situations where
the system is experiencing high memory pressure. This would
allow us to see exactly which processes are holding references
to the shared buffer.
Signed-off-by: Kalesh Singh
---
drivers
Provides a per process hook for the acquisition of file descriptors,
despite the method used to obtain the descriptor.
Signed-off-by: Kalesh Singh
---
Documentation/filesystems/vfs.rst | 5 +
fs/file.c | 3 +++
include/linux/fs.h| 1 +
3 files changed
On Mon, Aug 03, 2020 at 11:32:39AM -0400, Steven Rostedt wrote:
> On Mon, 3 Aug 2020 14:47:19 +
> Kalesh Singh wrote:
>
> > +DECLARE_EVENT_CLASS(dma_buf_ref_template,
> > +
> > + TP_PROTO(struct task_struct *task, struct file *filp),
> &
On Mon, Aug 03, 2020 at 05:34:29PM +0100, Christoph Hellwig wrote:
> On Mon, Aug 03, 2020 at 02:47:18PM +0000, Kalesh Singh wrote:
> > Provides a per process hook for the acquisition of file descriptors,
> > despite the method used to obtain the descriptor.
> >
> >
On Thu, Dec 17, 2020 at 12:28 PM Guenter Roeck wrote:
>
> On Wed, Oct 14, 2020 at 12:53:08AM +, Kalesh Singh wrote:
> > Android needs to move large memory regions for garbage collection.
> > The GC requires moving physical pages of multi-gigabyte heap
> > using
When `next < old_addr`, `next - old_addr` arithmetic underflows
causing `extent` to be incorrect.
Make `extent` the smaller of `next - old_addr` or `old_end - old_addr`.
Reported-by: Guenter Roeck
Signed-off-by: Kalesh Singh
---
mm/mremap.c | 4 +++-
1 file changed, 3 insertions(+)
On Mon, Dec 28, 2020 at 12:59 PM Linus Torvalds
wrote:
>
> On Mon, Dec 28, 2020 at 7:51 AM Guenter Roeck wrote:
> >
> > Build results:
> > total: 153 pass: 151 fail: 2
>
> Thanks for doing these for the mainline rc's too. I've seen them for
> the stable kernels, but it's lovely to see it
Userspace can get suspend stats from the suspend stats debugfs node.
Since debugfs doesn't have stable ABI, expose suspend stats in
sysfs under /sys/power/suspend_stats.
Signed-off-by: Kalesh Singh
---
kernel/power/main.c | 77 +++--
1 file changed, 75
ion time drops from ~1.1 milliseconds
to ~59 microseconds on arm64. (~19x speed up).
Signed-off-by: Kalesh Singh
Acked-by: Kirill A. Shutemov
Cc: Catalin Marinas
Cc: Will Deacon
Cc: Andrew Morton
---
Changes in v3:
- Add set_pud_at() macro - Used by move_normal_pud().
Changes in v4:
-
.
Signed-off-by: Kalesh Singh
Reviewed-by: John Hubbard
Cc: Shuah Khan
Cc: Andrew Morton
Cc: Kirill A. Shutemov
---
Changes in v2:
- Reduce test time by only validating a certain threshold of the
remapped region (4MB by default). The -t flag can be used to
set a custom threshold in MB
205 microseconds
to ~15 microseconds on x86. (~13x speed up).
Signed-off-by: Kalesh Singh
Acked-by: Kirill A. Shutemov
Cc: Andrew Morton
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: Borislav Petkov
Cc: H. Peter Anvin
---
Changes in v4:
- Add Kirill's Acked-by.
arch/x86/Kconfig | 1 +
1 file changed
.
[1]
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org/thread/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Kalesh Singh (5):
kselftests: vm: Add mremap tests
arm64: mremap speedup - Enable HAVE_MOVE_PMD
mm: Speedup mremap on 1GB or larger regions
arm64: mremap speedup - Enable HAVE_MOVE_PUD
p time for a 1GB sized PMD-aligned region drops from
~9.1 milliseconds to ~1.1 milliseconds. (~8x speedup).
[1] https://lore.kernel.org/r/20181108181201.88826-3-joe...@google.com
[2] https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg140837.html
Signed-off-by: Kalesh Singh
Acked-by:
ead/CKPGL4FH4NG7TGH2CVYX2UX76L25BTA3/
Signed-off-by: Kalesh Singh
Reported-by: kernel test robot
Acked-by: Kirill A. Shutemov
Cc: Andrew Morton
---
Changes in v2:
- Update commit message with description of Android GC's use case.
- Move set_pud_at() to a separate patch.
- Use switch() instead of
On Thu, Jan 28, 2021 at 1:24 PM Kalesh Singh wrote:
>
> Android captures per-process system memory state when certain low memory
> events (e.g a foreground app kill) occur, to identify potential memory
> hoggers. In order to measure how much memory a process actually consumes,
>
On Wed, Jan 27, 2021 at 5:47 AM Jann Horn wrote:
>
> +jeffv from Android
>
> On Tue, Jan 26, 2021 at 11:51 PM Kalesh Singh wrote:
> > In order to measure how much memory a process actually consumes, it is
> > necessary to include the DMA buffer sizes for that process in t
The dmabuf inode number allows userspace to uniquely identify the buffer
and avoids a dependency on /proc//fd/* when accounting per-process
DMA buffer sizes.
Signed-off-by: Kalesh Singh
---
drivers/dma-buf/dma-buf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma-buf/dma-buf.c b
Since fdinfo doesn't permit reading process memory and manipulating
process state, allow accessing fdinfo under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3
Userspace can get suspend stats from the suspend stats debugfs node.
Since debugfs doesn't have stable ABI, expose suspend stats in
sysfs under /sys/power/suspend_stats.
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Added separate show functions for last_failed_* stats, as per Greg
On Wed, Jul 31, 2019 at 11:19 PM Greg KH wrote:
>
> On Wed, Jul 31, 2019 at 02:29:33PM -0700, Kalesh Singh wrote:
> > Userspace can get suspend stats from the suspend stats debugfs node.
> > Since debugfs doesn't have stable ABI, expose suspend stats in
> > sysfs under
On Mon, Feb 8, 2021 at 10:22 AM Matthew Wilcox wrote:
>
> On Mon, Feb 08, 2021 at 03:14:28PM +, Kalesh Singh wrote:
> > - seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\n",
> > + seq_printf(m,
> > "pos:\t%lli\nflags:\t0%o\nmnt_id:\
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Update patch description
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b3
And 'inode_no' field to /proc//fdinfo/ and
/proc//task//fdinfo/.
The inode numbers can be used to uniquely identify DMA buffers
in user space and avoids a dependency on /proc//fd/* when
accounting per-process DMA buffer sizes.
Signed-off-by: Kalesh Singh
Acked-by: Randy Dunlap
---
Changes
And 'inode_no' field to /proc//fdinfo/ and
/proc//task//fdinfo/.
The inode numbers can be used to uniquely identify DMA buffers
in user space and avoids a dependency on /proc//fd/* when
accounting per-process DMA buffer sizes.
Signed-off-by: Kalesh Singh
Acked-by: Randy Dunlap
---
Changes
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Update patch description
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b3
If a FD refers to a DMA buffer add the DMA buffer inode number to
/proc//fdinfo/ and /proc//task//fdindo/.
The dmabuf inode number allows userspace to uniquely identify the buffer
and avoids a dependency on /proc//fd/* when accounting per-process
DMA buffer sizes.
Signed-off-by: Kalesh Singh
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Update patch description
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b3
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Update patch desciption
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b3
If a FD refers to a DMA buffer add the DMA buffer inode number to
/proc//fdinfo/ and /proc//task//fdindo/.
The dmabuf inode number allows userspace to uniquely identify the buffer
and avoids a dependency on /proc//fd/* when accounting per-process
DMA buffer sizes.
Signed-off-by: Kalesh Singh
On Fri, Feb 5, 2021 at 2:56 AM Christian König wrote:
>
> Am 05.02.21 um 03:23 schrieb Kalesh Singh:
> > If a FD refers to a DMA buffer add the DMA buffer inode number to
> > /proc//fdinfo/ and /proc//task//fdindo/.
> >
> > The dmabuf inode number allows userspace t
/
Signed-off-by: Kalesh Singh
---
Documentation/filesystems/proc.rst | 30 ++
drivers/dma-buf/dma-buf.c | 7 +-
fs/proc/Makefile | 1 +
fs/proc/base.c | 1 +
fs/proc/dma_bufs.c | 159 +
fs/pr
On Wed, Mar 17, 2021 at 10:55 PM Kees Cook wrote:
>
> On Mon, Mar 08, 2021 at 05:06:40PM +, Kalesh Singh wrote:
> > Android captures per-process system memory state when certain low memory
> > events (e.g a foreground app kill) occur, to identify potential memory
>
On Mon, Mar 8, 2021 at 12:54 PM Christian König
wrote:
>
> Am 08.03.21 um 18:06 schrieb Kalesh Singh:
> > Android captures per-process system memory state when certain low memory
> > events (e.g a foreground app kill) occur, to identify potential memory
> > hoggers. In o
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Hi everyone,
The initial posting of this patch can be found at [1].
I didn't receive any feedback last time, so resending here.
Would really appreciate any constructive comments/suggestions.
Thanks,
Kalesh
And 'ino' field to /proc//fdinfo/ and
/proc//task//fdinfo/.
The inode numbers can be used to uniquely identify DMA buffers
in user space and avoids a dependency on /proc//fd/* when
accounting per-process DMA buffer sizes.
Signed-off-by: Kalesh Singh
Acked-by: Randy Dunlap
---
Hi everyone
And 'inode_no' field to /proc//fdinfo/ and
/proc//task//fdinfo/.
The inode numbers can be used to uniquely identify DMA buffers
in user space and avoids a dependency on /proc//fd/* when
accounting per-process DMA buffer sizes.
Signed-off-by: Kalesh Singh
---
Changes in v4:
- Add inode number
info under PTRACE_MODE_READ_FSCRED.
Suggested-by: Jann Horn
Signed-off-by: Kalesh Singh
---
Changes in v2:
- Update patch description
fs/proc/base.c | 4 ++--
fs/proc/fd.c | 15 ++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b3
On Mon, Feb 8, 2021 at 10:53 AM Kalesh Singh wrote:
>
> Android captures per-process system memory state when certain low memory
> events (e.g a foreground app kill) occur, to identify potential memory
> hoggers. In order to measure how much memory a process actually consumes,
>
71 matches
Mail list logo