From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9C15ECAAD1 for ; Thu, 1 Sep 2022 09:45:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F37C28D0001; Thu, 1 Sep 2022 05:45:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE6FD6B0073; Thu, 1 Sep 2022 05:45:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAE938D0001; Thu, 1 Sep 2022 05:45:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C92E06B0072 for ; Thu, 1 Sep 2022 05:45:08 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 97CA6140E79 for ; Thu, 1 Sep 2022 09:45:08 +0000 (UTC) X-FDA: 79863033096.02.E698D9C Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf27.hostedemail.com (Postfix) with ESMTP id 3A5C14008B for ; Thu, 1 Sep 2022 09:45:07 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AFC43224B4; Thu, 1 Sep 2022 09:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1662025505; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ZIK2nmmdOwpJs8RmD+JOMJpbIOKkPprlTzt8rEHXO4=; b=XUEoKCQNhQBXLk5D6kIglv+JNtBEPN4/1OQHVut7g0yeQuFqjmj+SVMmBP2xvPXZ0T4oEc xPBF2BlTZnXT/iM52xuHkG0X2kj9QvYNcR+cYo2N4xwme9B5hMn41gU5yWgbNskmuZfS7Z 6RuOa6FJIJADYBPVXaSz/KwAQHo1toQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1662025505; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ZIK2nmmdOwpJs8RmD+JOMJpbIOKkPprlTzt8rEHXO4=; b=sjtsG4UY3nl09EGLstblepLHhDsJSZOMV2337Xe/juGtf3YVATyrNSb3D+9QTaY9piQj89 bvvPMPtHILFpAGAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8E98213A89; Thu, 1 Sep 2022 09:45:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lOsgIiF/EGNOVwAAMHmgww (envelope-from ); Thu, 01 Sep 2022 09:45:05 +0000 Message-ID: Date: Thu, 1 Sep 2022 11:45:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [linux-next:master 2760/3682] include/trace/events/kmem.h:54:1: sparse: sparse: restricted gfp_t degrades to integer Content-Language: en-US To: kernel test robot , Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: kbuild-all@lists.01.org, Linux Memory Management List References: <202208290041.W6s9gjtG-lkp@intel.com> From: Vlastimil Babka In-Reply-To: <202208290041.W6s9gjtG-lkp@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662025507; a=rsa-sha256; cv=none; b=VtwSjGqkqAnWJRg2VFo2V2S6fr9qlz/5hbg2YF7+LpoXyMMXAFffUIbdw3Lboy4e+D026G Qe/0PcZT/x5UOEQh4drRzewt3DmC1Z9RaLV3mqvi5xM9KzLMJXf8jKWwI7St5w2JEbzgOb oFKUZwV2igLEwFGYKRubDE7nTFNmpq8= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=XUEoKCQN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=sjtsG4UY; spf=pass (imf27.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662025507; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7ZIK2nmmdOwpJs8RmD+JOMJpbIOKkPprlTzt8rEHXO4=; b=lU0WVon00GAh3zpjnzo3z/nMOTwd3jOQGapcF/+AmkpPeqBRC+2pu8x1KznjcK2a+1s9Hx uaTDI6SBhi7R+lAtNspdtW6RmKHzgF77bQSixVJ9p7xYx+fnkN/vEf1ABx2BuKCDw11tu5 SLAG6ksZ8S9Ehp8xTQKQ1ME2M2zq3EI= X-Rspam-User: X-Stat-Signature: t1iok55uaz7xmir474ujwroaje6udkda X-Rspamd-Queue-Id: 3A5C14008B X-Rspamd-Server: rspam06 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=XUEoKCQN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=sjtsG4UY; spf=pass (imf27.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-HE-Tag: 1662025507-752406 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 8/28/22 18:30, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 8d0c42c9e80791e8baba2932d2cbd2dcead50d47 > commit: 86431e299ca5a0e16405201535b6060936146215 [2760/3682] mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using > config: openrisc-randconfig-s033-20220828 (https://download.01.org/0day-ci/archive/20220829/202208290041.W6s9gjtG-lkp@intel.com/config) > compiler: or1k-linux-gcc (GCC) 12.1.0 > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # apt-get install sparse > # sparse version: v0.6.4-39-gce1a6720-dirty > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=86431e299ca5a0e16405201535b6060936146215 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 86431e299ca5a0e16405201535b6060936146215 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot > > sparse warnings: (new ones prefixed by >>) > mm/slab_common.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/kmem.h): >>> include/trace/events/kmem.h:54:1: sparse: sparse: restricted gfp_t degrades to integer > > vim +54 include/trace/events/kmem.h > > 53 > > 54 TRACE_EVENT(kmalloc, > 55 > 56 TP_PROTO(unsigned long call_site, > 57 const void *ptr, > 58 size_t bytes_req, > 59 size_t bytes_alloc, > 60 gfp_t gfp_flags, > 61 int node), > 62 > 63 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), > 64 > 65 TP_STRUCT__entry( > 66 __field( unsigned long, call_site ) > 67 __field( const void *, ptr ) > 68 __field( size_t, bytes_req ) > 69 __field( size_t, bytes_alloc ) > 70 __field( unsigned long, gfp_flags ) > 71 __field( int, node ) > 72 ), > 73 > 74 TP_fast_assign( > 75 __entry->call_site = call_site; > 76 __entry->ptr = ptr; > 77 __entry->bytes_req = bytes_req; > 78 __entry->bytes_alloc = bytes_alloc; > 79 __entry->gfp_flags = (__force unsigned long)gfp_flags; > 80 __entry->node = node; > 81 ), > 82 > 83 TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d accounted=%s", > 84 (void *)__entry->call_site, > 85 __entry->ptr, > 86 __entry->bytes_req, > 87 __entry->bytes_alloc, > 88 show_gfp_flags(__entry->gfp_flags), > 89 __entry->node, > 90 (IS_ENABLED(CONFIG_MEMCG_KMEM) && > 91 (__entry->gfp_flags & __GFP_ACCOUNT)) ? "true" : "false") > 92 ); > 93 Amending the commit with diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 8c6f96604244..243073cfc29d 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -88,7 +88,7 @@ TRACE_EVENT(kmalloc, show_gfp_flags(__entry->gfp_flags), __entry->node, (IS_ENABLED(CONFIG_MEMCG_KMEM) && - (__entry->gfp_flags & __GFP_ACCOUNT)) ? "true" : "false") + (__entry->gfp_flags & (__force unsigned long)__GFP_ACCOUNT)) ? "true" : "false") );