Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2269376ybb; Mon, 30 Mar 2020 02:58:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs+8/YOWYnd0eiTPpToloGn4HSPtPFZYzB8s/7NbjWh5kvQsPzZgBX7yG9ZCNE3RUAuZeoZ X-Received: by 2002:a9d:837:: with SMTP id 52mr8030292oty.354.1585562324528; Mon, 30 Mar 2020 02:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585562324; cv=none; d=google.com; s=arc-20160816; b=U1OTQCoLlwJy6S4k5W1adXBCarPUDI//HXXvT0+G3rmFAwD7m0o2FZ/bLKL5EJwnB4 OKAkK4BTqZYdX6PmcM9KMEHNtm5CzH9yrqj0JCxuPix+5VP3Zim6azAblH3pqR5gMM07 XY39aOYHtGFYZO+tgQqYk4BOmkU5R2PaGDzOO+2P50SSOBjXuej8o1ogGM78Fn8jdpx5 GIB7/2t21vYuGNe5+jat6KTGoJcKpMdUxKRVE//h+n1NeE3WuT55ZKJZ/8/J34wAZx0C xQUGpuM+1UmL5f69JjJvX3E3kJ+eJdfKur7NkTYktMASkdMvztaGTAVsOL4j036rbkDf Mu4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Zxo2JW/gw1MyCfKnAROV53VmkdmdAKMqTczos6T2DI8=; b=OV/pJVmzy6Xn5qirLVA+RnI1F5etsK539k3VYLvD4/a2tH4JL6eykuUFqLPIy77Ldd 0Q/oO1NMm4FCNKarA2Fhpd0R2Im4V2YdiNyyr0CC+9C/b99wzEVzQCBjRHS0uCJUN0Hk qiCaVP9jl77mrkb4GFscrHRCyJi2UuK5C5K9pofHUNdDO1ZQWzzZ/bIwFoMMhUSzBnF+ Fom30mEBaXDffF6VdsnbEi1DrVsu5KLoeO2AW6x52Lq3U4AQbG23ziGvQPpFzlj/kicI tYuljXkA0eG7f8LDPujVj88KfGDhHXMpIIFxbZtHyeSPzZG9wfuRnbBWLqPdBb7g3yRX GIyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si6635623otg.211.2020.03.30.02.58.31; Mon, 30 Mar 2020 02:58:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgC3J4u (ORCPT + 99 others); Mon, 30 Mar 2020 05:56:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:60342 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbgC3J4t (ORCPT ); Mon, 30 Mar 2020 05:56:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 16A64AE0F; Mon, 30 Mar 2020 09:56:48 +0000 (UTC) Subject: Re: [PATCH v3 2/2] mm: mmap: add trace point of vm_unmapped_area To: Matthew Wilcox , Jaewon Kim 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 References: <20200320055823.27089-1-jaewon31.kim@samsung.com> <20200320055823.27089-3-jaewon31.kim@samsung.com> <20200329161410.GW22483@bombadil.infradead.org> From: Vlastimil Babka Message-ID: <1ccdcd2e-2a56-af61-5b37-26ad64da0e7d@suse.cz> Date: Mon, 30 Mar 2020 11:56:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200329161410.GW22483@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. >