Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1856928ybt; Mon, 15 Jun 2020 11:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeKgf3l13n9N+ogUivWVLNiomBjyJog5120r8cs9VtHQtx76G8pjpO3GxYwCeWEZX/4jni X-Received: by 2002:aa7:de08:: with SMTP id h8mr24159330edv.164.1592244605226; Mon, 15 Jun 2020 11:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592244605; cv=none; d=google.com; s=arc-20160816; b=kijXsn0PwZx45I2XEAr9m+sEeHYGuqPcscxT8VXdgPcAY6aK5k7hPA8+YJ5G+ypzxt cQXdM9DUw3bBk5nZ52VqYCzc/O0C/hBUPxxKuo5ISJg2hI3T2VHRoDC/v26eDDj7WwLA d9NYhuUZV7ts5XQFn0btSzSbWx2Z0JV3wojgxEhkiTX4ggfPLX5bumQ55lI6AzCIydW/ PAWL8p40Q9uTsEp8yPLB4Qy2GErytCPnM0u1es4w5CEzwJ22+tG6E6t4ETXR7WnbAwIg z75QO/mm0NVrTS/OGaIisoKqh52I7gdu/+ww5n9BujMVed0MF8WS5GDZ3XsCnre1qQ2J olIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f51GDLsBir2dAMmlhVmB+JP/MQ48jFa5bE42ESbx4vQ=; b=Xs8l2DZ9v8px9vuNCUoWenhGPX5h94sAyKxHTuI2FRkLTm3LnlQUBQUHY+cj/uwkkt 3ZAXC9RaFzoNetrIduB2oAdSDjT2OoEysJX5JAlz3c0naLH5zqX4SwC/ZOqN5FHjvaZa W3AlWWapTmFTlSegwjg9nwTI7F6iRcIaaGi0Jjb4DcihA9gcTSuWXs0DrmVz/sWZlmoZ PgYgC17BCjfhszVcClyVtmEEUOH2dVxUxqp5hdNU75wWEno0pU+xd/hgVKQPATl0sLSw PwRTXVa4S/bPXab3CoO6hAj5AkAoYGBdWQnY6WSTA3G+HP2P9A6Z8Iuh413unWFBIhug RVDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vJVJDRbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si8982692ejn.265.2020.06.15.11.09.41; Mon, 15 Jun 2020 11:10:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vJVJDRbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731167AbgFOSHm (ORCPT + 99 others); Mon, 15 Jun 2020 14:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgFOSHm (ORCPT ); Mon, 15 Jun 2020 14:07:42 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7AAC061A0E for ; Mon, 15 Jun 2020 11:07:41 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id s10so7936084pgm.0 for ; Mon, 15 Jun 2020 11:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f51GDLsBir2dAMmlhVmB+JP/MQ48jFa5bE42ESbx4vQ=; b=vJVJDRbSHJQyVm+QZONnR87czvKv/DXIwooc3Xyw/92Mjl44Fs+3KzISBmCdoMsRXU h8lheqKzfqccOKU56okzVGUtCCESyp0tYHMlW7a5qvG7mMIM1AhGwFDfaUciwa02AouN Dm540ICWNSCOXVItRldTGrZ2j19RCkSBx1qBXOIvm+d9xExgJ/aSRJs8QsFi08dcPKAI Py4THGRKmqCdc1RU03ciQiVSI1ZHfeHSFDC0uHed4mtGwErNSlma2bY4vlLTwY059N5R B4U5I8HmiqvTiIYwSE9CFF7EyJcxTYrKiqMQQH4HpXDZ81a7uaF5QFA+CdIFn4CDCs45 HK1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f51GDLsBir2dAMmlhVmB+JP/MQ48jFa5bE42ESbx4vQ=; b=IPl6G0WbamywiadqoxRRKk/9gb3Z9tLshUn0xbT17UKGcAjwqV5nSefxIESLmzTwLG MhsAkD4VMzIshF58cORK6dzPV/8i66wpfqkp5bytyl44xCWRQ6YQWqMVoj/prRxS8pZN 9VJW6E+Td7FacMcy3Asfw01NA4x9dTrlF5uZJXJbwmOddIXqVgya+hrSc9Duf58wIMUe wGnL0sIn/xCczMXoIGqaoNVGiYIpPfXTPEuVpM+gCIo6unVNP0kTWysU8M3Orhdcbnil +a+LLsa2jJYX3eEbOf0VAWw0PzavYIIGHLNR7UvyR9uIZDT2IBIj6J5QsX5IWXi2k+EK 2JAA== X-Gm-Message-State: AOAM530kHXdIURgrSwE2kaWeeNfDd2EdAirQJs0oZx/yNTJHaaJvrS8Q 1QZbTnfbbvmdIoXF+Dc/IzpgGBabKHzh8SugED3B3w== X-Received: by 2002:a05:6a00:15ca:: with SMTP id o10mr24597859pfu.169.1592244460591; Mon, 15 Jun 2020 11:07:40 -0700 (PDT) MIME-Version: 1.0 References: <20200615062520.GK12456@shao2-debian> In-Reply-To: From: Nick Desaulniers Date: Mon, 15 Jun 2020 11:07:29 -0700 Message-ID: Subject: Re: net/sched/sch_fq.c:966:12: warning: stack frame size of 1400 bytes in function 'fq_dump' To: Eric Dumazet Cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 10:59 AM 'Eric Dumazet' via Clang Built Linux wrote: > > On Mon, Jun 15, 2020 at 10:54 AM Eric Dumazet wrote: > > > > On Mon, Jun 15, 2020 at 10:44 AM Nick Desaulniers > > wrote: > > > > > > On Mon, Jun 15, 2020 at 9:17 AM 'Eric Dumazet' via Clang Built Linux > > > wrote: > > > > > > > > On Sun, Jun 14, 2020 at 11:26 PM kernel test robot wrote: > > > > > > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > > > head: 96144c58abe7ff767e754b5b80995f7b8846d49b > > > > > commit: 39d010504e6b4485d7ceee167743620dd33f4417 net_sched: sch_fq: add horizon attribute > > > > > date: 6 weeks ago > > > > > :::::: branch date: 3 hours ago > > > > > :::::: commit date: 6 weeks ago > > > > > config: arm-randconfig-r006-20200614 (attached as .config) > > > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project c669a1ed6386d57a75a602b53266466dae1e1d84) > > > > > reproduce (this is a W=1 build): > > > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > > > chmod +x ~/bin/make.cross > > > > > # install arm cross compiling tool for clang build > > > > > # apt-get install binutils-arm-linux-gnueabi > > > > > git checkout 39d010504e6b4485d7ceee167743620dd33f4417 > > > > > # save the attached .config to linux build tree > > > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm > > > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > > Reported-by: kernel test robot > > > > > > > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > > > > > > > >> net/sched/sch_fq.c:966:12: warning: stack frame size of 1400 bytes in function 'fq_dump' [-Wframe-larger-than=] > > > > > static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) > > > > > ^ > > > > > > > > > > > > This looks like a bug in CLANG on ARM, there is no way fq_dump() could > > > > consume so much stack space. > > > > > > You can use > > > https://github.com/ClangBuiltLinux/frame-larger-than > > > to help debug these. You might be surprised who's doing larger stack > > > allocations than expected. > > > > What is wrong with scripts/checkstack.pl ? > > After using CLANG on x86 I get : > > $ objdump -d net/sched/sch_fq.o | scripts/checkstack.pl > 0x00001136 fq_change [sch_fq.o]: 192 > 0x00000016 __direct_call_Qdisc_enqueue1 [sch_fq.o]: 112 > 0x000019e0 fq_dump_stats [sch_fq.o]: 112 > 0x00001b43 fq_dump_stats [sch_fq.o]: 112 > > So CLANG on x86 seems fine. > > I said : " this looks like a bug in CLANG on ARM" This is a randconfig, so some option is turning on something that's causing excessive stack usage with your patch on ARM. Building who knows what config with x86 and claiming it works doesn't really cut it. You looked at fq_dump and claimed it should be fine. Did you verify each called function that was inlined? And the issue with checkstack is it tells you the depth, but not *what variables* and from which inlined function may be the cause. > > > > > > > > > > > > > > > > > > > > > > > > > 1 warning generated. > > > > > > > > > > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39d010504e6b4485d7ceee167743620dd33f4417 > > > > > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > > > > git remote update linus > > > > > git checkout 39d010504e6b4485d7ceee167743620dd33f4417 > > > > > vim +/fq_dump +966 net/sched/sch_fq.c > > > > > > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 965 > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 @966 static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 967 { > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 968 struct fq_sched_data *q = qdisc_priv(sch); > > > > > 48872c11b77271 Eric Dumazet 2018-11-11 969 u64 ce_threshold = q->ce_threshold; > > > > > 39d010504e6b44 Eric Dumazet 2020-05-01 970 u64 horizon = q->horizon; > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 971 struct nlattr *opts; > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 972 > > > > > ae0be8de9a53cd Michal Kubecek 2019-04-26 973 opts = nla_nest_start_noflag(skb, TCA_OPTIONS); > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 974 if (opts == NULL) > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 975 goto nla_put_failure; > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 976 > > > > > 65c5189a2b57b9 Eric Dumazet 2013-11-15 977 /* TCA_FQ_FLOW_DEFAULT_RATE is not used anymore */ > > > > > 65c5189a2b57b9 Eric Dumazet 2013-11-15 978 > > > > > 48872c11b77271 Eric Dumazet 2018-11-11 979 do_div(ce_threshold, NSEC_PER_USEC); > > > > > 39d010504e6b44 Eric Dumazet 2020-05-01 980 do_div(horizon, NSEC_PER_USEC); > > > > > 48872c11b77271 Eric Dumazet 2018-11-11 981 > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 982 if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 983 nla_put_u32(skb, TCA_FQ_FLOW_PLIMIT, q->flow_plimit) || > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 984 nla_put_u32(skb, TCA_FQ_QUANTUM, q->quantum) || > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 985 nla_put_u32(skb, TCA_FQ_INITIAL_QUANTUM, q->initial_quantum) || > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 986 nla_put_u32(skb, TCA_FQ_RATE_ENABLE, q->rate_enable) || > > > > > 76a9ebe811fb3d Eric Dumazet 2018-10-15 987 nla_put_u32(skb, TCA_FQ_FLOW_MAX_RATE, > > > > > 76a9ebe811fb3d Eric Dumazet 2018-10-15 988 min_t(unsigned long, q->flow_max_rate, ~0U)) || > > > > > f52ed89971adbe Eric Dumazet 2013-11-15 989 nla_put_u32(skb, TCA_FQ_FLOW_REFILL_DELAY, > > > > > f52ed89971adbe Eric Dumazet 2013-11-15 990 jiffies_to_usecs(q->flow_refill_delay)) || > > > > > 06eb395fa9856b Eric Dumazet 2015-02-04 991 nla_put_u32(skb, TCA_FQ_ORPHAN_MASK, q->orphan_mask) || > > > > > 77879147a3481b Eric Dumazet 2016-09-19 992 nla_put_u32(skb, TCA_FQ_LOW_RATE_THRESHOLD, > > > > > 77879147a3481b Eric Dumazet 2016-09-19 993 q->low_rate_threshold) || > > > > > 48872c11b77271 Eric Dumazet 2018-11-11 994 nla_put_u32(skb, TCA_FQ_CE_THRESHOLD, (u32)ce_threshold) || > > > > > 583396f4ca4d6e Eric Dumazet 2020-03-16 995 nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log) || > > > > > 39d010504e6b44 Eric Dumazet 2020-05-01 996 nla_put_u32(skb, TCA_FQ_TIMER_SLACK, q->timer_slack) || > > > > > 39d010504e6b44 Eric Dumazet 2020-05-01 997 nla_put_u32(skb, TCA_FQ_HORIZON, (u32)horizon) || > > > > > 39d010504e6b44 Eric Dumazet 2020-05-01 998 nla_put_u8(skb, TCA_FQ_HORIZON_DROP, q->horizon_drop)) > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 999 goto nla_put_failure; > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1000 > > > > > d59b7d8059ddc4 Yang Yingliang 2014-03-12 1001 return nla_nest_end(skb, opts); > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1002 > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1003 nla_put_failure: > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1004 return -1; > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1005 } > > > > > afe4fd062416b1 Eric Dumazet 2013-08-29 1006 > > > > > > > > > > :::::: The code at line 966 was first introduced by commit > > > > > :::::: afe4fd062416b158a8a8538b23adc1930a9b88dc pkt_sched: fq: Fair Queue packet scheduler > > > > > > > > > > :::::: TO: Eric Dumazet > > > > > :::::: CC: David S. Miller > > > > > > > > > > --- > > > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > _______________________________________________ > > > > > kbuild mailing list -- kbuild@lists.01.org > > > > > To unsubscribe send an email to kbuild-leave@lists.01.org > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > > > > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/CANn89i%2Bs%3DoFTq6KFhT0z1CReQPZCGoEPShEFHVvXAmC9sUDH7g%40mail.gmail.com. > > > > > > > > > > > > -- > > > Thanks, > > > ~Nick Desaulniers > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/CANn89iLnmKaa30tPoyK_GrJr-_ALYBwjcJ0pBcvmckA9PAvrgA%40mail.gmail.com. -- Thanks, ~Nick Desaulniers