linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] memory: export symbols for process memory related functions
@ 2023-06-09 11:09 jim.tsai
  2023-06-09 11:20 ` Russell King (Oracle)
  0 siblings, 1 reply; 4+ messages in thread
From: jim.tsai @ 2023-06-09 11:09 UTC (permalink / raw)
  To: linux-kernel, Russell King, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: wsd_upstream, mel.lee, ivan.tseng, jim.tsai, linux-arm-kernel,
	linux-fsdevel, linux-mediatek

Export symbols for arch_vma_name and smap_gather_stats
functions so that we can detect the memory leak issues.
Besides, we can know which memory type is leaked, too.

Signed-off-by: jim.tsai <Wei-chin.Tsai@mediatek.com>
---
 arch/arm/kernel/process.c | 1 +
 fs/proc/task_mmu.c        | 5 +++--
 kernel/signal.c           | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 0e8ff85890ad..df91412a1069 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -343,6 +343,7 @@ const char *arch_vma_name(struct vm_area_struct *vma)
 {
 	return is_gate_vma(vma) ? "[vectors]" : NULL;
 }
+EXPORT_SYMBOL_GPL(arch_vma_name);
 
 /* If possible, provide a placement hint at a random offset from the
  * stack for the sigpage and vdso pages.
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 6259dd432eeb..814d7829a20b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -773,8 +773,8 @@ static const struct mm_walk_ops smaps_shmem_walk_ops = {
  *
  * Use vm_start of @vma as the beginning address if @start is 0.
  */
-static void smap_gather_stats(struct vm_area_struct *vma,
-		struct mem_size_stats *mss, unsigned long start)
+void smap_gather_stats(struct vm_area_struct *vma,
+		       struct mem_size_stats *mss, unsigned long start)
 {
 	const struct mm_walk_ops *ops = &smaps_walk_ops;
 
@@ -809,6 +809,7 @@ static void smap_gather_stats(struct vm_area_struct *vma,
 	else
 		walk_page_range(vma->vm_mm, start, vma->vm_end, ops, mss);
 }
+EXPORT_SYMBOL_GPL(smap_gather_stats);
 
 #define SEQ_PUT_DEC(str, val) \
 		seq_put_decimal_ull_width(m, str, (val) >> 10, 8)
diff --git a/kernel/signal.c b/kernel/signal.c
index b5370fe5c198..a1abe77fcdc3 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -4700,6 +4700,7 @@ __weak const char *arch_vma_name(struct vm_area_struct *vma)
 {
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(arch_vma_name);
 
 static inline void siginfo_buildtime_checks(void)
 {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] memory: export symbols for process memory related functions
  2023-06-09 11:09 [PATCH v1 1/1] memory: export symbols for process memory related functions jim.tsai
@ 2023-06-09 11:20 ` Russell King (Oracle)
       [not found]   ` <5cc76704214673cf03376d9f10f61325b9ed323f.camel@mediatek.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King (Oracle) @ 2023-06-09 11:20 UTC (permalink / raw)
  To: jim.tsai
  Cc: linux-kernel, Matthias Brugger, AngeloGioacchino Del Regno,
	wsd_upstream, mel.lee, ivan.tseng, linux-arm-kernel,
	linux-fsdevel, linux-mediatek

On Fri, Jun 09, 2023 at 07:09:00PM +0800, jim.tsai wrote:
> Export symbols for arch_vma_name and smap_gather_stats
> functions so that we can detect the memory leak issues.
> Besides, we can know which memory type is leaked, too.

This commit description doesn't give enough information. How does
exporting arch_vma_name() help with detecting memory leak issues?

You haven't included any users of these new exports, so the initial
reaction is going to be negative - please include the users of these
new symbols in your patch set.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] memory: export symbols for process memory related functions
       [not found]   ` <5cc76704214673cf03376d9f10f61325b9ed323f.camel@mediatek.com>
@ 2023-06-10  0:21     ` Matthew Wilcox
       [not found]       ` <c23e1fb3628bf0a32bd0eb491c9370b961e19fd1.camel@mediatek.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2023-06-10  0:21 UTC (permalink / raw)
  To: Wei-chin Tsai (蔡維晉)
  Cc: linux@armlinux.org.uk, linux-kernel@vger.kernel.org,
	Mel Lee (李奇錚),
	linux-mediatek@lists.infradead.org, wsd_upstream,
	linux-arm-kernel@lists.infradead.org,
	linux-fsdevel@vger.kernel.org, matthias.bgg@gmail.com,
	Ivan Tseng (曾志軒),
	angelogioacchino.delregno@collabora.com

On Fri, Jun 09, 2023 at 04:09:01PM +0000, Wei-chin Tsai (蔡維晉) wrote:
> > You haven't included any users of these new exports, so the initial
> > reaction is going to be negative - please include the users of these
> > new symbols in your patch set.
> We use these two export functions from our kernel module to get a
> specific user process's memory information and heap usage. Furthermore,
> we can use such information to detect the memory leak issues. 
> 
> The example code is as follows:

No.  You need to be submitting the code that will use the symbol *at the
same time* as the patch to export the symbol.  No example code showing
how it could be used.  Because if the user isn't compelling, the patch
to export the symbol won't be applied either.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] memory: export symbols for process memory related functions
       [not found]       ` <c23e1fb3628bf0a32bd0eb491c9370b961e19fd1.camel@mediatek.com>
@ 2023-06-16  9:24         ` Matthias Brugger
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Brugger @ 2023-06-16  9:24 UTC (permalink / raw)
  To: Wei-chin Tsai (蔡維晉), willy@infradead.org
  Cc: linux-kernel@vger.kernel.org, Mel Lee (李奇錚),
	linux-mediatek@lists.infradead.org, linux@armlinux.org.uk,
	wsd_upstream, linux-arm-kernel@lists.infradead.org,
	linux-fsdevel@vger.kernel.org,
	Ivan Tseng (曾志軒),
	angelogioacchino.delregno@collabora.com



On 12/06/2023 16:21, Wei-chin Tsai (蔡維晉) wrote:
> On Sat, 2023-06-10 at 01:21 +0100, Matthew Wilcox wrote:
>>   
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>  On Fri, Jun 09, 2023 at 04:09:01PM +0000, Wei-chin Tsai (蔡維晉) wrote:
>> > > You haven't included any users of these new exports, so the
>> initial
>> > > reaction is going to be negative - please include the users of
>> these
>> > > new symbols in your patch set.
>> > We use these two export functions from our kernel module to get a
>> > specific user process's memory information and heap usage.
>> Furthermore,
>> > we can use such information to detect the memory leak issues. 
>> > 
>> > The example code is as follows:
>> 
>> No.  You need to be submitting the code that will use the symbol *at
>> the
>> same time* as the patch to export the symbol.  No example code
>> showing
>> how it could be used.  Because if the user isn't compelling, the
>> patch
>> to export the symbol won't be applied either.
> 
> Hi Matthew,
> 
> Got it. The following attached patch file
> "v1-0001-memory-export-symbols-for-process-memory-related-.patch" is
> the patch including the users of these new symbols. Thanks.

Please send both patches as a single series, then we can start review process. I 
had a very quick look on the attached patch and it's missing a good commit 
message describing what the drivers is for and why you need it.

Regards,
Matthias

> 
> Regards,
> 
> Jim
> 
> ************* MEDIATEK Confidentiality Notice ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-16  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 11:09 [PATCH v1 1/1] memory: export symbols for process memory related functions jim.tsai
2023-06-09 11:20 ` Russell King (Oracle)
     [not found]   ` <5cc76704214673cf03376d9f10f61325b9ed323f.camel@mediatek.com>
2023-06-10  0:21     ` Matthew Wilcox
     [not found]       ` <c23e1fb3628bf0a32bd0eb491c9370b961e19fd1.camel@mediatek.com>
2023-06-16  9:24         ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).