linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Matthew Wilcox <willy@infradead.org>,
	Jaewon Kim <jaewon31.kim@samsung.com>
Cc: walken@google.com, bp@suse.de, akpm@linux-foundation.org,
	srostedt@vmware.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v3 2/2] mm: mmap: add trace point of vm_unmapped_area
Date: Mon, 30 Mar 2020 11:56:46 +0200	[thread overview]
Message-ID: <1ccdcd2e-2a56-af61-5b37-26ad64da0e7d@suse.cz> (raw)
In-Reply-To: <20200329161410.GW22483@bombadil.infradead.org>

On 3/29/20 6:14 PM, Matthew Wilcox wrote:
> On Fri, Mar 20, 2020 at 02:58:23PM +0900, Jaewon Kim wrote:
>> +	TP_printk("addr=%lx err=%ld total_vm=0x%lx flags=0x%lx len=0x%lx lo=0x%lx hi=0x%lx mask=0x%lx ofs=0x%lx\n",
>> +		IS_ERR_VALUE(__entry->addr) ? 0 : __entry->addr,
>> +		IS_ERR_VALUE(__entry->addr) ? __entry->addr : 0,
> 
> I didn't see the IS_ERR_VALUE problem that Vlastimil mentioned get resolved?

Steven is fixing it in trace-cmd:
https://lore.kernel.org/r/20200324200956.821799393@goodmis.org

> I might suggest ...
> 
> +++ b/include/linux/err.h
> @@ -19,7 +19,8 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
> +#define __IS_ERR_VALUE(x) ((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
> +#define IS_ERR_VALUE(x) unlikely(__IS_ERR_VALUE(x))

So this shouldn't be needed, as we are adding a new tracepoint, not "breaking"
an existing one?

>  static inline void * __must_check ERR_PTR(long error)
>  {
> 
> and then you can use __IS_ERR_VALUE() which removes the unlikely() problem.
> 



  parent reply	other threads:[~2020-03-30  9:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200320055839epcas1p26174a6a8e868127a78d24ebd95680b76@epcas1p2.samsung.com>
2020-03-20  5:58 ` [PATCH v3 0/2] mm: mmap: add mmap trace point Jaewon Kim
     [not found]   ` <CGME20200320055839epcas1p1a9b626b3afe8c22e36ff198f9eaeab2e@epcas1p1.samsung.com>
2020-03-20  5:58     ` [PATCH v3 1/2] mmap: remove inline of vm_unmapped_area Jaewon Kim
     [not found]   ` <CGME20200320055839epcas1p189100549687530619d8a19919e8b5de0@epcas1p1.samsung.com>
2020-03-20  5:58     ` [PATCH v3 2/2] mm: mmap: add trace point " Jaewon Kim
2020-03-29 16:08       ` Matthew Wilcox
2020-03-30 16:33         ` Kirill A. Shutemov
2020-03-29 16:14       ` Matthew Wilcox
2020-03-30  4:49         ` Jaewon Kim
2020-03-30  9:56         ` Vlastimil Babka [this message]
2020-03-30  9:59           ` Jaewon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ccdcd2e-2a56-af61-5b37-26ad64da0e7d@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=jaewon31.kim@gmail.com \
    --cc=jaewon31.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@vmware.com \
    --cc=walken@google.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).