[PATCH v3 1/5] kselftests: vm: Add mremap tests

2020-10-05 Thread Kalesh Singh
. 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

[PATCH v3 0/5] Speed up mremap on large regions

2020-10-05 Thread Kalesh Singh
/ 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

[PATCH v3 4/5] arm64: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-05 Thread Kalesh Singh
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

[PATCH v3 3/5] mm: Speedup mremap on 1GB or larger regions

2020-10-05 Thread Kalesh Singh
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

[PATCH v3 5/5] x86: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-05 Thread Kalesh Singh
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

[PATCH v3 2/5] arm64: mremap speedup - Enable HAVE_MOVE_PMD

2020-10-05 Thread Kalesh Singh
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

Re: [PATCH 1/2] fs: Add fd_install file operation

2020-08-04 Thread Kalesh Singh
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. >

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Kalesh Singh
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 >

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-04 Thread Kalesh Singh
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

[PATCH v2 0/6] Speed up mremap on large regions

2020-10-02 Thread Kalesh Singh
/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

[PATCH v2 1/6] kselftests: vm: Add mremap tests

2020-10-02 Thread Kalesh Singh
. 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

[PATCH v2 3/6] mm: Speedup mremap on 1GB or larger regions

2020-10-02 Thread Kalesh Singh
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

[PATCH v2 4/6] arm64: Add set_pud_at() function

2020-10-02 Thread Kalesh Singh
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

[PATCH v2 2/6] arm64: mremap speedup - Enable HAVE_MOVE_PMD

2020-10-02 Thread Kalesh Singh
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

[PATCH v2 5/6] arm64: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-02 Thread Kalesh Singh
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

[PATCH v2 6/6] x86: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-02 Thread Kalesh Singh
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

Re: [PATCH v2 3/6] mm: Speedup mremap on 1GB or larger regions

2020-10-02 Thread Kalesh Singh
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

Re: [PATCH v2 4/6] arm64: Add set_pud_at() function

2020-10-02 Thread Kalesh Singh
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 > > --- &

Re: [PATCH v2 3/6] mm: Speedup mremap on 1GB or larger regions

2020-10-02 Thread 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

Re: [PATCH v2 1/6] kselftests: vm: Add mremap tests

2020-10-03 Thread Kalesh Singh
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

[PATCH 0/5] Speed up mremap on large regions

2020-09-30 Thread Kalesh Singh
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

[PATCH 1/5] kselftests: vm: Add mremap tests

2020-09-30 Thread Kalesh Singh
. 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

[PATCH 3/5] mm: Speedup mremap on 1GB or larger regions

2020-09-30 Thread Kalesh Singh
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 |

[PATCH 2/5] arm64: mremap speedup - Enable HAVE_MOVE_PMD

2020-09-30 Thread Kalesh Singh
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

[PATCH 5/5] x86: mremap speedup - Enable HAVE_MOVE_PUD

2020-09-30 Thread Kalesh Singh
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

[PATCH 4/5] arm64: mremap speedup - Enable HAVE_MOVE_PUD

2020-09-30 Thread Kalesh Singh
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

Re: [PATCH 0/5] Speed up mremap on large regions

2020-09-30 Thread Kalesh Singh
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

Re: [PATCH 1/5] kselftests: vm: Add mremap tests

2020-10-01 Thread Kalesh Singh
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

Re: [PATCH 0/5] Speed up mremap on large regions

2020-10-01 Thread Kalesh Singh
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

Re: [PATCH 3/5] mm: Speedup mremap on 1GB or larger regions

2020-10-01 Thread Kalesh Singh
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

Re: [PATCH 3/5] mm: Speedup mremap on 1GB or larger regions

2020-10-01 Thread Kalesh Singh
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. > >

Re: [PATCH v4 1/5] kselftests: vm: Add mremap tests

2020-10-14 Thread Kalesh Singh
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

[PATCH 0/2] Per process tracking of dma buffers

2020-08-03 Thread Kalesh Singh
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

[PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Kalesh Singh
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

[PATCH 1/2] fs: Add fd_install file operation

2020-08-03 Thread Kalesh Singh
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

Re: [PATCH 2/2] dmabuf/tracing: Add dma-buf trace events

2020-08-03 Thread Kalesh Singh
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), > &

Re: [PATCH 1/2] fs: Add fd_install file operation

2020-08-03 Thread Kalesh Singh
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. > > > >

Re: [PATCH v4 3/5] mm: Speedup mremap on 1GB or larger regions

2020-12-17 Thread Kalesh Singh
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

[PATCH] mm: mremap - Fix extent calculation

2020-12-19 Thread Kalesh Singh
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(+)

Re: Linux 5.11-rc1

2020-12-28 Thread Kalesh Singh
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

[PATCH] PM/sleep: Expose suspend stats in sysfs

2019-07-30 Thread Kalesh Singh
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

[PATCH v4 4/5] arm64: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-14 Thread Kalesh Singh
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: -

[PATCH v4 1/5] kselftests: vm: Add mremap tests

2020-10-14 Thread Kalesh Singh
. 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

[PATCH v4 5/5] x86: mremap speedup - Enable HAVE_MOVE_PUD

2020-10-14 Thread Kalesh Singh
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

[PATCH v4 0/5] Speed up mremap on large regions

2020-10-14 Thread Kalesh Singh
. [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

[PATCH v4 2/5] arm64: mremap speedup - Enable HAVE_MOVE_PMD

2020-10-14 Thread Kalesh Singh
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:

[PATCH v4 3/5] mm: Speedup mremap on 1GB or larger regions

2020-10-14 Thread Kalesh Singh
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

Re: [PATCH 0/2] Allow reading process DMA buf stats from fdinfo

2021-02-03 Thread Kalesh Singh
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, >

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Kalesh Singh
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

[PATCH 2/2] dmabuf: Add dmabuf inode no to fdinfo

2021-01-28 Thread Kalesh Singh
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

[PATCH 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-01-28 Thread Kalesh Singh
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

[PATCH v2] PM/sleep: Expose suspend stats in sysfs

2019-07-31 Thread Kalesh Singh
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

Re: [PATCH v2] PM/sleep: Expose suspend stats in sysfs

2019-08-01 Thread Kalesh Singh
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

Re: [PATCH v5 2/2] procfs/dmabuf: Add inode number to /proc/*/fdinfo

2021-02-08 Thread Kalesh Singh
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:\

[PATCH v6 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-08 Thread 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

[PATCH v6 2/2] procfs/dmabuf: Add inode number to /proc/*/fdinfo

2021-02-08 Thread Kalesh Singh
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

[PATCH v5 2/2] procfs/dmabuf: Add inode number to /proc/*/fdinfo

2021-02-08 Thread Kalesh Singh
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

[PATCH v5 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-08 Thread 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

[PATCH v3 2/2] dmabuf: Add dmabuf inode number to /proc/*/fdinfo

2021-02-04 Thread 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 to uniquely identify the buffer and avoids a dependency on /proc//fd/* when accounting per-process DMA buffer sizes. Signed-off-by: Kalesh Singh

[PATCH v3 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-04 Thread 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

[PATCH v2 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-04 Thread Kalesh Singh
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

[PATCH v2 2/2] dmabuf: Add dmabuf inode number to /proc/*/fdinfo

2021-02-04 Thread 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 to uniquely identify the buffer and avoids a dependency on /proc//fd/* when accounting per-process DMA buffer sizes. Signed-off-by: Kalesh Singh

Re: [PATCH v3 2/2] dmabuf: Add dmabuf inode number to /proc/*/fdinfo

2021-02-05 Thread 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

[PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Kalesh Singh
/ 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

Re: [RESEND PATCH v6 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-03-18 Thread Kalesh Singh
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 >

Re: [RESEND PATCH v6 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-03-08 Thread Kalesh Singh
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

[RESEND PATCH v6 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-03-08 Thread Kalesh Singh
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

[RESEND PATCH v6 2/2] procfs/dmabuf: Add inode number to /proc/*/fdinfo

2021-03-08 Thread Kalesh Singh
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

[PATCH v4 2/2] dmabuf: Add dmabuf inode number to /proc/*/fdinfo

2021-02-05 Thread Kalesh Singh
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

[PATCH v4 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-05 Thread 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

Re: [PATCH v6 1/2] procfs: Allow reading fdinfo with PTRACE_MODE_READ

2021-02-22 Thread Kalesh Singh
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, >