From owner-freebsd-hackers@freebsd.org Sun Jun 24 09:56:21 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D7C61021CC7 for ; Sun, 24 Jun 2018 09:56:21 +0000 (UTC) (envelope-from lakhanshiva@gmail.com) Received: from mail-ot0-f174.google.com (mail-ot0-f174.google.com [74.125.82.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B09E782485 for ; Sun, 24 Jun 2018 09:56:20 +0000 (UTC) (envelope-from lakhanshiva@gmail.com) Received: by mail-ot0-f174.google.com with SMTP id a5-v6so12004853otf.12 for ; Sun, 24 Jun 2018 02:56:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=M+wDMw26gF2SCJzxwMrkobtvLyGr7xRMDbIdA8BBD3w=; b=seQVfM0SyFsTxJj2F1ieyTYLJoVF8I0rJCSg9xTsap20YkfQ9AeUX5NzfW7Z4e9TBv NgLmRsCgzChtVNItOSQNM2fQd+3k7U30H37KUwlnDnNnYiR6f4o6g3QtBkiS5l+1Th7o /mwEba8ZutCwvgn38XMt3jLdk/7wDVkOVOgNCcTgPXTTKSpuEjmj4wVXDlRmIwp2Tj2O J4AG/8fidmfjwI4+A2iNFktVaWDwa+IEYHF1iAa3LxeOPfw1D3cyfPMnrenCU7Z/NnNo PB0b1iBFe+cPpPYC6f6MF0I5E9o+Xit1h7aZR3ZAq375odSo1l4h8uqHgMeYmbiIvSN2 /4hQ== X-Gm-Message-State: APt69E3xUanV1W+jqEbsRyE78dgFcZZycGqZy1F7bnXawT811gNagE9O Hyl8nnErqe4McovRxPnlOV83EqqU X-Google-Smtp-Source: ADUXVKL2gDWZ8WVRgsgzcmu3lQJexedmCOluR5pyCi6lGNt7xqNp2narl5OEoo8YQ1X0gbahYefZXA== X-Received: by 2002:a9d:4d85:: with SMTP id u5-v6mr4631240otk.157.1529834174373; Sun, 24 Jun 2018 02:56:14 -0700 (PDT) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id q205-v6sm5556597oia.7.2018.06.24.02.56.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jun 2018 02:56:14 -0700 (PDT) Received: by mail-oi0-f48.google.com with SMTP id c6-v6so9891239oiy.0 for ; Sun, 24 Jun 2018 02:56:13 -0700 (PDT) X-Received: by 2002:aca:3002:: with SMTP id w2-v6mr347281oiw.29.1529834173847; Sun, 24 Jun 2018 02:56:13 -0700 (PDT) MIME-Version: 1.0 From: Lakhan Shiva Kamireddy Date: Sun, 24 Jun 2018 15:26:02 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: arc diff stuck To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2018 09:56:21 -0000 Hi, I am new to using phabricator. I am working with Git version control. I set up arcanist cli to be used with phabricator. I was able to successfully create differential revision. After this i was also able to update the differential revision. But now arc is stuck on this step: https://reviews.freebsd.org/api/differential.querydiffs Please find below the trace of my command... arc diff 51fbc9d~ --update D15979 --trace ARGV '/usr/share/arcanist/bin/../scripts/arcanist.php' 'diff' '51fbc9d~' '--update' 'D15979' '--trace' LOAD Loaded "phutil" from "/usr/share/libphutil/src". LOAD Loaded "arcanist" from "/usr/share/arcanist/src". Config: Reading user configuration file "/home/lakhanshiva/.arcrc"... Config: Did not find system configuration at "/etc/arcconfig". Working Copy: Reading .arcconfig from "/home/lakhanshiva/freebsd/freebsd/.arcconfig". Working Copy: Path "/home/lakhanshiva/freebsd/freebsd" is part of `git` working copy "/home/lakhanshiva/freebsd/freebsd". Working Copy: Project root is at "/home/lakhanshiva/freebsd/freebsd". Config: Did not find local configuration at "/home/lakhanshiva/freebsd/freebsd/.git/arc/config". >>> [0] user.whoami() >>> [1] https://reviews.freebsd.org/api/user.whoami <<< [1] 3,649,897 us <<< [0] 3,654,484 us >>> [2] $ git diff --no-ext-diff --no-textconv --raw 'HEAD' -- >>> [3] $ git ls-files --others --exclude-standard <<< [2] 188,299 us <<< [3] 300,742 us >>> [4] $ git diff-files --name-only <<< [4] 69,717 us >>> [5] diff.didCollectChanges <<< [5] 255 us >>> [6] differential.query() >>> [7] https://reviews.freebsd.org/api/differential.query <<< [7] 1,449,609 us <<< [6] 1,450,057 us >>> [8] differential.getcommitmessage() >>> [9] https://reviews.freebsd.org/api/differential.getcommitmessage <<< [9] 1,102,123 us <<< [8] 1,102,548 us >>> [10] differential.parsecommitmessage() >>> [11] https://reviews.freebsd.org/api/differential.parsecommitmessage <<< [11] 754,348 us <<< [10] 754,861 us >>> [12] diff.didBuildMessage <<< [12] 108 us >>> [13] $ git rev-parse --git-dir <<< [13] 5,680 us >>> [14] $ git rev-parse 'HEAD' <<< [14] 13,185 us >>> [15] $ git merge-base '51fbc9d~' '2cb967a59820bf12d5427cf8ded41ecfe5d88659' <<< [15] 17,679 us >>> [16] $ git log --first-parent --format=medium 'e1b82c05e1a8592ad82c34cafb49dd95b008e45a'..'2cb967a59820bf12d5427cf8ded41ecfe5d88659' <<< [16] 8,342 us >>> [17] differential.querydiffs() >>> [18] https://reviews.freebsd.org/api/differential.querydiffs Please let me know if you know the reason. Thanks, Lakhan From owner-freebsd-hackers@freebsd.org Sun Jun 24 15:59:37 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D7291003DA9 for ; Sun, 24 Jun 2018 15:59:37 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc12.plala.or.jp (msc12.plala.or.jp [60.36.166.22]) by mx1.freebsd.org (Postfix) with ESMTP id BE8C78E3D0 for ; Sun, 24 Jun 2018 15:59:36 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([2400:4050:9320:7a00::8]) by msc14.plala.or.jp with ESMTP id <20180624155447.CIZS1307.msc14.plala.or.jp@localhost> for ; Mon, 25 Jun 2018 00:54:47 +0900 Date: Mon, 25 Jun 2018 00:54:42 +0900 (JST) Message-Id: <20180625.005442.2218575156743153026.ish@amail.plala.or.jp> To: freebsd-hackers@freebsd.org Subject: Why is not wildcards unfolded as expected if LANG is ja_JP.UTF-8 From: Masachika ISHIZUKA X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac14; Mon, 25 Jun 2018 00:54:47 +0900 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2018 15:59:37 -0000 Hi. I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'. For example, % mkdir test % cd test % foreach a (a b c d e A B C D E) foreach? touch $a foreach? end % ls a A b B c C d D e E % setenv LANG ja_JP.UTF-8 % ls [b-d] b B c C d <=== It's not good. % env LANG=ja_JP.UTF-8 ls [b-d] b B c C d <=== It's not good. % env LANG=C ls [b-d] B C b c d <=== It's not good. % setenv LANG C % ls [b-d] b c d <=== It's good. % env LANG=ja_JP.UTF-8 ls [b-d] b c d <=== It's good. % env LANG=C ls [b-d] b c d <=== It's good. % This happens on 12-current and 11.2-RC3. I'm using tcsh but the same when changed to bash. -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Sun Jun 24 17:56:45 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B17CE1006EE5 for ; Sun, 24 Jun 2018 17:56:45 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E83BE71330 for ; Sun, 24 Jun 2018 17:56:44 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from vsuiko.mahoroba.org (vsuiko.mahoroba.org [IPv6:2001:2f0:104:8010:a00:27ff:feb0:c2e]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.15.2/8.15.2) with ESMTPSA/inet6 id w5OHuO04044441 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Jun 2018 02:56:29 +0900 (JST) (envelope-from ume@mahoroba.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mahoroba.org; s=20081103; t=1529862989; bh=cBdGuezLWy9ysMap8KK6D8Hf0C6k/a+ALK3J7bK7ZcM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=uPiLoYVwVNi/jP9LWqL5GZ5zzpN4mQhJj8qKaUOD8mc6quf3lVCu4VAl/c95fsn5g CIAlEtwCzulE8Qfmhsu3TdIthnlDNCjrZ+QNRFwpaG4ECS0vjOz8bwpke9DHk0l3kq 8EpeTievu8MPfpsvMv5jMhafryAMIxpQTNoVEgb8= Date: Mon, 25 Jun 2018 02:56:24 +0900 Message-ID: From: Hajimu UMEMOTO To: Masachika ISHIZUKA Cc: freebsd-hackers@freebsd.org Subject: Re: Why is not wildcards unfolded as expected if LANG is ja_JP.UTF-8 In-Reply-To: <20180625.005442.2218575156743153026.ish@amail.plala.or.jp> References: <20180625.005442.2218575156743153026.ish@amail.plala.or.jp> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/26.1 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 11.2-STABLE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.mahoroba.org [IPv6:2001:2f0:104:8010:0:0:0:1]); Mon, 25 Jun 2018 02:56:29 +0900 (JST) X-Virus-Scanned: clamav-milter 0.100.0 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on asuka.mahoroba.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2018 17:56:45 -0000 Hi, >>>>> On Mon, 25 Jun 2018 00:54:42 +0900 (JST) >>>>> Masachika ISHIZUKA said: ish> I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'. ish> For example, It seems to me as expected behavior. ish> % ls ish> a A b B c C d D e E ish> % setenv LANG ja_JP.UTF-8 ish> % ls [b-d] ish> b B c C d <=== It's not good. ish> % env LANG=ja_JP.UTF-8 ls [b-d] ish> b B c C d <=== It's not good. ish> % env LANG=C ls [b-d] ish> B C b c d <=== It's not good. Since the expansion of '[]' is done by the shell (tcsh) itself, setting LANG by env(1) doesn't have an influence on the expansion. ish> This happens on 12-current and 11.2-RC3. I'm using tcsh but the same ish> when changed to bash. It's because the recent FreeBSD supports collation. If you don't like the behavior, you may want to set LC_COLLATE to C. % echo $LANG ja_JP.UTF-8 % ls a A b B c C d D e E % env LANG=ja_JP.UTF-8 tcsh -c "ls [b-d]" b B c C d % env LANG=C tcsh -c "ls [b-d]" b c d % env LANG=ja_JP.UTF-8 LC_COLLATE=C tcsh -c "ls [b-d]" b c d Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ From owner-freebsd-hackers@freebsd.org Mon Jun 25 00:11:40 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C8D101AAF9 for ; Mon, 25 Jun 2018 00:11:40 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc12.plala.or.jp (msc12.plala.or.jp [60.36.166.22]) by mx1.freebsd.org (Postfix) with ESMTP id 04B768288D for ; Mon, 25 Jun 2018 00:11:39 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([126.94.59.113]) by msc13.plala.or.jp with ESMTP id <20180625001012.CLGZ23662.msc13.plala.or.jp@localhost> for ; Mon, 25 Jun 2018 09:10:12 +0900 Date: Mon, 25 Jun 2018 09:10:00 +0900 (JST) Message-Id: <20180625.091000.964476672377442079.ish@amail.plala.or.jp> To: freebsd-hackers@freebsd.org Subject: Re: Why is not wildcards unfolded as expected if LANG is ja_JP.UTF-8 From: Masachika ISHIZUKA In-Reply-To: References: <20180625.005442.2218575156743153026.ish@amail.plala.or.jp> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac13; Mon, 25 Jun 2018 09:10:12 +0900 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 00:11:41 -0000 >> I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'. >> [snip] >> >> This happens on 12-current and 11.2-RC3. I'm using tcsh but the same >> when changed to bash. > > It's because the recent FreeBSD supports collation. > If you don't like the behavior, you may want to set LC_COLLATE to C. Thank you very much. It solved by setting LC_LOCCATE to C. -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Mon Jun 25 00:15:22 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB6BF101ADEC for ; Mon, 25 Jun 2018 00:15:22 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc12.plala.or.jp (msc12.plala.or.jp [IPv6:2400:7800:0:502e::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9195282B0E for ; Mon, 25 Jun 2018 00:15:21 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([2400:4050:9320:7a00::8]) by msc12.plala.or.jp with ESMTP id <20180625001519.CPFN4065.msc12.plala.or.jp@localhost> for ; Mon, 25 Jun 2018 09:15:19 +0900 Date: Mon, 25 Jun 2018 09:15:10 +0900 (JST) Message-Id: <20180625.091510.1008882063345259665.ish@amail.plala.or.jp> To: freebsd-hackers@freebsd.org Subject: Re: Why is not wildcards unfolded as expected if LANG is ja_JP.UTF-8 From: Masachika ISHIZUKA In-Reply-To: <20180625.091000.964476672377442079.ish@amail.plala.or.jp> References: <20180625.005442.2218575156743153026.ish@amail.plala.or.jp> <20180625.091000.964476672377442079.ish@amail.plala.or.jp> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac12; Mon, 25 Jun 2018 09:15:19 +0900 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 00:15:23 -0000 >>> I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'. >>> > [snip] >>> >>> This happens on 12-current and 11.2-RC3. I'm using tcsh but the same >>> when changed to bash. >> >> It's because the recent FreeBSD supports collation. >> If you don't like the behavior, you may want to set LC_COLLATE to C. > > Thank you very much. > > It solved by setting LC_LOCCATE to C. Sorry, the above is LC_COLLATE misspelling. -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Wed Jun 27 06:53:26 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A327B100A521; Wed, 27 Jun 2018 06:53:26 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 276C197878; Wed, 27 Jun 2018 06:53:26 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id l23-v6so2411630edq.0; Tue, 26 Jun 2018 23:53:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=/dYAofooBNKaAYt8uPkt8XXQKDobjzOLNBe7CQXixn4=; b=uKFhYp6Ds1PWX+mWBvTGu0F+CVtpMerCJXWC0Sl9JlKVIeXoOjV1EL+AeUddv1f6k6 GMtfhATwZdOrD9gkNkSZI8kyZhC0Jj2z2Lq8ww9q7U3aT7nZjNXT/nhv8CvXgRRYQS2g oAuHJHe3FoFPWqMJ4euFQGKPBG16sK/AsEQjRfLyRkspS5mCms7tqAmoVVBMyEse0Vez 8M1Pljrdck23eibmFLGTOAd+lq5Nv3u6APhYCqWVeZTiSGQo+wRuMOcTW6TtuuruMe9p wQTKAMX1TN3fwJuVb4dWt4sbg4I4cUuVjjv2D0Y0zCestF/a6aWrp7pVX2P3SRCK0k7z /Hhw== X-Gm-Message-State: APt69E1NOEpn+KsgYetGeAf2Np/1t99E1lCvWpesgT0H01rraYzuifZU 5tVB4ktevdZn+T2jYYd3tjBS4PvY X-Google-Smtp-Source: AAOMgpftmax7ut9E+pOn4R/nHidfJhC6Cl60DntstbPpZkdBwLg6IRe7L/1kulFIsganrDClYBwhlQ== X-Received: by 2002:a50:8ad5:: with SMTP id k21-v6mr4476772edk.36.1530082399580; Tue, 26 Jun 2018 23:53:19 -0700 (PDT) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com. [209.85.208.46]) by smtp.gmail.com with ESMTPSA id l37-v6sm1669154edc.49.2018.06.26.23.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 23:53:19 -0700 (PDT) Received: by mail-ed1-f46.google.com with SMTP id g12-v6so2403075edi.9; Tue, 26 Jun 2018 23:53:19 -0700 (PDT) X-Received: by 2002:a50:b16f:: with SMTP id l44-v6mr4403117edd.306.1530082399305; Tue, 26 Jun 2018 23:53:19 -0700 (PDT) MIME-Version: 1.0 From: Pratyush Yadav Date: Wed, 27 Jun 2018 12:22:42 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Can bus_dmamap_unload() be called before the load completes? To: freebsd-hackers@freebsd.org Cc: freebsd-arch@freebsd.org, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Edward Napierala , Akshay Jaggi Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 06:53:26 -0000 Hi everyone, I am currently working on an alternate bus_dma(9) implementation for use with the Xen drivers [0]. I have a question regarding how the bus_dma(9) interface is expected to be used: If the load is deferred because of a shortage of resources, is it "legal" to call unload before the load completes? In my implementation, if unload is called while the load is waiting for resources, it would result in a segmentation fault and leak memory. Do I need to handle that possibility, or is it ok to assume that unload won't be called before the load completes? Regards, Pratyush Yadav [0] https://wiki.freebsd.org/SummerOfCode2018Projects/ImportXenbus_dmaFromOpenBSD From owner-freebsd-hackers@freebsd.org Wed Jun 27 12:28:22 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A19010215CD for ; Wed, 27 Jun 2018 12:28:22 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B00B37B3B4 for ; Wed, 27 Jun 2018 12:28:21 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id r16-v6so1158953oie.3 for ; Wed, 27 Jun 2018 05:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Cw+7/F5A1wfHkX+KplG5a0v7WgzthX2tuCmEPlo2NZw=; b=oBe2mUfvNjTlox3rbs4E59vZHxyYrOcbz/j6frLzU99ltAEuliDENPd/NpZVvXK0ho IJIWtLtagMkC5dYLjQ13x1YxVMdj+ijZeWkz8T2ROiuehwyX8XWgYYYMthzhQUs/wPXC kkPmo9Flm6wbK2mmUgKeIutqbm2pXd8a7L4Q1/BjNPYZa09W+uB5PO7x309sVNq6EUXL 9hhTTVmjXmDuQxZCSnamievy6/QTgiFNA60ceGdCwj4dApG0gTV0ycqfl6VjjOKrHU46 jT8n29d/MsPDw1QYLHGzE2+X93B2qoaCo4Pu9r186l9lsw0DuZYyw4W9seYHGJiNT4QD 2kag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Cw+7/F5A1wfHkX+KplG5a0v7WgzthX2tuCmEPlo2NZw=; b=HUfiQmSKUUTBWdSdikUCe6Dto1ieNuYiEPGU/rwf7Hs3WNMIDf3+EcGMMwH40oy6xJ fLRb0hvOU2t7HDcwOHHBm3CqOxn21WCwU8cG8cPGIfxDB3Iac7vLivIxtkX72DXlZ9qd xK7TtXuzeUWnP+u5tp84kc/ngOlyV7M95NanXjVitkMoeICD9Ys5GSspVaj42O/iqBcG 1pbXZFYTOgjkbVP3z5rCDNSH63sEadnlsWo7TyiZGugLWa5bsOsEqNzQr7tRt6penJCZ wd+nC6krBv6XXCmThe8F6+5Yq6W5mU6uojbcglCBNZLHuorg+iBiJXPbio+RuFwx2tQT AjrA== X-Gm-Message-State: APt69E1BXxTIAAUonJs9ZZlgCygoDGqc9e8/C5dHUubq3NzYJ6h1ssne vcHubfl9c6qnH856wXrxrxadC+pNjezh62TlDrZYgw== X-Google-Smtp-Source: AAOMgpdz4EdFxpdwp+lKUcLFj+qK5dxCpTg6DVFV1dkyaVfL6k31zotHqDPaPH9N85bIoFdQ6S1IOdMXB7rwgJucSj4= X-Received: by 2002:aca:4e4d:: with SMTP id c74-v6mr3046363oib.16.1530102500611; Wed, 27 Jun 2018 05:28:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:73cf:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 05:28:20 -0700 (PDT) From: Steevan Rodrigues Date: Wed, 27 Jun 2018 17:58:20 +0530 Message-ID: Subject: high CPU usage in FreeBSD for a PCIe card driver To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary="00000000000004f1b9056f9ec054" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 12:28:22 -0000 --00000000000004f1b9056f9ec054 Content-Type: text/plain; charset="UTF-8" Hi I come from Linux background and new to FreeBSD. I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a card . The card can process data at a rate of 30 to 50 Gbps . However, I see very high CPU usage even when I run a single threaded user side application which uses this card . I ran hotkernel script from Dtrace toolkit. A portion of the output is given in the attached file dtraceDiff.txt. Here I see that lock_delay seems to be the reason for high CPU usage. Looks like it comes from mutex locks This driver uses mutex locks ( mtx_lock). The CPU usage is very high on a multicore (Xeon CPU) server node than a dual core (Intel i3) Desktop . It shows 30 to 40 % CPU usage on a Intel i3 ( 2 core 4 threads) and 60 to 70% CPU usage on a Xeon CPU with 12 core (24 threads) for same output data rate . I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any pointers or suggestions welcome. Using FreeBSD 11.1 Release Thanks Steev --00000000000004f1b9056f9ec054 Content-Type: text/plain; charset="US-ASCII"; name="dtraceDiff.txt" Content-Disposition: attachment; filename="dtraceDiff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jix3g9dk0 LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpDUFUg dXNhZ2UgZGV0YWlscyBvbiBhICAxMiBjb3JlIDI0IHRocmVhZCBzZXJ2ZXIgUEMuIAoKcGFydCBv ZiB0aGUgcGVybCBob3RrZXJuZWwgIG91dHB1dCAKCmtlcm5lbGBmcmVlICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMTQgICAwLjIlCmtlcm5lbGBfc3hfc2xv Y2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MTUgICAwLjMlCmtl cm5lbGBkZXZfcmVsdGhyZWFkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0 MzUgICAwLjMlCmtlcm5lbGBkZXZ2bl9yZWZ0aHJlYWQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDE4NDIgICAwLjMlCmtlcm5lbGBfbXR4X2xvY2tfc3Bpbl9jb29raWUgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDIwNTkgICAwLjQlCmtlcm5lbGBjb3B5aW4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxNjQgICAwLjQlCmtlcm5lbGBhbWQ2 NF9zeXNjYWxsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyMzUgICAwLjQl Cmtlcm5lbGBfX210eF9sb2NrX3NwaW5fZmxhZ3MgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDM1NjYgICAwLjYlCmtlcm5lbGBiemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDQ4ODkgICAwLjklCmtlcm5lbGBfX210eF9sb2NrX3NsZWVwICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDkzMjMgICAxLjclCmtlcm5lbGBhY3BpX2NwdV9pZGxl ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTExNjYgICAyLjAlCmtlcm5lbGBw bWFwX2V4dHJhY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc0OTEgICAz LjElCmtlcm5lbGBzcGlubG9ja19leGl0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgNjQ4NTAgIDExLjUlCmtlcm5lbGBjcHVfaWRsZSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAxMzQ2MTcgIDIzLjklCmtlcm5lbGBsb2NrX2RlbGF5ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAyNjMzMzAgIDQ2LjglCgotLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpDUFUgdXNhZ2UgZGV0YWlscyBvbiBh ICAyIGNvcmUgNCB0aHJlYWQgSW50ZWwgaTMgYmFzZWQgRGVza3RvcCBQQy4gCgpwYXJ0IG9mIHRo ZSBwZXJsIGhvdGtlcm5lbCAgb3V0cHV0IAoKCmtlcm5lbGAweGZmZmZmZmZmODAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1NTggICAwLjYlCmtlcm5lbGBjb3B5b3V0ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1OTIgICAwLjYlCjB4ZmZm ZmZmZmY4MjIzNjhhMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2Mzkg ICAwLjclCmtlcm5lbGBhbWQ2NF9zeXNjYWxsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA2ODMgICAwLjclCmtlcm5lbGBfX210eF91bmxvY2tfZmxhZ3MgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA3MjggICAwLjglCmtlcm5lbGBjb3B5aW4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMTEgICAxLjQlCmtlcm5lbGBiemVybyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MzQgICAxLjUlCmtl cm5lbGBwbWFwX2V4dHJhY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2 MTUgICAxLjclCmtlcm5lbGBsb2NrX2RlbGF5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDIzMjkgICAyLjQlCjB4ZmZmZmZmZmY4MjJiMGI1ZSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDI1MjggICAyLjYlCmtlcm5lbGBzcGlubG9ja19leGl0ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA5NTAgIDIxLjglCmtlcm5lbGBjcHVf aWRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgxMjQgIDUwLjIl CgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0K --00000000000004f1b9056f9ec054-- From owner-freebsd-hackers@freebsd.org Wed Jun 27 14:11:15 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28811026373 for ; Wed, 27 Jun 2018 14:11:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80EA07FA32 for ; Wed, 27 Jun 2018 14:11:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id 128-v6so7749412itf.1 for ; Wed, 27 Jun 2018 07:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=w+0Dnm4e4H5rmeNxrtYatQt5hAWmhCOWNFUWxRoQHPY=; b=qyILUuNphlhanOyiZIzHUgpOyUDF/q/hoWfgGg5M1xpKGmvkKk6W0LQLyzS1UI6wVc M8Ti9RVcVJewqs+5xohN8QZTX02aJbNZYGn0kYJYDVBEggoyl82Z2xQYRPHrmBrmVtoT knUtOCzrX9pSvz1t+JYaPEC5c+nGn7Oo/LjSn6QDx4qmXr9nis5q32MEMqH8vJSOEA2l TVKlq1/Zx3cAdMPatO+pDdRD9k3jMUuT6zTBYdTA2A0/0+TyOX8cJUBbU9UUTelfGlWA Hv7iiDS0jaanjb7a1CD1B57hkTF0RUQab3T3tYNpKPEkXdRIE0qV00kz72NqifXEBC5/ 5pEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=w+0Dnm4e4H5rmeNxrtYatQt5hAWmhCOWNFUWxRoQHPY=; b=SqOZRSKmqAds5F1Tn/Eip1skU/1/A6Wwli0yi6BCPEfepbuD8ChmdUxDnuaEu3gLcu ua35kJDfwBhYUBbUVQzwyaiv4ZcNkOsSUd6KIOa+xYfhycKag0Us7BpccNkSxzjCVpVe voKDdW5TNVIUeGK/thl7EoZzz71GFLtQgcUAToglsGzqhSzq+MsH8g4fmyLYOVE5LUTX s9J/Z0l2xHpg0yrLLG8lZsO0TpHfEed4cpa+D8+Lpw9rt8oGQiC0yLC7ArLhWWzMslpl bCrSczbautyUAJlnrDhyPRIWFypTC5ApWhhMWVcru3AHv80gKjttT2N2VPstykkhH14R MXvw== X-Gm-Message-State: APt69E3I/UG2E+e8tcupRgsxIcLIZSdWsUstA1GKuak4M98kL9Dz4ura D9UPqdAdLi5s5lXoVE3mv96PrL8LgDq13Gpq+rR6QA== X-Google-Smtp-Source: ADUXVKIf/FOyeKasvUF53ArG8aTx7qedqb1i8a8NRqYsisyDHhskO0+OKn4tkaJ3gFNM8aPq392QVS0xIz44aJYFmIQ= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr5015107itd.73.1530108673840; Wed, 27 Jun 2018 07:11:13 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 07:11:13 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: From: Warner Losh Date: Wed, 27 Jun 2018 08:11:13 -0600 X-Google-Sender-Auth: SzktL4Xr6Mdc3ehxYfGylkIF5Ms Message-ID: Subject: Re: high CPU usage in FreeBSD for a PCIe card driver To: Steevan Rodrigues Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 14:11:15 -0000 No. It's not from mtx_lock. It's likely from lock contention. Since the list ate the attachment, I can't check for sure, but high CPU usage in locking primitives is a classic sign of poor lock design leading to contention. Warner On Wed, Jun 27, 2018 at 6:28 AM, Steevan Rodrigues wrote: > Hi > > I come from Linux background and new to FreeBSD. > > I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a > card . The card can process data at a rate of 30 to 50 Gbps . However, I > see very high CPU usage even when I run a single threaded user side > application which uses this card . > > I ran hotkernel script from Dtrace toolkit. A portion of the output is > given in the attached file dtraceDiff.txt. Here I see that lock_delay > seems to be the reason for high CPU usage. Looks like it comes from mutex > locks > > This driver uses mutex locks ( mtx_lock). > > The CPU usage is very high on a multicore (Xeon CPU) server node than a > dual core (Intel i3) Desktop . > > It shows 30 to 40 % CPU usage on a Intel i3 ( 2 core 4 threads) and 60 to > 70% CPU usage on a Xeon CPU with 12 core (24 threads) for same output > data rate . > > I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any > pointers or suggestions welcome. > > Using FreeBSD 11.1 Release > > Thanks > > Steev > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > From owner-freebsd-hackers@freebsd.org Wed Jun 27 16:38:26 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0CBE102C028 for ; Wed, 27 Jun 2018 16:38:26 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: from mail-ot0-x235.google.com (mail-ot0-x235.google.com [IPv6:2607:f8b0:4003:c0f::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31605851A1 for ; Wed, 27 Jun 2018 16:38:26 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: by mail-ot0-x235.google.com with SMTP id n24-v6so2883177otl.9 for ; Wed, 27 Jun 2018 09:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RSkWBMoHqYGlnZvJMGzTO6ABFkoUnG+5WDdTWvLYZSU=; b=KE4ab8yeeprN/PRwwqWxhLdLRtDXDpuOm8GFN8Yd3rUZFpdGPoyFuTOfF4LrGiHNiS gpPmplfLPyD9B6rPx3JadjQorTQSm6BB6hnuogkSsEp8/ubB7eCgrN4Lmmzn8dq3Wuvy C+YtkkbTzEcOmLrnCEvFj0JRJMp1x+GoFxFAJqDgXzkn7lKX1VCTcOTDJ2f++VYtf9F5 +cqFP7M71lGz70ghycOP0+8QCA83Gaxfjp7jhQBFmBpJQ3V37HaqbyW0JIdKthdJpt8Z MZ0IJQ39U4zhmHEVMYygXjdwxahrODH0+XtW09HKl1xtezmQXTBlnG2Er744FJHgEELI tV1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RSkWBMoHqYGlnZvJMGzTO6ABFkoUnG+5WDdTWvLYZSU=; b=YnqrYQxZeBtX31iweeAwQetoF8fdgNMFepYRoVtuoFSgEzbiJimvAvO3bfCuZ2cbo7 2df8MZ6FHu70HQfN/lUx1NEdRtUrIGmJS/EZ67xhgC7WIdh8CXhWmUjbaoB+d2kSC5VF NWDJF6eRcvON65JOV2VoN1uc82r3R4uBEuwXZY/1Obg5VTy3AAQQEAzyGfqu0jtVvYis 5AmZ61iPVkDYA0nfYHCG9VJKzlHlvjRmftBuKtMUgOZ/kEl4ZmSNSRVRkvcS3hUKY6Bu ewyd7Mu+NUM/EQpZtHiEpjuJsinQC5o7xtr84AK2vquVyvFhF+7+oFlRlm5ZkuQV3QQg Rmug== X-Gm-Message-State: APt69E3qq/JlZN+p4BQrd08T6bfGivk1XWQZjW1UgXY52dXM2NhsfnDD ZxVol/fRqzs/5BUBBxWBtq7qmKlUQJ08gyMq3cy4Ug== X-Google-Smtp-Source: AAOMgpfyOCV9Sq+w7Q2HpqjQGGk+AOxCQ3YRXvuBIeE7IBsdN1j365i4SsOTjHDnlhqaUidWKBQ1zkq84Yap9I8ZAFs= X-Received: by 2002:a9d:4a49:: with SMTP id d9-v6mr2452821otj.374.1530117505234; Wed, 27 Jun 2018 09:38:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:73cf:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 09:38:24 -0700 (PDT) In-Reply-To: References: From: Steevan Rodrigues Date: Wed, 27 Jun 2018 22:08:24 +0530 Message-ID: Subject: Re: high CPU usage in FreeBSD for a PCIe card driver To: Warner Losh Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 16:38:26 -0000 Thank you for the quickly reply. The same driver gives pretty good performance with low CPU usage in kernel mode. I see high CPU usage only for user mode application. Here is the Dtrace hotkernel output details provided in the earlier attachment. CPU usage details on a 12 core 24 thread server PC. part of the perl hotkernel output kernel`free 1314 0.2% kernel`_sx_slock 1415 0.3% kernel`dev_relthread 1435 0.3% kernel`devvn_refthread 1842 0.3% kernel`_mtx_lock_spin_cookie 2059 0.4% kernel`copyin 2164 0.4% kernel`amd64_syscall 2235 0.4% kernel`__mtx_lock_spin_flags 3566 0.6% kernel`bzero 4889 0.9% kernel`__mtx_lock_sleep 9323 1.7% kernel`acpi_cpu_idle 11166 2.0% kernel`pmap_extract 17491 3.1% kernel`spinlock_exit 64850 11.5% kernel`cpu_idle 134617 23.9% kernel`lock_delay 263330 46.8% ------------------------------------------------- CPU usage details on a 2 core 4 thread Intel i3 based Desktop PC. part of the perl hotkernel output kernel`0xffffffff80 558 0.6% kernel`copyout 592 0.6% 0xffffffff822368a3 639 0.7% kernel`amd64_syscall 683 0.7% kernel`__mtx_unlock_flags 728 0.8% kernel`copyin 1311 1.4% kernel`bzero 1434 1.5% kernel`pmap_extract 1615 1.7% kernel`lock_delay 2329 2.4% 0xffffffff822b0b5e 2528 2.6% kernel`spinlock_exit 20950 21.8% kernel`cpu_idle 48124 50.2% ------------------------------------------------------ Thanks Steevan On Wed, Jun 27, 2018 at 7:41 PM, Warner Losh wrote: > No. It's not from mtx_lock. It's likely from lock contention. Since the > list ate the attachment, I can't check for sure, but high CPU usage in > locking primitives is a classic sign of poor lock design leading to > contention. > > Warner > > On Wed, Jun 27, 2018 at 6:28 AM, Steevan Rodrigues < > steevanxperia@gmail.com> wrote: > >> Hi >> >> I come from Linux background and new to FreeBSD. >> >> I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a >> card . The card can process data at a rate of 30 to 50 Gbps . However, I >> see very high CPU usage even when I run a single threaded user side >> application which uses this card . >> >> I ran hotkernel script from Dtrace toolkit. A portion of the output is >> given in the attached file dtraceDiff.txt. Here I see that lock_delay >> seems to be the reason for high CPU usage. Looks like it comes from mutex >> locks >> >> This driver uses mutex locks ( mtx_lock). >> >> The CPU usage is very high on a multicore (Xeon CPU) server node than a >> dual core (Intel i3) Desktop . >> >> It shows 30 to 40 % CPU usage on a Intel i3 ( 2 core 4 threads) and 60 to >> 70% CPU usage on a Xeon CPU with 12 core (24 threads) for same output >> data rate . >> >> I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any >> pointers or suggestions welcome. >> >> Using FreeBSD 11.1 Release >> >> Thanks >> >> Steev >> >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org >> " >> >> > From owner-freebsd-hackers@freebsd.org Wed Jun 27 19:34:28 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACA0100417C for ; Wed, 27 Jun 2018 19:34:28 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C277B8F25E for ; Wed, 27 Jun 2018 19:34:27 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: by mailman.ysv.freebsd.org (Postfix) id 86305100417A; Wed, 27 Jun 2018 19:34:27 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73DA31004178 for ; Wed, 27 Jun 2018 19:34:27 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailin.dlr.de (mailin.dlr.de [194.94.201.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailin.dlr.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CDE618F25C for ; Wed, 27 Jun 2018 19:34:26 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) X-IronPort-AV: E=Sophos;i="5.51,280,1526335200"; d="scan'208";a="4842866" Date: Wed, 27 Jun 2018 21:33:09 +0200 From: Hartmut Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Subject: makefile question Message-ID: User-Agent: Alpine 2.21.999 (BSF 260 2018-02-26) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 19:34:28 -0000 Hi, I'm preparing an update for bsnmp and have the following problem: In libbsnmp a header file is created during the build process, which obviously ends up in the object tree. Now I need to include this file when building the daemon and modules from usr.sbin. I have the feeling that doing CFLAGS += -I../../../lib/libbsnmp/libbsnmp in usr.sbin/bsnmp/bsnmp to reach into the library object directory doesn't look right. Or is this the right way to do this? harti From owner-freebsd-hackers@freebsd.org Wed Jun 27 19:39:24 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18D811004531 for ; Wed, 27 Jun 2018 19:39:24 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id AA64D8F59E for ; Wed, 27 Jun 2018 19:39:23 +0000 (UTC) (envelope-from leres@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 69775100452E; Wed, 27 Jun 2018 19:39:23 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56DD6100452B for ; Wed, 27 Jun 2018 19:39:23 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from xse.com (xse.com [IPv6:2607:f2f8:abb8::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "xse.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DADA48F59C for ; Wed, 27 Jun 2018 19:39:22 +0000 (UTC) (envelope-from leres@freebsd.org) Received-SPF: pass (dot.xse.com: authenticated connection) receiver=dot.xse.com; client-ip=2001:558:6045:10:9084:9e0:4b6d:eb99; helo=[IPv6:fd:1965::50]; envelope-from=leres@freebsd.org; x-software=spfmilter 2.001 http://www.acme.com/software/spfmilter/ with libspf2-1.2.10; Received: from [IPv6:fd:1965::50] (ice.xse.com [IPv6:2001:558:6045:10:9084:9e0:4b6d:eb99]) (authenticated bits=0) by dot.xse.com (8.15.2/8.15.2) with ESMTPSA id w5RJdCgR094254 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 27 Jun 2018 12:39:15 -0700 (PDT) (envelope-from leres@freebsd.org) X-Authentication-Warning: dot.xse.com: Host ice.xse.com [IPv6:2001:558:6045:10:9084:9e0:4b6d:eb99] claimed to be [IPv6:fd:1965::50] Subject: Re: makefile question To: Hartmut Brandt , hackers@freebsd.org References: From: Craig Leres Message-ID: <88473e08-4207-1dad-6377-951ff14c277d@freebsd.org> Date: Wed, 27 Jun 2018 12:39:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.100.0 at dot.xse.com X-Virus-Status: Clean X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 19:39:24 -0000 On 6/27/2018 12:33 PM, Hartmut Brandt wrote: > I'm preparing an update for bsnmp and have the following problem: > > In libbsnmp a header file is created during the build process, which > obviously ends up in the object tree. Now I need to include this file > when building the daemon and modules from usr.sbin. I have the feeling > that doing > > CFLAGS += -I../../../lib/libbsnmp/libbsnmp > > in usr.sbin/bsnmp/bsnmp to reach into the library object directory > doesn't look right. > > Or is this the right way to do this? Check out usr.bin/w/Makefile, it uses a module from bin/ps. Craig # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD: releng/11.2/usr.bin/w/Makefile 319186 2017-05-30 04:27:05Z ngie $ PROG= w SRCS= fmt.c pr_time.c proc_compare.c w.c MAN= w.1 uptime.1 LIBADD= kvm sbuf xo util LINKS= ${BINDIR}/w ${BINDIR}/uptime .PATH: ${SRCTOP}/bin/ps .include From owner-freebsd-hackers@freebsd.org Wed Jun 27 19:41:28 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88C81004702 for ; Wed, 27 Jun 2018 19:41:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id EBBBC8F849 for ; Wed, 27 Jun 2018 19:41:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id AC83610046ED; Wed, 27 Jun 2018 19:41:27 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 850DD10046EB for ; Wed, 27 Jun 2018 19:41:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2056C8F842 for ; Wed, 27 Jun 2018 19:41:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id 188-v6so9090659ita.5 for ; Wed, 27 Jun 2018 12:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=VUuQKTrKaaUgu6q5IfYh7IAVjObleKHrSAINSPhIJmY=; b=wV/lQaRUrthvNW5EZganXeFeTDx09CHYIZHEToT0EcU/ET+sEo3yAuTSbk4hs9bk1K sXP8iBec+7mFzrj+mM4NoUvD9BKRDVVqaq66V2YPeubZZOEk+zLtTV7OeHZieWaxijt4 h5TdD1BV5KP9Q5SXRLZ8pmFJORFdkJRuk5/u6g99KifFoxLaoCYOvJkbU39PEDHqsTub YuIcYvB0Wk6CNzzqEkfAs5TMSXcQos/F90vNJrTfquIsfNvBBuvL0kt2bbvfwOIPBns8 sdTuqRKpkneL0ca0v2olrndSgxmSoOxQcwCXPoA1d9p7+wOcOEHyASv7Lv6MziO5w2U+ wvQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VUuQKTrKaaUgu6q5IfYh7IAVjObleKHrSAINSPhIJmY=; b=fZU6Qqh3tso9WpJxaPtfHvoahlEXTRor7oIMK6ksImCi89vU0oOVuWH6eRc9UQxpmy ZpBcWTtVs/sGwrx78J5XQn9PNxWA66jiRG3iE5Wt6lq6cv4opdwL3lnKzxe28Akjv4Wq 3Ge9A2ukjXKs2hQ7Q2NT80dYTVnOtmGxdNYPS2s92JvIxJCAj5r4PJNozIJLKGa9X0z+ HQdVaurnJ02ehaQcM/2NDus34hOV+EdPDxZOMuXkKW72tG8cTqTDazVOfWYuwtS5v0S4 zQTbVt6rtgoiyfoWCxCz2pRgxU0Hp54SXmFJB3oiquRAHV/n3oLG44FpftVqhOaykn5+ Vq2A== X-Gm-Message-State: APt69E1T1DJlGfMspISHYS/XWRWPlwRpk7KFebHDk5O1BLYbbOuItqJI J8SqrXwE2AAfKImkUUuYr6V9OHX1MjJFY5K+s/ry5Q== X-Google-Smtp-Source: ADUXVKIG+lGlmhVxYILzChMB0FtX6xi998uk/LSiIm/tjoIxbA2H6SzS1tbjMsbAIAD+QgLIPsoey3ZrVcyHXiomahM= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr6064902itd.73.1530128486366; Wed, 27 Jun 2018 12:41:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 12:41:25 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: From: Warner Losh Date: Wed, 27 Jun 2018 13:41:25 -0600 X-Google-Sender-Auth: x2DzfQNo1FgIJWCHSHJb5LWDKwY Message-ID: Subject: Re: makefile question To: Hartmut Brandt Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 19:41:29 -0000 On Wed, Jun 27, 2018 at 1:33 PM, Hartmut Brandt wrote: > Hi, > > I'm preparing an update for bsnmp and have the following problem: > > In libbsnmp a header file is created during the build process, which > obviously ends up in the object tree. Now I need to include this file > when building the daemon and modules from usr.sbin. I have the feeling > that doing > > CFLAGS += -I../../../lib/libbsnmp/libbsnmp > use ${SRCTOP}/lib/... here Warner > in usr.sbin/bsnmp/bsnmp to reach into the library object directory doesn't > look right. > > Or is this the right way to do this? > > harti > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Wed Jun 27 20:11:52 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCDE4100E7F9 for ; Wed, 27 Jun 2018 20:11:51 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 1442470CCD for ; Wed, 27 Jun 2018 20:11:51 +0000 (UTC) (envelope-from sjg@juniper.net) Received: by mailman.ysv.freebsd.org (Postfix) id BF133100E7F8; Wed, 27 Jun 2018 20:11:50 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98011100E7F7 for ; Wed, 27 Jun 2018 20:11:50 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0238F70CC9 for ; Wed, 27 Jun 2018 20:11:49 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108161.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5RK9vsq000347; Wed, 27 Jun 2018 13:11:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=er/8ehAEFPxQPp47tOlAfgYN86TKgLV0e1sIECnw+Ok=; b=K0jk9wUPykp7RHX+cR1x5it8xVJJqWqDdCgIaEfJ7LeF9f48gl+sQvABnpdGA8ZEB7Bk tdb5HUSCQ9qumgck0mfi/rSscIcHxMGr46I9SF2svJ9pnYMOEUw5hpxGkoHJFR7DYiRS f3pTMjJ40kzneTExIESqAVtJVoxrv+W3zH5eonIwKNq6dGJcwQOXklsfXTqToknHvbAf 2nWdchGOT9IsJ/C16F633LCjXyOLPmxmfIm3XHKjbr11/Kx7NWYTP/08DJ5axRb2EsD3 Isz4bF5gK6BtDwwDd3mEvVZzQvF5s+M3rc8Nfk0TzTp+3xJyotHj0JEI8GAMp0jmr3pr tw== Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp0020.outbound.protection.outlook.com [216.32.180.20]) by mx0b-00273201.pphosted.com with ESMTP id 2jvdyr8dsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 27 Jun 2018 13:11:44 -0700 Received: from CO2PR05CA0074.namprd05.prod.outlook.com (2603:10b6:102:2::42) by BY2PR05MB613.namprd05.prod.outlook.com (2a01:111:e400:2c45::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.10; Wed, 27 Jun 2018 20:11:42 +0000 Received: from BY2NAM05FT027.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::208) by CO2PR05CA0074.outlook.office365.com (2603:10b6:102:2::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.930.9 via Frontend Transport; Wed, 27 Jun 2018 20:11:41 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by BY2NAM05FT027.mail.protection.outlook.com (10.152.100.164) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.930.2 via Frontend Transport; Wed, 27 Jun 2018 20:11:40 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 27 Jun 2018 13:08:26 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5RK8QxA002509; Wed, 27 Jun 2018 13:08:26 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 2DD0666179; Wed, 27 Jun 2018 13:08:26 -0700 (PDT) To: Warner Losh CC: Hartmut Brandt , "freebsd-hackers@freebsd.org" , Subject: Re: makefile question In-Reply-To: References: Comments: In-reply-to: Warner Losh message dated "Wed, 27 Jun 2018 13:41:25 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <60956.1530130106.1@kaos.jnpr.net> Date: Wed, 27 Jun 2018 13:08:26 -0700 Message-ID: <62709.1530130106@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(346002)(136003)(376002)(396003)(39860400002)(2980300002)(189003)(199004)(86362001)(305945005)(446003)(68736007)(81166006)(8676002)(2906002)(81156014)(229853002)(50466002)(16586007)(6346003)(69596002)(97756001)(9686003)(54906003)(316002)(356003)(2810700001)(55016002)(7126003)(476003)(11346002)(486006)(107886003)(4326008)(478600001)(126002)(8936002)(3480700004)(50226002)(53936002)(6246003)(6266002)(76176011)(7696005)(23726003)(117636001)(97736004)(6916009)(7116003)(5660300001)(105596002)(76506005)(47776003)(53416004)(106466001)(221733001)(46406003)(26005)(336012)(97876018)(77096007)(186003)(111123002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR05MB613; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT027; 1:VuZd6bownDTE5OZ+bVJtCJyFVHq6LhAYSYkh7epPxUBNEJ5ZIscXztuX+C8J7urbLZWSFypPM8RAfGHWTEgOtNJwKIXX9HYL3h7S6rwTHkHHu+S+wYIzwWuUAQQLKO7r X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b943517d-8528-44f0-bd22-08d5dc6a324c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060); SRVR:BY2PR05MB613; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB613; 3:Z7PYHJ5C6aG7Xej/t1MdpXIqyzpQC2eqdvO6tOr4u8Um2n3JjOysGMzGD7fy9+rM7k+SnZKhRMmKhbI00MpmCLDPnInamXzbP2fWcN3kLvp+aldBZtjFRgcLSoUmPEA/YRlzIzjgi40J997SjcDJHFT22Sm8KZ6eCWRcHME6ZMJKuuRgchTK2B9KGkDMmv4hiXlhKqHYiT7cPPNDtMZgvnwUur5azZqSmKJR11BafnYTIzGAzb9Y2ynFZ8tEdk+Cjv49wEMKWAifWTnX7UpzLpPvbdVWWKKR6mivArBythg8h7IE5ZSn1e1Im9oH0wFdQcbXMpq2kbjxlbji+2ltNxB9v1HsaR3dvrJwPI25Now=; 25:OYj0vbMJ079VlZNyZb1AmkA6DY06pWM7Yfp0gRxGoOVmYUmmmPckBWA8HbIMWqnpArZx/Db4olCCL1OTAfqtzsAqj8Y7p3H6D7AhfQebPmirKoPEAcUjP8t8Blje/FzDxYYLtnYdufluDCNBYfABANYuK0ZM/sveDJnAiICxZU5WKodsrPfa4kWfLXX7rWPiS4QrcbBeQlzgPx/QH+g5puGouoz4gFVL6XQRjMH/FOakNYMy5g8WUwwoH4HH4NhoQrAuPVo1/M8CbEhQEakZrjXoM+hVgeEnKcpJBt92QhaSVyj0zuGsDTfLvpT8sQSbBBauFsFN0Pcpxb5+Syg33g== X-MS-TrafficTypeDiagnostic: BY2PR05MB613: X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB613; 31:Gcyjs2NrqcHvDD2/9ldYhlKs9QOzONgs7i3G+qsWWggLLt8hoy1rRlWBEhiyGEI4cyseebh8AKov9Ubb1y2CuAhZ4zoAJ3HAxrqb7Cze5KA5hyJooAhpP7T3TSXJYsjly2eNiP8KrgfU5f8+y/XkCedVLpYo3zwuT82lU0mJwTNTqkG/eUUH3LQkA/YpvEYY0Mw7SsJvrPZDuqrLMS499/z0u1JtpVI9nqTsmAOZEjw=; 20:n3mu8Q7DrwQZe+5ItQiDXaf+2A0FjV94ZPJUGJ9WjFT/DuYZNHm1haoLV8WYxZpvphnjm1tp7MA5QuG25tHEKm4kX3ZwEKTxlY+b1WOJdRZWWxJbmack4PJ7Y6+bcb2+8/vD9kUAoX/YQPwdXRH8ughG6DB1y5s5mPa+K1KHGf5Yv4MC2CE6KJWN2YdutrewUacjxkrmhXpTGsw4yCrDEaC1voMebR960CYqG9gQCasSb3SHpGNbm0FaF9uq/e0qWnwtp/8p2fJhEBK0B4y+pql7KJfXMUaHQWVSOyhwon4Uhrznc+11b8tNMZQKxhHMxQ4D6dhXcwO0wBfkKWZXuvEBrbAH1DQGahkvOKkmNLqWvufoN2PaWqmcMtnaYUd6TCzznMMEio4kLGO3IR4iug6/OtUTXbWaiDOO6OEj3/hTJDiKa0ok5CIfW/iGBiVmSb+yCBiDC9S/8+Vy/MwWurDbcoXM350B7az+jf0xSxJQHB+3yA5thbIP0rTrshzO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BY2PR05MB613; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB613; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB613; 4:foVAC8E7eUoRhMF5rSau3MLcIBClJTeLl3HhIogdIp3Pm5rLKsLXAsiGJS+Z3jp5R6JA7I4SEeGpibxCfPdGosXAH/3vSTBqtSYwUlG96E+eeuLaZLqc+3U6J4VVZgGUNaQON/naKP1K0sf0IQhsWonHPvsPjG+tsMZotfoVLF3UAWqiaL8WLcoVKyBPv4GA08NJm4f10m+aHDWI1Nb9sp6rARCLbMF/P/XsCtJ8PIBtTAMNWo0L0UshwJvQOajsguud3fDjVgbX/6uhPXBifA== X-Forefront-PRVS: 0716E70AB6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB613; 23:Xg/gj9dUSda2kkD2zXqAyViSqGW3RhmaeWOwD2IMO6?= =?us-ascii?Q?1z1HBOc5PlzjxPfK1QHq48iAW/wpzR8JwYrrz5EjhHXPW+a5sXI7G6t6VNdB?= =?us-ascii?Q?XWhBJu8HRPS+9/xf7tAvYAFjZJ8Ztz/7Ph8YAQuuAGAOn80FWqsfVyNC7Mvd?= =?us-ascii?Q?Csx5ha3iDE7qCFpqCbnlM6e01Ih2vvnZaeiT0u81biBS4byq5qSi1qniWZTV?= =?us-ascii?Q?/QdPRiadnegUcxcFWqcadgJIILOywR3AHm9FbkYWY7aCsIunEukKbwP9qW7h?= =?us-ascii?Q?ddt/BfOXPNeFCpbiXswY+GuUY+iGGQufLy6l/9/oIUsMQ4r4GdC3MI2nd3ma?= =?us-ascii?Q?HwcYZg/j+i5qdPqM58HdWhl+sLPNtaNUyaWhJdD3vkPZeIC1JGlA6MzSvf1n?= =?us-ascii?Q?IGoXL5vQHhJjVTtA3olPwS/A/xUrvhEq7SiND+fyN5BeeN5UdaL1dkfPB8kX?= =?us-ascii?Q?5koM8LGcoMOh5kiHgU/l2XhPsXgi1Efn+uKyV9ulAd3NS/WSSO2v7jCOH1KR?= =?us-ascii?Q?XRlUlv69uf4GZkLjIVakNQO+qeJW6nRLvbn+yL5gjl3hag18o8D8Ops5tOhl?= =?us-ascii?Q?VClem4tglLL7WR1dP7ol6br6oSec1TNov//DPhYuyU60SIWg6Wb8+DoqNV8u?= =?us-ascii?Q?tSfuQo7vV6Uw82RlaqlLlSL68AlxuwILJ7hrFZzX46qK2Gf8F7YsbrAy0g/D?= =?us-ascii?Q?MlsdmUxQbAnrYLm7HMwezIv53HspiGvU+k9A7FQrrGkoCNRefs9k4IWJKCgg?= =?us-ascii?Q?CCjFxnzn/lopj+ot/wdKcb739yUWf1PjFq5HOuSgbdW6QyjLRfjsGvHMje6x?= =?us-ascii?Q?lxakDcZLGtXIA+a2nBGGoFE4z3oLC75BDxm12/Ms+JuNXJmIR/sTbSv/qqv4?= =?us-ascii?Q?LAB/viQ/DBP80Zxl3/ks0bfSQVSurxqOD+RSQExnmqPV9TcAOp342QVwQqKS?= =?us-ascii?Q?kQZ7LafeoZfPQsGga9BEOGv1ClTlm3+beJy8j5Bx9Xo297Acwg+4ZdT4ghZ9?= =?us-ascii?Q?SvZRiaYV5ai6I1pvZbU+y+KXIcMAxVZwxRDHwRDPnVP4W+oDdE+UHgZhnQHH?= =?us-ascii?Q?4mXzL2rNk/Xkq8zIzdhcvacV+JPwL8yn0RUt6CVZXn1suIfhwoZk4rVIqlm6?= =?us-ascii?Q?rOqvOT4cogkGJwUrAzz6kwhbmxJJ5WjNApeTf5H+AryyjX77vdAPLcoWzpEp?= =?us-ascii?Q?htfdpZ0SJ/TAWPTBSLyBbUi6csnuv1AGf9XR9j0NXmyQBlD4ijOUOEyzDh9O?= =?us-ascii?Q?x3K8o82cJxT44XZWknYdRkMvVK+IJvvwA+ugyLyBIjxtV4i4Kl046ObqlSlN?= =?us-ascii?Q?Enokd/EvJtnzqyFClggLl8jhoAzy8wSYHPR5gOxPiukOctG7UisW/emsDudP?= =?us-ascii?Q?JnYSmoyKV5lM25jEVgss+DOxlYc1vvxj6ZRfSsW5OVXfLOEWsK14FFPNOONz?= =?us-ascii?Q?pixl8qug=3D=3D?= X-Microsoft-Antispam-Message-Info: iwH7p4bo+azCJ/lPeimWRaeKP/lIrNb6Fv3s97NZIIdT4c4tjEw1XfzCmJyFPC6s9+/3qxB80oSnzXEcjWIoKdtDqS2uGf/qwyv4k9EwyEZlg16AJ9RzYswFpqJjdvh0qEY/5GhBAjBpVifNUOjuNAJOEbZIUGVyHsQ2uitkJ4lXpT4DoGiuaW0ppkeeAxo9H3/woNemg9smKVyOGPvvQWTLOejuP2rOEbFDFY6KjppJsXUFDeaPyd+sVMczxJ4/E6wF8oL5+bmKVOMxp86jS3NdIMjpIIYT9hPLos6sNADsgb3Yfdi35UuJqrMMvahotavyYhbbsgMA488N3/7m0bSxExxhTtNxrkgPt9tMw6A= X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB613; 6:vyxhV1edl3ZgDV6eQpmzLN0KPmVoonNTeSlQiX4y+a0kAgF77EY0NkRd8kDKBllj/KE4vSDVkB6szfJBhcE76XEYCcvkyuVJPzIzyAzjoM/FlV+MIoKBGpCnoQBWiDNhsZYBmt8eYFsz6Z7vymoEtJOmO38KOjB2cyZIABFmzDzbKoFC/SnajFs8oO0HnsKm/xCDkWMHqxFuOi6rn/SxxR5U9zRSDB74d9zVCgw+qASKM4pu9Z0oZdkdi13IOT8R8YJVQAjWB8hiqY4FITDGKsgVF42mKh30KEHnE/VmVtKQcdRLTyPZFksPbdJqNyjc+4LdHkXbjPZBLNshhwod2MVGisyisxTq40ugTsIng1mmKeN0l7JKjtwBL1/AN0rNNsoVpgiciUrZ9ifoQZC2+iOXFx4xnlUHl/dsWzeKSP+rtt4MbODKvV/e9730HN+NxFNWP5bhErTj/9G5lhonhw==; 5:X+VmGb5XCi8JvJFSFU2XLDBfg7uaFRW1j43TlyuvvNs2EdeXgy0L3cwi/T8mZ5LSVTffT1HjekwrfksxAsicdsx0iN8ErkFy79yj6t4q/n6u0AmyqZrM6yR5SB3oGlESDGBdJkaWEAR46i9MUdY/Cb4hW4BV0wcjX9GUrl4H/p4=; 24:gvs31xqN9Kk6KgKjI+p7zZAwHWXHd1pBZ3/p6NY2qTVJpqIbntHrbJFjxJcVZATlo0ciJqn3JKPt+180soOZFqg85yPYbqTqQNvN1sPCBko= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB613; 7:h3zcGs1n8TjPjTxs+Sce+8h6hRwMgfnN19OIa16OdhidyM/4hsj4owD+NlrY2+fv2GOnN/3k+0LHT1J4KIVEWTGoMSplUHtFtyHcqilERsUaGlj2uE5lrque+holdM2vw0/+EdJ5e6q2zbLg/aT01v0U1OrcrzHGEiT8AkMn6eEn5wUxpWLL3de/GpQMphY+B1pU+SJmOydvFlkjWJtw/tbg9Q2hL1UZ3FBm/1PmYUV98JNQ7QF7131G3GeDYICw X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2018 20:11:40.8983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b943517d-8528-44f0-bd22-08d5dc6a324c X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB613 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-27_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=729 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806270213 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 20:11:52 -0000 Warner Losh wrote: > > In libbsnmp a header file is created during the build process, which > > obviously ends up in the object tree. Now I need to include this file > > when building the daemon and modules from usr.sbin. I have the feeling > > that doing > > > > CFLAGS += -I../../../lib/libbsnmp/libbsnmp > > > > use ${SRCTOP}/lib/... here I think he said it's a generated header. Looks like share/mk/src.sys.obj.mk now sets OBJTOP or at least OBJROOT even for non-meta-mode build. So -I${OBJTOP}/lib/libbsnmp/libbsnmp should probably work. From owner-freebsd-hackers@freebsd.org Wed Jun 27 20:13:58 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A628100EAB7 for ; Wed, 27 Jun 2018 20:13:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id DF44070F46 for ; Wed, 27 Jun 2018 20:13:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id 9ADFF100EAB6; Wed, 27 Jun 2018 20:13:57 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78871100EAB4 for ; Wed, 27 Jun 2018 20:13:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3D070F43 for ; Wed, 27 Jun 2018 20:13:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id g7-v6so3051214ioh.11 for ; Wed, 27 Jun 2018 13:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1OyMKVQyjL+OdlAmNXy4YOSyoPJfRigUOuSaiBKIOHc=; b=GQ+1xL7d9GIBrayJ8bAvFjNRDI2wVvPcnddG2PkCRApHDGnJu9gQ+fnDxk9isV2iu+ E0g1v0VD0Eqfs63hhB9jh9x6RFiLy38IKxbZdTT7ON/qdWZbG5RRDulqFPq1W5zMNkJn qSeICCCNmbvV9M3hqHG8qAbJzpKKO1EPlmLN6G4MVxJM0sqqWz0KMnQQEmM9VoTmapYY bCuqofquTD+bc14zocEnHnxUAOciOTZtm4Fvf+99wDz/guHDsOnIVSj5ElWGu8Axq4D/ 02785qil1SFc/DAkzFUp6fDihzeiH+Onqpjw4PzR0LVYWOMkPeJyR9ywFPwbuxgp3fQy s4xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1OyMKVQyjL+OdlAmNXy4YOSyoPJfRigUOuSaiBKIOHc=; b=QYhtMzZB0LQekZ2yNcIOemNWub942+JIHkeHmMtnYB/tVUhHxaUj0lfE+98U4KFnPu 1elk0BZnqeHijpobN80ElFzeKjXu88vSVREPMQRh2icQY/UtLkhEHcZGECxBaa4QMtu2 jAdeZHXN0OMcbz1S1viI2BihJ1yWyoBPUkDCuPO7jNhFmnPIeiTR2lvYtpwBrUk5+Oog GEAVtfurrTQQQuiSzen+InlrLo2K5jSmZFKDvB2gmnBrNc4r/e8oGzmH69NXN/FxRzsS QmPXjd5RukDK48sc6tp/WM9WxgSTWBVGWI3Ktc+8auSb6BY3u8AxnnP80vmuFAdoYawb mKxw== X-Gm-Message-State: APt69E2mUz70d/3aUaML4C7S85za+rVJIJruWvj1VGwDjVHqqTDmMUhe IyD4GOyNUAX42w3PoLOHOeDEBT5UgW06STJ0qxje7w== X-Google-Smtp-Source: AAOMgpefGIXE6ms3dNXosZDjooQSCCtKSNEZT4X0pEFhdjTaxNs68PT1Y62LKtmRp7PUfS26LPztAdred3bXRufnM9c= X-Received: by 2002:a6b:280a:: with SMTP id o10-v6mr6211618ioo.168.1530130436391; Wed, 27 Jun 2018 13:13:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 13:13:55 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <62709.1530130106@kaos.jnpr.net> References: <62709.1530130106@kaos.jnpr.net> From: Warner Losh Date: Wed, 27 Jun 2018 14:13:55 -0600 X-Google-Sender-Auth: ZpUloZ-EfbBp1EHy85l7GKnIlME Message-ID: Subject: Re: makefile question To: "Simon J. Gerraty" Cc: Hartmut Brandt , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 20:13:58 -0000 On Wed, Jun 27, 2018 at 2:08 PM, Simon J. Gerraty wrote: > Warner Losh wrote: > > > In libbsnmp a header file is created during the build process, which > > > obviously ends up in the object tree. Now I need to include this file > > > when building the daemon and modules from usr.sbin. I have the feeling > > > that doing > > > > > > CFLAGS += -I../../../lib/libbsnmp/libbsnmp > > > > > > > use ${SRCTOP}/lib/... here > > I think he said it's a generated header. > > Looks like share/mk/src.sys.obj.mk now sets OBJTOP > or at least OBJROOT even for non-meta-mode build. > > So -I${OBJTOP}/lib/libbsnmp/libbsnmp should probably work. > Oh, you're right. I missed that detail. Warner From owner-freebsd-hackers@freebsd.org Thu Jun 28 13:05:04 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F6C1033267 for ; Thu, 28 Jun 2018 13:05:04 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6217AF6A for ; Thu, 28 Jun 2018 13:05:04 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id A3E26270014A for ; Thu, 28 Jun 2018 09:04:56 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu A3E26270014A Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1530191096; bh=g+h6YksUMRTPIJcsg2Kbv/44Wq1XXDz92UOVhpp4Nl4=; h=Subject:To:From:Date:From; b=IfdYCENuAsZSY5RF3Q9x+sMaWV/6qHU+WO9vOi0htg3GnbAVJqZE9exfDyG5Dpq4U ZnJF34iKRK3AsMkDU0urmab7SYeyixzNt2nIXyBvEwkA2OUuNNOKd9EABRNQbqJvv0 cpDKrGaL9AN3aC+4X/3FbKg9cdW1rvrZT+cGXaKwYK0Rh4WmVxLR8FgSN1X3GNs+PP 01B/9safrVGExPFkDdTV3MzsdouNYHA0QMnUcl4AFzwWvGk3L86+mj/VS+aNZatJnU +QT5Pknghai7F7129c9lPfsJ7w5bCZXdUrz60bZ1qALgKP2SF84vuQWbNyi6JHx3zQ cSd9dX+cY373Q== Subject: Re: high CPU usage in FreeBSD for a PCIe card driver To: freebsd-hackers@freebsd.org References: From: Andrew Gallatin Message-ID: Date: Thu, 28 Jun 2018 09:04:56 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 13:05:04 -0000 On 06/27/18 08:28, Steevan Rodrigues wrote: > Hi > > I come from Linux background and new to FreeBSD. > > I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a <...> > > I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any > pointers or suggestions welcome. It seems like you're experiencing lock contention. The next step is to determine which lock is contended and why. I would suggest using the lockstat program to identify the lock which is contended. Try this: lockstat -x aggsize=4m sleep 10 > out And this: lockstat -x aggsize=4m -s 10 sleep 10 > out-stacks The first will show you contended locks broken down by type. Eg: Adaptive mutex spin: 61262 events in 10.007 seconds (6122 events/sec) Count indv cuml rcnt nsec Lock Caller ------------------------------------------------------------------------------- 15958 26% 26% 0.00 2960 tcp_hpts_lck __tcp_hpts_remove+0xb5 11723 19% 45% 0.00 2608 tcp_hpts_lck tcp_hpts_insert_diag+0xaf 6903 11% 56% 0.00 4605 tcp_hpts_lck tcp_hpts_thread+0x11e 6834 11% 68% 0.00 125868 sleep mtxpool _sleep+0x2e3 2756 4% 72% 0.00 1530 vm page sendfile_free_page+0x1c1 The second will show you the stacks associated with the lock contention, and may help you identify the source of contention if, for example, your driver is causing contention on a kernel lock. Drew From owner-freebsd-hackers@freebsd.org Thu Jun 28 16:45:01 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29A4101F951 for ; Thu, 28 Jun 2018 16:45:01 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEDB83C14 for ; Thu, 28 Jun 2018 16:45:01 +0000 (UTC) (envelope-from steevanxperia@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id 21-v6so5802627oip.8 for ; Thu, 28 Jun 2018 09:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7Y4hcIejctpVzkzejTxhZ6hxkftaS6m7RDl6WPW2/+g=; b=ddvVxzzwMkQo8Cr4HQdTUKH/G64FewWWDoKU9m0bWcuF9b8WZg/SYDE8hqz7Eq3m8D hV2ZIzSHgPof3IedEpQJ4btFy90Qkq61xIgQByQ9Y1YjzgJZB99tzHO2VZdTK6GOC4U+ nomVku3oqoz6JLJ/oo4O/moCHy+jaLTZq8hUoNdVj/iKqcN0pKvMmXrywUzL1JK3se13 GTPAD+FjEudM72nFL8mKzh9MQGvQrWbyadpnc98B3ESoqdnBqRCIcraHukpeMCzpc3yY 2hvTfFk/pjzKGtyVO9apGMcK4umIaSg04hjZzoPdrxkFckYkpABeWOuUsPS95f2uzA3R c6hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7Y4hcIejctpVzkzejTxhZ6hxkftaS6m7RDl6WPW2/+g=; b=IGgT8h5s1/kXzSEJNunFc7dcnPYYr3MKphQMW0CKecFKlw0GR+TuDXXOyrvbTOSksI ZngJk2UTlAo4kzzPz6sKGiRKa1l1xhVSIJEYhaupG81QjE3TRGE1yFojbVj/MJDrGjta BmFDqqnxIyzmWaJioAyzzIlPcdBtQPz77lFjyD2RmLlNBoV+7ZZEuxT99xnffFUs8rpd I/0Ij3oE/RYcoU8cE9KYAjHALldjoEuWWOyiCMsRXGoP1LnJuKNCWwsm3Qq2bEB5RM3X uHvwy5Isx1QkbvIFZPv+9wbFjl1v9LMoU7+uraJf6CAf59oLTKZQlvplVeMjj0tVXwOZ ufFQ== X-Gm-Message-State: APt69E2nnTPBru/NmvJF2ABbaVQ3/ITy5R4MbbwHJfKeiAaMB0rOpyHa +JfXUY7/GZgulPQGFUb96Sz7H4drn3Aoqqs/9g4= X-Google-Smtp-Source: AAOMgpd9PiHJinE2kqYfa2y8HDf73c4JLzaVZNlrfe8HwjOGeZwrN/QsjGd9XRYsffGqxGir3RvKJ5hiCBXD9xLpCbk= X-Received: by 2002:aca:a806:: with SMTP id r6-v6mr6440382oie.213.1530204300302; Thu, 28 Jun 2018 09:45:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:73cf:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 09:44:59 -0700 (PDT) In-Reply-To: References: From: Steevan Rodrigues Date: Thu, 28 Jun 2018 22:14:59 +0530 Message-ID: Subject: Re: high CPU usage in FreeBSD for a PCIe card driver To: Andrew Gallatin Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 16:45:02 -0000 Thank you so much for the suggestions . I will use these commands. Yes, I am already working on to identify lock contentions. Re-built FreeBSD kernel by enabling lock profiling and now I am able to see some issues with contention. Thanks Steevan On Thu, Jun 28, 2018 at 6:34 PM, Andrew Gallatin wrote: > On 06/27/18 08:28, Steevan Rodrigues wrote: > >> Hi >> >> I come from Linux background and new to FreeBSD. >> >> I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a >> > > <...> > > >> I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any >> pointers or suggestions welcome. >> > > > It seems like you're experiencing lock contention. The next step is to > determine which lock is contended and why. > > I would suggest using the lockstat program to identify the lock which > is contended. Try this: lockstat -x aggsize=4m sleep 10 > out > > And this: lockstat -x aggsize=4m -s 10 sleep 10 > out-stacks > > The first will show you contended locks broken down by type. Eg: > > > Adaptive mutex spin: 61262 events in 10.007 seconds (6122 events/sec) > > Count indv cuml rcnt nsec Lock Caller > ------------------------------------------------------------ > ------------------- > 15958 26% 26% 0.00 2960 tcp_hpts_lck __tcp_hpts_remove+0xb5 > 11723 19% 45% 0.00 2608 tcp_hpts_lck tcp_hpts_insert_diag+0xaf > 6903 11% 56% 0.00 4605 tcp_hpts_lck tcp_hpts_thread+0x11e > 6834 11% 68% 0.00 125868 sleep mtxpool _sleep+0x2e3 > 2756 4% 72% 0.00 1530 vm page sendfile_free_page+0x1c1 > > > The second will show you the stacks associated with the lock contention, > and may help you identify the source of contention if, for example, your > driver is causing contention on a kernel lock. > > Drew > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Thu Jun 28 16:47:07 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B64F101FA64 for ; Thu, 28 Jun 2018 16:47:07 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECF7883D11 for ; Thu, 28 Jun 2018 16:47:06 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id AFFA027000EE; Thu, 28 Jun 2018 12:47:05 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu AFFA027000EE Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1530204425; bh=RMJY3KFZHVl63HecneXfattqbVlrUgPsvUeT56/YOQQ=; h=Subject:To:From:Date:From; b=ixQ8qMSOagiGVG6JSj9i9V+n8QkQLjEvyF92pid2gkyYXWMztod0K7JZA/Sr1vffR TOI44VcWnexPUYHTKVQex0B4+O5KJXK8ywNSl6p5svnnRbf03uaSSDHDb3KZC+BzYt yisy0t48shOjETX5ft7Cffh63ep2NZAKOuFH6CIgb6oIMpW6DNWaSH3S/InOdTd1YS PNLsMNMwhOfMsiDefUcM3MuhPyYoyu+eUZCpw1r9nn6jpVk2QBHnesxmRNLUC1czim oZxQoiB7R/SGJTqGLlecSl8xbGvKDPr7GHG5DEs5bvtfbuBCgH9owyo/z1nyXTyBdt k6qcmL/87pkOQ== Subject: Re: high CPU usage in FreeBSD for a PCIe card driver To: Steevan Rodrigues Cc: freebsd-hackers@freebsd.org References: From: Andrew Gallatin Message-ID: <2ae78782-6cca-452e-d004-3999885ae4e0@cs.duke.edu> Date: Thu, 28 Jun 2018 12:47:05 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 16:47:07 -0000 On 06/28/18 12:44, Steevan Rodrigues wrote: > Thank you so much for the suggestions . I will use these commands. > Yes, I am already working on to identify lock contentions. > > Re-built FreeBSD kernel by enabling lock profiling and now I am able to > see some issues with contention. > > Thanks > Steevan You need-not rebuild freebsd. lockstat is based on dtrace.. The lock profiling you're referring to is a different mechanism. Drew From owner-freebsd-hackers@freebsd.org Fri Jun 29 08:44:56 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 157E31034C63 for ; Fri, 29 Jun 2018 08:44:56 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72BD4825EF for ; Fri, 29 Jun 2018 08:44:55 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by mail-wr0-x22a.google.com with SMTP id u7-v6so8031452wrn.12 for ; Fri, 29 Jun 2018 01:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=97CqzZst7MFrW1EtmXa7+5bQgSQu4cWtzsqHRrRtUrY=; b=F4ZwI+py+94qqX620/qZg36GcNZzEV4opAGUW6WXkb10+eMmwFqzL86yAFUM84thm3 XnXsGTKKZMgakp+GOj3SPa6L6kwK6lU+wfdfXccUPIYfYeXLqfhPKJd+I4dGU1MH28W/ Pj7E9HEuIHAo/VEb8L0Vy/pUBQI2luDjERVejaWFUCJOkPrZxuUOh7/09DhiZy+chwjw 2gB5Wq7IMUwZljsY5azXd7pxr5KvlKyYsI96Bw/fF8RsCeEP9apmwCRUJr/mt7HUdOHb SnY0xa10Zv273GJR80+rbTKaOAUOHgC2OIAh2UaFBzJS62/HIpv8QnBtOrEi6meefGxb 3aJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=97CqzZst7MFrW1EtmXa7+5bQgSQu4cWtzsqHRrRtUrY=; b=geKlrzfBFZhjXA7cvtSHkVh8267TIzp+y18tObImF3VlkcAMF++onvh0RJlrQwWQyp qWfBp6HvnpAuL4chMocKqMpi9yLxoM631r7SbyUt3r33yNLe6mwAcNKsjgjMiJualABg 2cUzR0tMFx0fwcA81YBMGs+NHRSCMJyYinIhbEmReZ+4gGMJRSWNBxcOuh4FoAWhKnGU TsUGtPiWq5q41gY1Hahp+s3mUfwsVPlje+kXKK7GQIivWQuzKpf5VFtaD9YJcrn7+6zX 5cs2NCGLUn2eK74eGBL1tDNkRB2700BTtdKiU0KSFG9HJ2xZRVmvZh5EWtstJ59m6+x9 yAPw== X-Gm-Message-State: APt69E2L6ZOt5nfFYmfFKngn5JQsqE/kKVB2wke7Dj4cwuA4sQbq1Hqn u43pQ/F9GEdVr++CHOzXysm9Dg== X-Google-Smtp-Source: AAOMgpdqGLMa1cWZ/5g4MnHGRRrwzjPgCeU9X81W8IN4JjpUabs31VIX26fwUJ/4j2kWX4yl2lNs0Q== X-Received: by 2002:adf:ec89:: with SMTP id z9-v6mr11982038wrn.160.1530261893490; Fri, 29 Jun 2018 01:44:53 -0700 (PDT) Received: from zmaj.softwarehood.com (109-93-186-191.dynamic.isp.telekom.rs. [109.93.186.191]) by smtp.googlemail.com with ESMTPSA id r2-v6sm1137330wmb.39.2018.06.29.01.44.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 01:44:52 -0700 (PDT) To: freebsd-hackers@freebsd.org Cc: Tomas Weinfurt From: Ivan Radovanovic Subject: kevent behavior if more than one item in changelist Message-ID: <3b661c61-6067-a83c-f721-957d1a381b14@gmail.com> Date: Fri, 29 Jun 2018 10:44:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 08:44:56 -0000 Hi, Am I correct in understanding that passing more than one item in changelist for kevent(2) should be identical (from event subscription point of view) to calling kevent multiple times with one item in changelist? ie, these two be should equivalent struct kevent kev[2]; ... kevent(kqueue, kev, 2, NULL, 0, NULL); and struct kevent kev[2]; ... kevent(kqueue, kev, 1, NULL, 0, NULL); kevent(kqueue, kev + 1, 1, NULL, 0, NULL); At least for unix sockets with EVFILT_READ and EVFILT_WRITE those two are not equivalent (seems only first item in changelist is honored), so I wanted to double check if that is expected before filing bug report Kind regards, Ivan