From owner-svn-src-head@freebsd.org Sun Jun 3 02:58:55 2018 Return-Path: Delivered-To: svn-src-head@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 EEF8FFE7D63; Sun, 3 Jun 2018 02:58:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E92C693CB; Sun, 3 Jun 2018 02:58:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66CCD18BDE; Sun, 3 Jun 2018 02:58:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w532ws3q070243; Sun, 3 Jun 2018 02:58:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w532wrss070240; Sun, 3 Jun 2018 02:58:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806030258.w532wrss070240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 02:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334549 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 02:58:55 -0000 Author: eadler Date: Sun Jun 3 02:58:53 2018 New Revision: 334549 URL: https://svnweb.freebsd.org/changeset/base/334549 Log: top(1): misc minor improvements - use bool instead of int [0] - use calloc correctly [0] (this also caught an incorrect sizeof argument) [1] - use size_t over int [2] - correct style Reported by: pfg [0], scan-build [1], gcc [2] Modified: head/usr.bin/top/commands.c head/usr.bin/top/machine.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sun Jun 3 00:42:36 2018 (r334548) +++ head/usr.bin/top/commands.c Sun Jun 3 02:58:53 2018 (r334549) @@ -43,7 +43,7 @@ struct errs /* structure for a system-call error */ static char *err_string(void); static int str_adderr(char *str, int len, int err); -static int str_addarg(char *str, int len, char *arg, int first); +static int str_addarg(char *str, int len, char *arg, bool first); /* * show_help() - display the help screen; invoked in response to @@ -199,9 +199,9 @@ static char err_listem[] = char *err_string(void) { struct errs *errp; - int cnt = 0; - int first = true; - int currerr = -1; + int cnt = 0; + bool first = true; + int currerr = -1; int stringlen; /* characters still available in "string" */ static char string[STRMAX]; @@ -279,7 +279,7 @@ str_adderr(char *str, int len, int err) */ static int -str_addarg(char str[], int len, char arg[], int first) +str_addarg(char str[], int len, char arg[], bool first) { int arglen; Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 00:42:36 2018 (r334548) +++ head/usr.bin/top/machine.c Sun Jun 3 02:58:53 2018 (r334549) @@ -381,8 +381,7 @@ machine_init(struct statics *statics) cpumask = 0; ncpus = 0; GETSYSCTL("kern.smp.maxcpus", maxcpu); - size = sizeof(long) * maxcpu * CPUSTATES; - times = calloc(size, 1); + times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) err(1, "calloc %zu bytes", size); if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) @@ -400,11 +399,10 @@ machine_init(struct statics *statics) ncpus++; } } - size = sizeof(long) * ncpus * CPUSTATES; - assert(size > 0); - pcpu_cp_old = calloc(1, size); - pcpu_cp_diff = calloc(1, size); - pcpu_cpu_states = calloc(1, size); + assert(ncpus > 0); + pcpu_cp_old = calloc(ncpus * CPUSTATES, sizeof(long)); + pcpu_cp_diff = calloc(ncpus * CPUSTATES, sizeof(long)); + pcpu_cpu_states = calloc(ncpus * CPUSTATES, sizeof(int)); statics->ncpus = ncpus; update_layout(); Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sun Jun 3 00:42:36 2018 (r334548) +++ head/usr.bin/top/utils.c Sun Jun 3 02:58:53 2018 (r334549) @@ -29,7 +29,7 @@ int atoiwi(const char *str) { - int len; + size_t len; len = strlen(str); if (len != 0) From owner-svn-src-head@freebsd.org Sun Jun 3 02:42:42 2018 Return-Path: Delivered-To: svn-src-head@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 31259FE6D85 for ; Sun, 3 Jun 2018 02:42:42 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D114768A7C for ; Sun, 3 Jun 2018 02:42:41 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id A038327157 for ; Sun, 3 Jun 2018 02:42:41 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f176.google.com with SMTP id r19-v6so6165318ywc.10 for ; Sat, 02 Jun 2018 19:42:41 -0700 (PDT) X-Gm-Message-State: ALKqPwe5t9e7c974UpgNk70LmjvbmMc6+M35kn7LaWn7Wnm7UrBVaWGa CDKLnwqgXtaTHqzk0DHiTfYXQypVyN//2k6/SG2kow== X-Google-Smtp-Source: ADUXVKL0qYfXIX5HpvGVvlRryB3EGSDiQKPgqhQAGOoUGMDHxCfPGvJRXVDsTTKW9TURcmj/B2Rg/gFg+WlAJCHEFes= X-Received: by 2002:a81:b70b:: with SMTP id v11-v6mr8248434ywh.182.1527993760847; Sat, 02 Jun 2018 19:42:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 2 Jun 2018 19:42:10 -0700 (PDT) In-Reply-To: <201806022353.w52Nr1LA088636@pdx.rh.CN85.dnsmgr.net> References: <201806022140.w52LejjF005616@repo.freebsd.org> <201806022353.w52Nr1LA088636@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Sat, 2 Jun 2018 19:42:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334540 - head/usr.bin/top To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 02:42:42 -0000 On 2 June 2018 at 16:53, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: eadler >> Date: Sat Jun 2 21:40:45 2018 >> New Revision: 334540 >> URL: https://svnweb.freebsd.org/changeset/base/334540 >> >> Log: >> top(1): cleanup memory allocation and warnings >> >> - Prefer calloc over malloc. This is more predicable and we're not in a >> performance sensitive context. [1] >> - Remove bogus comment (obsolete from prior commit). [2] >> - Remove void casts and type casts of NULL >> - Remove redundant declaration of 'quit' >> - Add additional const >> >> Reported by: kib [1], vangyzen [2] >> >> Modified: >> head/usr.bin/top/display.c >> head/usr.bin/top/machine.c >> head/usr.bin/top/screen.c >> head/usr.bin/top/screen.h >> head/usr.bin/top/utils.c > ... > >> >> Modified: head/usr.bin/top/screen.c >> ============================================================================== >> --- head/usr.bin/top/screen.c Sat Jun 2 21:16:20 2018 (r334539) >> +++ head/usr.bin/top/screen.c Sat Jun 2 21:40:45 2018 (r334540) >> @@ -3,7 +3,7 @@ >> * Version 3 >> * >> * This program may be freely redistributed, >> - * but this entire comment MUST remain intact. >> + * but this entire ceomment MUST remain intact. > > I know you have already fixed this spelling error, > but I believe there are some other commits that actually > removed either this string, or some part of "this entire" > comment that is to "remain intact". I just went through my commits to top(1) and don't see any others. Did I miss any? Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sun Jun 3 03:53:12 2018 Return-Path: Delivered-To: svn-src-head@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 740C8FEC392; Sun, 3 Jun 2018 03:53:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275D96BC03; Sun, 3 Jun 2018 03:53:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 089161966B; Sun, 3 Jun 2018 03:53:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w533rBd7001443; Sun, 3 Jun 2018 03:53:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w533rBEX001442; Sun, 3 Jun 2018 03:53:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806030353.w533rBEX001442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 3 Jun 2018 03:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334550 - head/sys/cddl/dev/profile X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/dev/profile X-SVN-Commit-Revision: 334550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 03:53:12 -0000 Author: jhibbits Date: Sun Jun 3 03:53:11 2018 New Revision: 334550 URL: https://svnweb.freebsd.org/changeset/base/334550 Log: Revert r326083, it doesn't behave as expected. Even though there do appear to be more artificial frames, with 12, stack traces no longer list at all. Revert until a better, more stable value can be determined. Modified: head/sys/cddl/dev/profile/profile.c Modified: head/sys/cddl/dev/profile/profile.c ============================================================================== --- head/sys/cddl/dev/profile/profile.c Sun Jun 3 02:58:53 2018 (r334549) +++ head/sys/cddl/dev/profile/profile.c Sun Jun 3 03:53:11 2018 (r334550) @@ -124,7 +124,7 @@ /* * This value is bogus just to make module compilable on powerpc */ -#define PROF_ARTIFICIAL_FRAMES 12 +#define PROF_ARTIFICIAL_FRAMES 3 #endif struct profile_probe_percpu; From owner-svn-src-head@freebsd.org Sun Jun 3 04:14:49 2018 Return-Path: Delivered-To: svn-src-head@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 DA02AFEECFF; Sun, 3 Jun 2018 04:14:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C096CC22; Sun, 3 Jun 2018 04:14:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w534EkeW089416; Sat, 2 Jun 2018 21:14:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w534EksY089415; Sat, 2 Jun 2018 21:14:46 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806030414.w534EksY089415@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334540 - head/usr.bin/top In-Reply-To: To: Eitan Adler Date: Sat, 2 Jun 2018 21:14:45 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 04:14:50 -0000 > On 2 June 2018 at 16:53, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: eadler > >> Date: Sat Jun 2 21:40:45 2018 > >> New Revision: 334540 > >> URL: https://svnweb.freebsd.org/changeset/base/334540 > >> > >> Log: > >> top(1): cleanup memory allocation and warnings > >> > >> - Prefer calloc over malloc. This is more predicable and we're not in a > >> performance sensitive context. [1] > >> - Remove bogus comment (obsolete from prior commit). [2] > >> - Remove void casts and type casts of NULL > >> - Remove redundant declaration of 'quit' > >> - Add additional const > >> > >> Reported by: kib [1], vangyzen [2] > >> > >> Modified: > >> head/usr.bin/top/display.c > >> head/usr.bin/top/machine.c > >> head/usr.bin/top/screen.c > >> head/usr.bin/top/screen.h > >> head/usr.bin/top/utils.c > > ... > > > >> > >> Modified: head/usr.bin/top/screen.c > >> ============================================================================== > >> --- head/usr.bin/top/screen.c Sat Jun 2 21:16:20 2018 (r334539) > >> +++ head/usr.bin/top/screen.c Sat Jun 2 21:40:45 2018 (r334540) > >> @@ -3,7 +3,7 @@ > >> * Version 3 > >> * > >> * This program may be freely redistributed, > >> - * but this entire comment MUST remain intact. > >> + * but this entire ceomment MUST remain intact. > > > > I know you have already fixed this spelling error, > > but I believe there are some other commits that actually > > removed either this string, or some part of "this entire" > > comment that is to "remain intact". > > I just went through my commits to top(1) and don't see any others. Did > I miss any? Index: commands.c =================================================================== --- commands.c (revision 333898) +++ commands.c (working copy) @@ -1,6 +1,5 @@ /* * Top users/processes display for Unix - * Version 3 * * This program may be freely redistributed, * but this entire comment MUST remain intact. Found with a cd usr.bin/top; svn diff -r 333898 which is when you moved it to usr.bin. Further investigation shows that this line was deleted at r333909. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Jun 3 05:01:51 2018 Return-Path: Delivered-To: svn-src-head@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 222E0FF3B6C for ; Sun, 3 Jun 2018 05:01:51 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C35356ED00 for ; Sun, 3 Jun 2018 05:01:50 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.170]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 8C4F327E56 for ; Sun, 3 Jun 2018 05:01:50 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f170.google.com with SMTP id u124-v6so8388719ywg.0 for ; Sat, 02 Jun 2018 22:01:50 -0700 (PDT) X-Gm-Message-State: APt69E2U1pFGjNZdqH1ej9/ajxmjEeBgn5xc7ozYT1rzsVm5VvS+mRfc 7Is13VnM3Q3SY1d7kwrCWNj61jmgxSqiScy/aezcSg== X-Google-Smtp-Source: ADUXVKKiPCNA4hxl1PwMajl+zWH+PeW4+txwLdurxPMjbuzPxDOPnbfli0QzfpIfQWgzXtpKtRP2gIYRvTC98CiqD8s= X-Received: by 2002:a0d:cf01:: with SMTP id r1-v6mr2998369ywd.162.1528002110052; Sat, 02 Jun 2018 22:01:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 2 Jun 2018 22:01:19 -0700 (PDT) In-Reply-To: <201806030414.w534EksY089415@pdx.rh.CN85.dnsmgr.net> References: <201806030414.w534EksY089415@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Sat, 2 Jun 2018 22:01:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334540 - head/usr.bin/top To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:01:51 -0000 On 2 June 2018 at 21:14, Rodney W. Grimes wrote: >> On 2 June 2018 at 16:53, Rodney W. Grimes >> wrote: >> > [ Charset UTF-8 unsupported, converting... ] >> >> Author: eadler >> >> Date: Sat Jun 2 21:40:45 2018 >> >> New Revision: 334540 >> >> URL: https://svnweb.freebsd.org/changeset/base/334540 >> >> >> >> Log: >> >> top(1): cleanup memory allocation and warnings >> >> >> >> - Prefer calloc over malloc. This is more predicable and we're not in a >> >> performance sensitive context. [1] >> >> - Remove bogus comment (obsolete from prior commit). [2] >> >> - Remove void casts and type casts of NULL >> >> - Remove redundant declaration of 'quit' >> >> - Add additional const >> >> >> >> Reported by: kib [1], vangyzen [2] >> >> >> >> Modified: >> >> head/usr.bin/top/display.c >> >> head/usr.bin/top/machine.c >> >> head/usr.bin/top/screen.c >> >> head/usr.bin/top/screen.h >> >> head/usr.bin/top/utils.c >> > ... >> > >> >> >> >> Modified: head/usr.bin/top/screen.c >> >> ============================================================================== >> >> --- head/usr.bin/top/screen.c Sat Jun 2 21:16:20 2018 (r334539) >> >> +++ head/usr.bin/top/screen.c Sat Jun 2 21:40:45 2018 (r334540) >> >> @@ -3,7 +3,7 @@ >> >> * Version 3 >> >> * >> >> * This program may be freely redistributed, >> >> - * but this entire comment MUST remain intact. >> >> + * but this entire ceomment MUST remain intact. >> > >> > I know you have already fixed this spelling error, >> > but I believe there are some other commits that actually >> > removed either this string, or some part of "this entire" >> > comment that is to "remain intact". >> >> I just went through my commits to top(1) and don't see any others. Did >> I miss any? > > Index: commands.c > =================================================================== > --- commands.c (revision 333898) > +++ commands.c (working copy) > @@ -1,6 +1,5 @@ > /* > * Top users/processes display for Unix > - * Version 3 > * > * This program may be freely redistributed, > * but this entire comment MUST remain intact. > > Found with a cd usr.bin/top; svn diff -r 333898 which is > when you moved it to usr.bin. Further investigation > shows that this line was deleted at r333909. I removed the version line, not the license line. Do you believe "entire comment" includes the version information? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sun Jun 3 05:07:40 2018 Return-Path: Delivered-To: svn-src-head@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 5CFF6FF452C; Sun, 3 Jun 2018 05:07:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D19C6F0A7; Sun, 3 Jun 2018 05:07:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3A341A1D4; Sun, 3 Jun 2018 05:07:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5357djc036536; Sun, 3 Jun 2018 05:07:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5357dA1036534; Sun, 3 Jun 2018 05:07:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806030507.w5357dA1036534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 05:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334551 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:07:40 -0000 Author: eadler Date: Sun Jun 3 05:07:39 2018 New Revision: 334551 URL: https://svnweb.freebsd.org/changeset/base/334551 Log: top(1): use greater warnings One of the downsides of using numeric WARNS is that if we only have a single type of issue we get no protection from other changes. For example, we got no warning for missing variable declaration, due to the issues with "const". For this utility, explicitly list out the warnings which are failing. They should still be fixed, so only reduce them to warning instead of error. Tested with: clang base (amd64, i386), gcc6, gcc7, gcc9, gcc base (mips) Modified: head/usr.bin/top/Makefile head/usr.bin/top/machine.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sun Jun 3 03:53:11 2018 (r334550) +++ head/usr.bin/top/Makefile Sun Jun 3 05:07:39 2018 (r334551) @@ -1,12 +1,22 @@ # $FreeBSD$ +.include + PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c sigdesc.h CFLAGS+= -I ${.OBJDIR} MAN= top.1 -WARNS?= 3 +WARNS?= 6 + +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50000 +CFLAGS.gcc=-Wno-error=cast-align -Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ + -Wno-error=maybe-uninitialized +.else #base gcc +NO_WERROR= +.endif +CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -Wno-error=cast-align LIBADD= ncursesw m kvm jail Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 03:53:11 2018 (r334550) +++ head/usr.bin/top/machine.c Sun Jun 3 05:07:39 2018 (r334551) @@ -229,7 +229,7 @@ static int pageshift; /* log base 2 of the pagesize * /* * Sorting orders. The first element is the default. */ -char *ordernames[] = { +static const char *ordernames[] = { "cpu", "size", "res", "time", "pri", "threads", "total", "read", "write", "fault", "vcsw", "ivcsw", "jid", "swap", "pid", NULL From owner-svn-src-head@freebsd.org Sun Jun 3 05:07:48 2018 Return-Path: Delivered-To: svn-src-head@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 A30D2FF45A1; Sun, 3 Jun 2018 05:07:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDD36F168; Sun, 3 Jun 2018 05:07:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A48C1A1D5; Sun, 3 Jun 2018 05:07:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5357ke2036584; Sun, 3 Jun 2018 05:07:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5357kMm036583; Sun, 3 Jun 2018 05:07:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806030507.w5357kMm036583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 05:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334552 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:07:48 -0000 Author: eadler Date: Sun Jun 3 05:07:46 2018 New Revision: 334552 URL: https://svnweb.freebsd.org/changeset/base/334552 Log: top(1): remove chdir to / While this came out of a conversation in IRC, it turn out that some people don't like it. Since this was a courtesy feature, just remove it. Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 3 05:07:39 2018 (r334551) +++ head/usr.bin/top/top.c Sun Jun 3 05:07:46 2018 (r334552) @@ -260,15 +260,6 @@ main(int argc, char *argv[]) #define CMD_order 26 #define CMD_pid 27 - /* - * Since top(1) is often long running and - * doesn't typically care about where its running from - * chdir to the root to allow unmounting of its - * original wd. Failure is alright as this is - * just a courtesy for users. - */ - chdir("/"); - /* set the buffer for stdout */ #ifdef DEBUG extern FILE *debug; From owner-svn-src-head@freebsd.org Sun Jun 3 05:08:45 2018 Return-Path: Delivered-To: svn-src-head@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 7B957FF478D for ; Sun, 3 Jun 2018 05:08:45 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2409C6F339 for ; Sun, 3 Jun 2018 05:08:45 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f170.google.com (mail-yb0-f170.google.com [209.85.213.170]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id E337527F68 for ; Sun, 3 Jun 2018 05:08:44 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f170.google.com with SMTP id v17-v6so752404ybe.7 for ; Sat, 02 Jun 2018 22:08:44 -0700 (PDT) X-Gm-Message-State: APt69E10wtdYacFqounUIa5v4BJNdyHORYvzwpREXkGA4hmN+PTVT5W0 Uy3gGn+s8jVVlV5UaSLmdWVSNEHOSxsDbD1OymW9Kg== X-Google-Smtp-Source: ADUXVKLDdXmY9SOq50CtxxE+nnk0QbREk2V0LWceBILmv9Pu/dGY30s8+A93PPDQFHO/V0qUx5QRf+cv6XsJcAvp+gI= X-Received: by 2002:a5b:64c:: with SMTP id o12-v6mr5873213ybq.460.1528002524399; Sat, 02 Jun 2018 22:08:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 2 Jun 2018 22:08:13 -0700 (PDT) In-Reply-To: <201806022356.w52NuiFK088665@pdx.rh.CN85.dnsmgr.net> References: <201806022206.w52M6S98020830@repo.freebsd.org> <201806022356.w52NuiFK088665@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Sat, 2 Jun 2018 22:08:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334543 - head/usr.bin/top To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:08:45 -0000 On 2 June 2018 at 16:56, Rodney W. Grimes wrote: >> Author: eadler >> Date: Sat Jun 2 22:06:27 2018 >> New Revision: 334543 >> URL: https://svnweb.freebsd.org/changeset/base/334543 >> >> Log: >> top(1): chdir to / as init; remove unneeded comment >> >> - chdir to / to allow unmounting of wd >> - remove warning about running top(1) as setuid. If this is a concern we >> should just drop privs instead. >> >> Modified: >> head/usr.bin/top/machine.c >> head/usr.bin/top/top.c >> >> Modified: head/usr.bin/top/machine.c >> ============================================================================== >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 (r334542) >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 (r334543) >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) >> /* >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 if >> * the process does not exist. >> - * It is EXTREMELY IMPORTANT that this function work correctly. >> - * If top runs setuid root (as in SVR4), then this function >> - * is the only thing that stands in the way of a serious >> - * security problem. It validates requests for the "kill" >> - * and "renice" commands. >> */ >> >> int >> >> Modified: head/usr.bin/top/top.c >> ============================================================================== >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) >> #define CMD_order 26 >> #define CMD_pid 27 >> >> + /* >> + * Since top(1) is often long running and >> + * doesn't typically care about where its running from >> + * chdir to the root to allow unmounting of its >> + * originall wd. Failure is alright as this is >> + * just a courtesy for users. >> + */ >> + chdir("/"); >> + > > Bad side effect of doing that is it is not hard to get a "core" > from top when run as a user, as it is going to try to write > to /, and it probably does not have permission for that. Another person made the point that other similar applications don't do this, so I just reverted it. thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sun Jun 3 05:20:13 2018 Return-Path: Delivered-To: svn-src-head@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 AE7B7FF5858; Sun, 3 Jun 2018 05:20:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9CC6FB62; Sun, 3 Jun 2018 05:20:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 240A91A382; Sun, 3 Jun 2018 05:20:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w535KCSF041724; Sun, 3 Jun 2018 05:20:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w535KB8c041717; Sun, 3 Jun 2018 05:20:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806030520.w535KB8c041717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 05:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334553 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:20:14 -0000 Author: eadler Date: Sun Jun 3 05:20:11 2018 New Revision: 334553 URL: https://svnweb.freebsd.org/changeset/base/334553 Log: top(1): partial revert of r334517 In fixing issues with uid > INT_MAX, I broke the uid without username case. The latter is more important so return the old state. Discussed with: allanjude Modified: head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/username.c head/usr.bin/top/username.h head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/machine.c Sun Jun 3 05:20:11 2018 (r334553) @@ -918,7 +918,7 @@ get_process_info(struct system_info *si, struct proces static char fmt[512]; /* static area where result is built */ char * -format_next_process(caddr_t xhandle, char *(*get_userid)(uid_t), int flags) +format_next_process(caddr_t xhandle, char *(*get_userid)(int), int flags) { struct kinfo_proc *pp; const struct kinfo_proc *oldp; Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/machine.h Sun Jun 3 05:20:11 2018 (r334553) @@ -76,7 +76,7 @@ struct process_select /* routines defined by the machine dependent module */ char *format_header(char *uname_field); -char *format_next_process(caddr_t handle, char *(*get_userid)(uid_t), +char *format_next_process(caddr_t handle, char *(*get_userid)(int), int flags); void toggle_pcpustats(void); void get_system_info(struct system_info *si); Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/top.c Sun Jun 3 05:20:11 2018 (r334553) @@ -206,7 +206,7 @@ main(int argc, char *argv[]) int displays = 0; /* indicates unspecified */ int sel_ret = 0; time_t curr_time; - char *(*get_userid)(uid_t) = username; + char *(*get_userid)(int) = username; char *uname_field = "USERNAME"; char *header_text; char *env_top; Modified: head/usr.bin/top/username.c ============================================================================== --- head/usr.bin/top/username.c Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/username.c Sun Jun 3 05:20:11 2018 (r334553) @@ -37,27 +37,26 @@ #include #include #include -#include #include "utils.h" #include "username.h" struct hash_el { - uid_t uid; + int uid; char name[MAXLOGNAME]; }; #define is_empty_hash(x) (hash_table[x].name[0] == 0) /* simple minded hashing function */ -#define hashit(i) (i % Table_size) +#define hashit(i) (abs(i) % Table_size) /* K&R requires that statically declared tables be initialized to zero. */ /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ static struct hash_el hash_table[Table_size]; -char *username(uid_t uid) +char *username(int uid) { int hashindex; @@ -70,7 +69,7 @@ char *username(uid_t uid) return(hash_table[hashindex].name); } -uid_t userid(char username[]) +int userid(char username[]) { struct passwd *pwd; @@ -91,7 +90,7 @@ uid_t userid(char username[]) } /* wecare 1 = enter it always, 0 = nice to have */ -int enter_user(uid_t uid, char name[], bool wecare) +int enter_user(int uid, char name[], bool wecare) { int hashindex; @@ -122,7 +121,7 @@ int enter_user(uid_t uid, char name[], bool wecare) */ int -get_user(uid_t uid) +get_user(int uid) { struct passwd *pwd; Modified: head/usr.bin/top/username.h ============================================================================== --- head/usr.bin/top/username.h Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/username.h Sun Jun 3 05:20:11 2018 (r334553) @@ -12,13 +12,12 @@ #define USERNAME_H #include -#include -int enter_user(uid_t uid, char *name, bool wecare); -int get_user(uid_t uid); +int enter_user(int uid, char *name, bool wecare); +int get_user(int uid); void init_hash(void); -char *username(uid_t uid); -uid_t userid(char *username); +char *username(int uid); +int userid(char *username); /* * "Table_size" defines the size of the hash tables used to map uid to Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/utils.c Sun Jun 3 05:20:11 2018 (r334553) @@ -89,12 +89,12 @@ char *itoa(unsigned int val) } /* - * itoa7(val) - like itoa, except the number is right justified in a 7 + * (val) - like itoa, except the number is right justified in a 7 * character field. This code is a duplication of itoa instead of * a front end to a more general routine for efficiency. */ -char *itoa7(unsigned int val) +char *itoa7(int val) { char *ptr; static char buffer[16]; /* result is built here */ Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Sun Jun 3 05:07:46 2018 (r334552) +++ head/usr.bin/top/utils.h Sun Jun 3 05:20:11 2018 (r334553) @@ -14,7 +14,7 @@ int atoiwi(const char *); char *itoa(unsigned int); -char *itoa7(unsigned int); +char *itoa7(int); int digits(int); char **argparse(char *, int *); long percentages(int, int *, long *, long *, long *); From owner-svn-src-head@freebsd.org Sun Jun 3 06:02:32 2018 Return-Path: Delivered-To: svn-src-head@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 4A3F3EFA4A8; Sun, 3 Jun 2018 06:02:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0E9C71991; Sun, 3 Jun 2018 06:02:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1EA81AB8A; Sun, 3 Jun 2018 06:02:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5362VdQ066717; Sun, 3 Jun 2018 06:02:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5362VuJ066716; Sun, 3 Jun 2018 06:02:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806030602.w5362VuJ066716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 06:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334554 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 06:02:32 -0000 Author: eadler Date: Sun Jun 3 06:02:31 2018 New Revision: 334554 URL: https://svnweb.freebsd.org/changeset/base/334554 Log: top(1): Only use NO_WERROR for base gcc This is what was intended. If statements are hard. Modified: head/usr.bin/top/Makefile Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sun Jun 3 05:20:11 2018 (r334553) +++ head/usr.bin/top/Makefile Sun Jun 3 06:02:31 2018 (r334554) @@ -10,11 +10,13 @@ MAN= top.1 WARNS?= 6 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50000 +.if ${COMPILER_TYPE} == "gcc" +.if ${COMPILER_VERSION} >= 50000 CFLAGS.gcc=-Wno-error=cast-align -Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ -Wno-error=maybe-uninitialized .else #base gcc NO_WERROR= +.endif .endif CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -Wno-error=cast-align From owner-svn-src-head@freebsd.org Sun Jun 3 06:51:16 2018 Return-Path: Delivered-To: svn-src-head@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 A0ACDEFF9C8; Sun, 3 Jun 2018 06:51:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D703473CB6; Sun, 3 Jun 2018 06:51:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w536pCoC089862; Sat, 2 Jun 2018 23:51:12 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w536pCYd089861; Sat, 2 Jun 2018 23:51:12 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806030651.w536pCYd089861@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334540 - head/usr.bin/top In-Reply-To: To: Eitan Adler Date: Sat, 2 Jun 2018 23:51:12 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 06:51:16 -0000 [ Charset UTF-8 unsupported, converting... ] > On 2 June 2018 at 21:14, Rodney W. Grimes > wrote: > >> On 2 June 2018 at 16:53, Rodney W. Grimes > >> wrote: > >> > [ Charset UTF-8 unsupported, converting... ] > >> >> Author: eadler > >> >> Date: Sat Jun 2 21:40:45 2018 > >> >> New Revision: 334540 > >> >> URL: https://svnweb.freebsd.org/changeset/base/334540 > >> >> > >> >> Log: > >> >> top(1): cleanup memory allocation and warnings > >> >> > >> >> - Prefer calloc over malloc. This is more predicable and we're not in a > >> >> performance sensitive context. [1] > >> >> - Remove bogus comment (obsolete from prior commit). [2] > >> >> - Remove void casts and type casts of NULL > >> >> - Remove redundant declaration of 'quit' > >> >> - Add additional const > >> >> > >> >> Reported by: kib [1], vangyzen [2] > >> >> > >> >> Modified: > >> >> head/usr.bin/top/display.c > >> >> head/usr.bin/top/machine.c > >> >> head/usr.bin/top/screen.c > >> >> head/usr.bin/top/screen.h > >> >> head/usr.bin/top/utils.c > >> > ... > >> > > >> >> > >> >> Modified: head/usr.bin/top/screen.c > >> >> ============================================================================== > >> >> --- head/usr.bin/top/screen.c Sat Jun 2 21:16:20 2018 (r334539) > >> >> +++ head/usr.bin/top/screen.c Sat Jun 2 21:40:45 2018 (r334540) > >> >> @@ -3,7 +3,7 @@ > >> >> * Version 3 > >> >> * > >> >> * This program may be freely redistributed, > >> >> - * but this entire comment MUST remain intact. > >> >> + * but this entire ceomment MUST remain intact. > >> > > >> > I know you have already fixed this spelling error, > >> > but I believe there are some other commits that actually > >> > removed either this string, or some part of "this entire" > >> > comment that is to "remain intact". > >> > >> I just went through my commits to top(1) and don't see any others. Did > >> I miss any? > > > > Index: commands.c > > =================================================================== > > --- commands.c (revision 333898) > > +++ commands.c (working copy) > > @@ -1,6 +1,5 @@ > > /* > > * Top users/processes display for Unix > > - * Version 3 > > * > > * This program may be freely redistributed, > > * but this entire comment MUST remain intact. > > > > Found with a cd usr.bin/top; svn diff -r 333898 which is > > when you moved it to usr.bin. Further investigation > > shows that this line was deleted at r333909. > > I removed the version line, not the license line. Do you believe > "entire comment" includes the version information? I would interpret entire to be anything between /* and */. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Jun 3 10:04:50 2018 Return-Path: Delivered-To: svn-src-head@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 2CB6CFDF1D2; Sun, 3 Jun 2018 10:04:50 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A880E7C50D; Sun, 3 Jun 2018 10:04:49 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [10.54.165.156] (unknown [88.128.80.153]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 6234C72106C13; Sun, 3 Jun 2018 12:04:46 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334554 - head/usr.bin/top From: Michael Tuexen In-Reply-To: <201806030602.w5362VuJ066716@repo.freebsd.org> Date: Sun, 3 Jun 2018 12:04:45 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <780B5AE9-CB7E-4668-9BF2-4E6FC62DD2E3@macmic.franken.de> References: <201806030602.w5362VuJ066716@repo.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.3445.8.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 10:04:50 -0000 top doesn't work on a amd64 (64 logical cores) and on an arm64 (8 cores) system anymore (world and kernel are in sync): tuexen@epyc:~ % uname -a FreeBSD epyc.nplab.de 12.0-CURRENT FreeBSD 12.0-CURRENT #5 r334554: Sun = Jun 3 11:26:58 CEST 2018 = root@epyc.nplab.de:/usr/obj/usr/home/tuexen/head/amd64.amd64/sys/GENERIC = amd64 tuexen@epyc:~ % top top: sysctlbyname kern.cp_times: Cannot allocate memory FreeBSD bsd14.fh-muenster.de 12.0-CURRENT FreeBSD 12.0-CURRENT #16 = r334554: Sun Jun 3 11:47:38 CEST 2018 = root@bsd14.fh-muenster.de:/usr/obj/usr/home/tuexen/head/arm64.aarch64/sys/= GENERIC arm64 tuexen@bsd14:~ % top top: sysctlbyname kern.cp_times: Cannot allocate memory Best regards Michael > On 3. Jun 2018, at 08:02, Eitan Adler wrote: >=20 > Author: eadler > Date: Sun Jun 3 06:02:31 2018 > New Revision: 334554 > URL: https://svnweb.freebsd.org/changeset/base/334554 >=20 > Log: > top(1): Only use NO_WERROR for base gcc >=20 > This is what was intended. If statements are hard. >=20 > Modified: > head/usr.bin/top/Makefile >=20 > Modified: head/usr.bin/top/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/top/Makefile Sun Jun 3 05:20:11 2018 = (r334553) > +++ head/usr.bin/top/Makefile Sun Jun 3 06:02:31 2018 = (r334554) > @@ -10,11 +10,13 @@ MAN=3D top.1 >=20 > WARNS?=3D 6 >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50000 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > +.if ${COMPILER_VERSION} >=3D 50000 > CFLAGS.gcc=3D-Wno-error=3Dcast-align -Wno-error=3Dcast-qual = -Wno-error=3Ddiscarded-qualifiers -Wno-error=3Dincompatible-pointer-types = \ > -Wno-error=3Dmaybe-uninitialized > .else #base gcc > NO_WERROR=3D > +.endif > .endif > CFLAGS.clang=3D-Wno-error=3Dincompatible-pointer-types-discards-qualifie= rs -Wno-error=3Dcast-qual -Wno-error=3Dcast-align >=20 >=20 From owner-svn-src-head@freebsd.org Sun Jun 3 10:53:11 2018 Return-Path: Delivered-To: svn-src-head@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 39DDFEF7FB8; Sun, 3 Jun 2018 10:53:11 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E38007E765; Sun, 3 Jun 2018 10:53:10 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C49621DAC6; Sun, 3 Jun 2018 10:53:10 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53ArAFY015446; Sun, 3 Jun 2018 10:53:10 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53ArALl015445; Sun, 3 Jun 2018 10:53:10 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201806031053.w53ArALl015445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Jun 2018 10:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334555 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 334555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 10:53:11 -0000 Author: wulf Date: Sun Jun 3 10:53:10 2018 New Revision: 334555 URL: https://svnweb.freebsd.org/changeset/base/334555 Log: [evdev] Sync event codes with Linux kernel 4.16 MFC after: 2 weeks Modified: head/sys/dev/evdev/input-event-codes.h head/sys/dev/evdev/input.h Modified: head/sys/dev/evdev/input-event-codes.h ============================================================================== --- head/sys/dev/evdev/input-event-codes.h Sun Jun 3 06:02:31 2018 (r334554) +++ head/sys/dev/evdev/input-event-codes.h Sun Jun 3 10:53:10 2018 (r334555) @@ -421,6 +421,7 @@ #define BTN_TOOL_MOUSE 0x146 #define BTN_TOOL_LENS 0x147 #define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ +#define BTN_STYLUS3 0x149 #define BTN_TOUCH 0x14a #define BTN_STYLUS 0x14b #define BTN_STYLUS2 0x14c @@ -607,6 +608,7 @@ #define BTN_DPAD_RIGHT 0x223 #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ +#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */ #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ @@ -615,6 +617,7 @@ #define KEY_APPSELECT 0x244 /* AL Select Task/Application */ #define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ +#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ @@ -626,6 +629,38 @@ #define KEY_KBDINPUTASSIST_ACCEPT 0x264 #define KEY_KBDINPUTASSIST_CANCEL 0x265 +/* Diagonal movement keys */ +#define KEY_RIGHT_UP 0x266 +#define KEY_RIGHT_DOWN 0x267 +#define KEY_LEFT_UP 0x268 +#define KEY_LEFT_DOWN 0x269 + +#define KEY_ROOT_MENU 0x26a /* Show Device's Root Menu */ +/* Show Top Menu of the Media (e.g. DVD) */ +#define KEY_MEDIA_TOP_MENU 0x26b +#define KEY_NUMERIC_11 0x26c +#define KEY_NUMERIC_12 0x26d +/* + * Toggle Audio Description: refers to an audio service that helps blind and + * visually impaired consumers understand the action in a program. Note: in + * some countries this is referred to as "Video Description". + */ +#define KEY_AUDIO_DESC 0x26e +#define KEY_3D_MODE 0x26f +#define KEY_NEXT_FAVORITE 0x270 +#define KEY_STOP_RECORD 0x271 +#define KEY_PAUSE_RECORD 0x272 +#define KEY_VOD 0x273 /* Video on Demand */ +#define KEY_UNMUTE 0x274 +#define KEY_FASTREVERSE 0x275 +#define KEY_SLOWREVERSE 0x276 +/* + * Control a data application associated with the currently viewed channel, + * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.) + */ +#define KEY_DATA 0x277 +#define KEY_ONSCREEN_KEYBOARD 0x278 + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1 @@ -763,6 +798,7 @@ #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ +#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ #define SW_MAX 0x0f #define SW_CNT (SW_MAX+1) Modified: head/sys/dev/evdev/input.h ============================================================================== --- head/sys/dev/evdev/input.h Sun Jun 3 06:02:31 2018 (r334554) +++ head/sys/dev/evdev/input.h Sun Jun 3 10:53:10 2018 (r334555) @@ -38,6 +38,9 @@ #include "input-event-codes.h" +#define input_event_sec time.tv_sec +#define input_event_usec time.tv_usec + struct input_event { struct timeval time; uint16_t type; @@ -138,6 +141,9 @@ struct input_keymap_entry { #define BUS_GSC 0x1A #define BUS_ATARI 0x1B #define BUS_SPI 0x1C +#define BUS_RMI 0x1D +#define BUS_CEC 0x1E +#define BUS_INTEL_ISHTP 0x1F /* * MT_TOOL types From owner-svn-src-head@freebsd.org Sun Jun 3 13:41:00 2018 Return-Path: Delivered-To: svn-src-head@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 73EE4F7F557; Sun, 3 Jun 2018 13:41:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 255AD85CE0; Sun, 3 Jun 2018 13:41:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E191F1F4E2; Sun, 3 Jun 2018 13:40:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53DexTk000757; Sun, 3 Jun 2018 13:40:59 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53DexRQ000755; Sun, 3 Jun 2018 13:40:59 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031340.w53DexRQ000755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 13:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334556 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 13:41:00 -0000 Author: pstef Date: Sun Jun 3 13:40:58 2018 New Revision: 334556 URL: https://svnweb.freebsd.org/changeset/base/334556 Log: indent(1): remove undocumented and rather useless option (-ps) It's used to treat the "->" access operator as a binary operator and put space characters around it. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 10:53:10 2018 (r334555) +++ head/usr.bin/indent/args.c Sun Jun 3 13:40:58 2018 (r334556) @@ -154,7 +154,6 @@ struct pro { {"npcs", PRO_BOOL, false, OFF, &proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, {"npsl", PRO_BOOL, true, OFF, &procnames_start_line}, - {"nps", PRO_BOOL, false, OFF, &pointer_as_binop}, {"nsac", PRO_BOOL, false, OFF, &space_after_cast}, {"nsc", PRO_BOOL, true, OFF, &star_comment_cont}, {"nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines}, @@ -162,7 +161,6 @@ struct pro { {"nv", PRO_BOOL, false, OFF, &verbose}, {"pcs", PRO_BOOL, false, ON, &proc_calls_space}, {"psl", PRO_BOOL, true, ON, &procnames_start_line}, - {"ps", PRO_BOOL, false, ON, &pointer_as_binop}, {"sac", PRO_BOOL, false, ON, &space_after_cast}, {"sc", PRO_BOOL, true, ON, &star_comment_cont}, {"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines}, Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 10:53:10 2018 (r334555) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 13:40:58 2018 (r334556) @@ -136,7 +136,6 @@ char *be_save; /* similarly saved value of buf_ int found_err; -int pointer_as_binop; int blanklines_after_declarations; int blanklines_before_blockcomments; int blanklines_after_procs; Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 10:53:10 2018 (r334555) +++ head/usr.bin/indent/lexi.c Sun Jun 3 13:40:58 2018 (r334556) @@ -546,11 +546,9 @@ stop_lit: else if (*buf_ptr == '>') { /* check for operator -> */ *e_token++ = *buf_ptr++; - if (!pointer_as_binop) { - unary_delim = false; - code = unary_op; - ps.want_blank = false; - } + unary_delim = false; + code = unary_op; + ps.want_blank = false; } break; /* buffer overflow will be checked at end of * switch */ From owner-svn-src-head@freebsd.org Sun Jun 3 13:41:24 2018 Return-Path: Delivered-To: svn-src-head@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 CF789F7F6B8; Sun, 3 Jun 2018 13:41:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE8F85E8F; Sun, 3 Jun 2018 13:41:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D6CD1F507; Sun, 3 Jun 2018 13:41:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53DfO6m000820; Sun, 3 Jun 2018 13:41:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53DfOAD000819; Sun, 3 Jun 2018 13:41:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806031341.w53DfOAD000819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 13:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334557 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 13:41:25 -0000 Author: eadler Date: Sun Jun 3 13:41:23 2018 New Revision: 334557 URL: https://svnweb.freebsd.org/changeset/base/334557 Log: top(1): restore size for kern.cp_times Restore last minute change that broke top(1). Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 13:40:58 2018 (r334556) +++ head/usr.bin/top/machine.c Sun Jun 3 13:41:23 2018 (r334557) @@ -384,6 +384,7 @@ machine_init(struct statics *statics) times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) err(1, "calloc %zu bytes", size); + size = sizeof(long) * maxcpu * CPUSTATES; if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); From owner-svn-src-head@freebsd.org Sun Jun 3 14:03:21 2018 Return-Path: Delivered-To: svn-src-head@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 7D608FD175A; Sun, 3 Jun 2018 14:03:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30AFD8713B; Sun, 3 Jun 2018 14:03:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1334E1F993; Sun, 3 Jun 2018 14:03:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53E3Kak011135; Sun, 3 Jun 2018 14:03:20 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53E3KnZ011132; Sun, 3 Jun 2018 14:03:20 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031403.w53E3KnZ011132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 14:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334559 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 14:03:21 -0000 Author: pstef Date: Sun Jun 3 14:03:20 2018 New Revision: 334559 URL: https://svnweb.freebsd.org/changeset/base/334559 Log: indent(1): improve handling of comments and newlines between "if (...)" or "while (...)" and "else" or "{" * Don't flush newlines - there can be multiple of them and they can happen before a token that isn't else or {. Instead, always store them in save_com. * Don't dump the buffer's contents on newline assuming that there is only one comment before else or {. * Avoid producing surplus newlines, especially before else when -ce is on. * When -bl is on, don't treat { as a comment (was implemented by falling through "case lbrace:" to "case comment:"). This commit fixes the above, but exposes another bug and thus breaks several other tests. Another commit will make them pass again. Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/tests/elsecomment.0 head/usr.bin/indent/tests/elsecomment.0.stdout Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 13:54:22 2018 (r334558) +++ head/usr.bin/indent/indent.c Sun Jun 3 14:03:20 2018 (r334559) @@ -84,8 +84,6 @@ main(int argc, char **argv) int dec_ind; /* current indentation for declarations */ int di_stack[20]; /* a stack of structure indentation levels */ - int flushed_nl; /* used when buffering up comments to remember - * that a newline was passed over */ int force_nl; /* when true, code must be broken */ int hd_type = 0; /* used to store type of stmt for if (...), * for (...), etc */ @@ -324,6 +322,7 @@ main(int argc, char **argv) while (1) { /* this is the main loop. it will go until we * reach eof */ int is_procname; + int comment_buffered = false; type_code = lexi(); /* lexi reads one token. The actual * characters read are stored in "token". lexi @@ -331,132 +330,139 @@ main(int argc, char **argv) is_procname = ps.procname[0]; /* - * The following code moves everything following an if (), while (), - * else, etc. up to the start of the following stmt to a buffer. This - * allows proper handling of both kinds of brace placement. + * The following code moves newlines and comments following an if (), + * while (), else, etc. up to the start of the following stmt to + * a buffer. This allows proper handling of both kinds of brace + * placement (-br, -bl) and cuddling "else" (-ce). */ - flushed_nl = false; - while (ps.search_brace) { /* if we scanned an if(), while(), - * etc., we might need to copy stuff - * into a buffer we must loop, copying - * stuff into save_com, until we find - * the start of the stmt which follows - * the if, or whatever */ + while (ps.search_brace) { switch (type_code) { case newline: - ++line_no; - if (sc_end != NULL) { /* dump comment, if any */ - *sc_end++ = '\n'; /* newlines are needed in this case */ - goto sw_buffer; + if (sc_end == NULL) { + save_com[0] = save_com[1] = ' '; + sc_end = &save_com[2]; } - flushed_nl = true; + *sc_end++ = '\n'; + /* + * We may have inherited a force_nl == true from the previous + * token (like a semicolon). But once we know that a newline + * has been scanned in this loop, force_nl should be false. + * + * However, the force_nl == true must be preserved if newline + * is never scanned in this loop, so this assignment cannot be + * done earlier. + */ + force_nl = false; case form_feed: - break; /* form feeds and newlines found here will be - * ignored */ - - case lbrace: /* this is a brace that starts the compound - * stmt */ - if (sc_end == NULL) { /* ignore buffering if a comment wasn't - * stored up */ - ps.search_brace = false; - goto check_type; + break; + case comment: + if (sc_end == NULL) { + save_com[0] = save_com[1] = ' '; + sc_end = &save_com[2]; } - if (btype_2) { - save_com[0] = '{'; /* we either want to put the brace - * right after the if */ - goto sw_buffer; /* go to common code to get out of - * this loop */ - } - case comment: /* we have a comment, so we must copy it into - * the buffer */ - if (!flushed_nl || sc_end != NULL) { - if (sc_end == NULL) { /* if this is the first comment, we - * must set up the buffer */ - save_com[0] = save_com[1] = ' '; - sc_end = &(save_com[2]); + comment_buffered = true; + *sc_end++ = '/'; /* copy in start of comment */ + *sc_end++ = '*'; + for (;;) { /* loop until we get to the end of the comment */ + *sc_end = *buf_ptr++; + if (buf_ptr >= buf_end) + fill_buffer(); + if (*sc_end++ == '*' && *buf_ptr == '/') + break; /* we are at end of comment */ + if (sc_end >= &save_com[sc_size]) { /* check for temp buffer + * overflow */ + diag2(1, "Internal buffer overflow - Move big comment from right after if, while, or whatever"); + fflush(output); + exit(1); } - else { - *sc_end++ = '\n'; /* add newline between - * comments */ - *sc_end++ = ' '; - --line_no; - } - *sc_end++ = '/'; /* copy in start of comment */ - *sc_end++ = '*'; - - for (;;) { /* loop until we get to the end of the comment */ - *sc_end = *buf_ptr++; - if (buf_ptr >= buf_end) + } + *sc_end++ = '/'; /* add ending slash */ + if (++buf_ptr >= buf_end) /* get past / in buffer */ + fill_buffer(); + break; + case lbrace: + /* + * Put KNF-style lbraces before the buffered up tokens and + * jump out of this loop in order to avoid copying the token + * again under the default case of the switch below. + */ + if (sc_end != NULL && btype_2) { + save_com[0] = '{'; + /* + * Originally the lbrace may have been alone on its own + * line, but it will be moved into "the else's line", so + * if there was a newline resulting from the "{" before, + * it must be scanned now and ignored. + */ + while (isspace((int)*buf_ptr)) { + if (++buf_ptr >= buf_end) fill_buffer(); - - if (*sc_end++ == '*' && *buf_ptr == '/') - break; /* we are at end of comment */ - - if (sc_end >= &(save_com[sc_size])) { /* check for temp buffer - * overflow */ - diag2(1, "Internal buffer overflow - Move big comment from right after if, while, or whatever"); - fflush(output); - exit(1); - } + if (*buf_ptr == '\n') + break; } - *sc_end++ = '/'; /* add ending slash */ - if (++buf_ptr >= buf_end) /* get past / in buffer */ - fill_buffer(); - break; + goto sw_buffer; } + /* FALLTHROUGH */ default: /* it is the start of a normal statement */ - if (flushed_nl) /* if we flushed a newline, make sure it is - * put back */ - force_nl = true; - if ((type_code == sp_paren && *token == 'i' - && last_else && ps.else_if) - || (type_code == sp_nparen && *token == 'e' - && e_code != s_code && e_code[-1] == '}')) - force_nl = false; + { + int remove_newlines; - if (sc_end == NULL) { /* ignore buffering if comment wasn't - * saved up */ - ps.search_brace = false; - goto check_type; - } - if (force_nl) { /* if we should insert a nl here, put it into - * the buffer */ - force_nl = false; - --line_no; /* this will be re-increased when the nl is - * read from the buffer */ - *sc_end++ = '\n'; - *sc_end++ = ' '; - if (verbose && !flushed_nl) /* print error msg if the line - * was not already broken */ - diag2(0, "Line broken"); - flushed_nl = false; - } - for (t_ptr = token; *t_ptr; ++t_ptr) - *sc_end++ = *t_ptr; /* copy token into temp buffer */ - ps.procname[0] = 0; + remove_newlines = + /* "} else" */ + (type_code == sp_nparen && *token == 'e' && + e_code != s_code && e_code[-1] == '}') + /* "else if" */ + || (type_code == sp_paren && *token == 'i' && + last_else && ps.else_if); + if (remove_newlines) + force_nl = false; + if (sc_end == NULL) { /* ignore buffering if + * comment wasn't saved up */ + ps.search_brace = false; + goto check_type; + } + while (sc_end > save_com && isblank((int)sc_end[-1])) { + sc_end--; + } + if (swallow_optional_blanklines || + (!comment_buffered && remove_newlines)) { + force_nl = !remove_newlines; + while (sc_end > save_com && sc_end[-1] == '\n') { + sc_end--; + } + } + if (force_nl) { /* if we should insert a nl here, put + * it into the buffer */ + force_nl = false; + --line_no; /* this will be re-increased when the + * newline is read from the buffer */ + *sc_end++ = '\n'; + *sc_end++ = ' '; + if (verbose) /* print error msg if the line was + * not already broken */ + diag2(0, "Line broken"); + } + for (t_ptr = token; *t_ptr; ++t_ptr) + *sc_end++ = *t_ptr; - sw_buffer: - ps.search_brace = false; /* stop looking for start of + sw_buffer: + ps.search_brace = false; /* stop looking for start of * stmt */ - bp_save = buf_ptr; /* save current input buffer */ - be_save = buf_end; - buf_ptr = save_com; /* fix so that subsequent calls to + bp_save = buf_ptr; /* save current input buffer */ + be_save = buf_end; + buf_ptr = save_com; /* fix so that subsequent calls to * lexi will take tokens out of * save_com */ - *sc_end++ = ' ';/* add trailing blank, just in case */ - buf_end = sc_end; - sc_end = NULL; - break; + *sc_end++ = ' ';/* add trailing blank, just in case */ + buf_end = sc_end; + sc_end = NULL; + break; + } } /* end of switch */ if (type_code != 0) /* we must make this check, just in case there * was an unexpected EOF */ type_code = lexi(); /* read another token */ - /* if (ps.search_brace) ps.procname[0] = 0; */ - if ((is_procname = ps.procname[0]) && flushed_nl - && !procnames_start_line && ps.in_decl - && type_code == ident) - flushed_nl = 0; } /* end of while (search_brace) */ last_else = 0; check_type: @@ -485,9 +491,8 @@ check_type: (type_code != semicolon) && (type_code != lbrace || !btype_2)) { /* we should force a broken line here */ - if (verbose && !flushed_nl) + if (verbose) diag2(0, "Line broken"); - flushed_nl = false; dump_line(); ps.want_blank = false; /* dont insert blank at line start */ force_nl = false; @@ -1211,11 +1216,6 @@ check_type: * character will cause the line to be printed */ case comment: /* we have gotten a / followed by * this is a biggie */ - if (flushed_nl) { /* we should force a broken line here */ - dump_line(); - ps.want_blank = false; /* dont insert blank at line start */ - force_nl = false; - } pr_comment(); break; } /* end of big switch stmt */ Modified: head/usr.bin/indent/tests/elsecomment.0 ============================================================================== --- head/usr.bin/indent/tests/elsecomment.0 Sun Jun 3 13:54:22 2018 (r334558) +++ head/usr.bin/indent/tests/elsecomment.0 Sun Jun 3 14:03:20 2018 (r334559) @@ -1,18 +1,42 @@ /* $FreeBSD$ */ /* See r303484 and r309342 */ void t(void) { - if (0) { + /* The two if statements below excercise two different code paths. */ - } /* Old indent would remove the following blank line */ + if (1) /* a */ int a; else /* b */ int b; - /* - * test - */ + if (1) /* a */ + int a; + else /* b */ + int b; + if (1) { + + } + + + + /* Old indent would remove the 3 blank lines above, awaiting "else". */ + + if (1) { + int a; + } + + + else if (0) { + int b; + } + /* test */ + else + ; + if (1) ; else /* Old indent would get very confused here */ + /* We also mustn't assume that there's only one comment */ + /* before the left brace. */ { + } } Modified: head/usr.bin/indent/tests/elsecomment.0.stdout ============================================================================== --- head/usr.bin/indent/tests/elsecomment.0.stdout Sun Jun 3 13:54:22 2018 (r334558) +++ head/usr.bin/indent/tests/elsecomment.0.stdout Sun Jun 3 14:03:20 2018 (r334559) @@ -3,20 +3,45 @@ void t(void) { - if (0) + /* The two if statements below excercise two different code paths. */ + + if (1) /* a */ + int a; + else /* b */ + int b; + + if (1) /* a */ + int a; + else /* b */ + int b; + + if (1) { - } /* Old indent would remove the following - * blank line */ + } - /* - * test - */ + + /* Old indent would remove the 3 blank lines above, awaiting "else". */ + if (1) + { + int a; + } else if (0) + { + int b; + } + /* test */ + else ; + + if (1) + ; else /* Old indent would get very confused here */ + /* We also mustn't assume that there's only one comment */ + /* before the left brace. */ { + } } From owner-svn-src-head@freebsd.org Sun Jun 3 14:13:12 2018 Return-Path: Delivered-To: svn-src-head@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 7D8FBFD3C68; Sun, 3 Jun 2018 14:13:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9BE87935; Sun, 3 Jun 2018 14:13:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA171FB2F; Sun, 3 Jun 2018 14:13:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53EDBp2016255; Sun, 3 Jun 2018 14:13:11 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53EDBIH016253; Sun, 3 Jun 2018 14:13:11 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031413.w53EDBIH016253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 14:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334560 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 14:13:12 -0000 Author: pstef Date: Sun Jun 3 14:13:11 2018 New Revision: 334560 URL: https://svnweb.freebsd.org/changeset/base/334560 Log: indent(1): improve predictability of lexi() lexi() reads the input stream and categorizes the next token. indent will sometimes buffer up a sequence of tokens in order rearrange them. That is needed for properly cuddling else or placing braces correctly according to the chosen style (KNF vs Allman) when comments are around. The loop that buffers tokens up uses lexi() to decide if it's time to stop buffering. Then the temporary buffer is used to feed lexi() the same tokens again, this time for normal processing. The problem is that lexi() apart from recognizing the token, can change a lot of information about the current state, for example ps.last_nl, ps.keyword, buf_ptr. It also abandons leading whitespace, which is needed mainly for comment-related considerations. So the call to lexi() while tokens are buffered up and categorized can change the state before they're read again for normal processing which may easily result in changing interpretation of the current state and lead to incorrect output. To work around the problems: 1) copy the whitespace into the save_com buffer so that it will be read again when processed 2) trick lexi() into modifying a temporary copy of the parser state instead of the original. Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 14:03:20 2018 (r334559) +++ head/usr.bin/indent/indent.c Sun Jun 3 14:13:11 2018 (r334560) @@ -102,6 +102,7 @@ main(int argc, char **argv) int last_else = 0; /* true iff last keyword was an else */ const char *profile_name = NULL; const char *envval = NULL; + struct parser_state transient_state; /* a copy for lookup */ /*-----------------------------------------------*\ | INITIALIZATION | @@ -324,7 +325,7 @@ main(int argc, char **argv) int is_procname; int comment_buffered = false; - type_code = lexi(); /* lexi reads one token. The actual + type_code = lexi(&ps); /* lexi reads one token. The actual * characters read are stored in "token". lexi * returns a code indicating the type of token */ is_procname = ps.procname[0]; @@ -460,9 +461,48 @@ main(int argc, char **argv) break; } } /* end of switch */ - if (type_code != 0) /* we must make this check, just in case there - * was an unexpected EOF */ - type_code = lexi(); /* read another token */ + /* + * We must make this check, just in case there was an unexpected + * EOF. + */ + if (type_code != 0) { + /* + * The only intended purpose of calling lexi() below is to + * categorize the next token in order to decide whether to + * continue buffering forthcoming tokens. Once the buffering + * is over, lexi() will be called again elsewhere on all of + * the tokens - this time for normal processing. + * + * Calling it for this purpose is a bug, because lexi() also + * changes the parser state and discards leading whitespace, + * which is needed mostly for comment-related considerations. + * + * Work around the former problem by giving lexi() a copy of + * the current parser state and discard it if the call turned + * out to be just a look ahead. + * + * Work around the latter problem by copying all whitespace + * characters into the buffer so that the later lexi() call + * will read them. + */ + if (sc_end != NULL) { + while (*buf_ptr == ' ' || *buf_ptr == '\t') { + *sc_end++ = *buf_ptr++; + if (sc_end >= &save_com[sc_size]) { + abort(); + } + } + if (buf_ptr >= buf_end) { + fill_buffer(); + } + } + transient_state = ps; + type_code = lexi(&transient_state); /* read another token */ + if (type_code != newline && type_code != form_feed && + type_code != comment && !transient_state.search_brace) { + ps = transient_state; + } + } } /* end of while (search_brace) */ last_else = 0; check_type: Modified: head/usr.bin/indent/indent.h ============================================================================== --- head/usr.bin/indent/indent.h Sun Jun 3 14:03:20 2018 (r334559) +++ head/usr.bin/indent/indent.h Sun Jun 3 14:13:11 2018 (r334560) @@ -36,7 +36,7 @@ int compute_code_target(void); int compute_label_target(void); int count_spaces(int, char *); int count_spaces_until(int, char *, char *); -int lexi(void); +int lexi(struct parser_state *); void diag2(int, const char *); void diag3(int, const char *, int); void diag4(int, const char *, int, int); Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 14:03:20 2018 (r334559) +++ head/usr.bin/indent/lexi.c Sun Jun 3 14:13:11 2018 (r334560) @@ -141,7 +141,7 @@ strcmp_type(const void *e1, const void *e2) } int -lexi(void) +lexi(struct parser_state *state) { int unary_delim; /* this is set to 1 if the current token * forces a following operator to be unary */ @@ -152,12 +152,13 @@ lexi(void) e_token = s_token; /* point to start of place to save token */ unary_delim = false; - ps.col_1 = ps.last_nl; /* tell world that this token started in - * column 1 iff the last thing scanned was nl */ - ps.last_nl = false; + state->col_1 = state->last_nl; /* tell world that this token started + * in column 1 iff the last thing + * scanned was a newline */ + state->last_nl = false; while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ - ps.col_1 = false; /* leading blanks imply token is not in column + state->col_1 = false; /* leading blanks imply token is not in column * 1 */ if (++buf_ptr >= buf_end) fill_buffer(); @@ -281,18 +282,19 @@ lexi(void) if (++buf_ptr >= buf_end) fill_buffer(); } - ps.keyword = 0; - if (l_struct && !ps.p_l_follow) { + state->keyword = 0; + if (l_struct && !state->p_l_follow) { /* if last token was 'struct' and we're not * in parentheses, then this token * should be treated as a declaration */ l_struct = false; last_code = ident; - ps.last_u_d = true; + state->last_u_d = true; return (decl); } - ps.last_u_d = l_struct; /* Operator after identifier is binary - * unless last token was 'struct' */ + state->last_u_d = l_struct; /* Operator after identifier is + * binary unless last token was + * 'struct' */ l_struct = false; last_code = ident; /* Remember that this is the code we will * return */ @@ -310,13 +312,13 @@ lexi(void) strcmp(u, "_t") == 0) || (typename_top >= 0 && bsearch(s_token, typenames, typename_top + 1, sizeof(typenames[0]), strcmp_type))) { - ps.keyword = 4; /* a type name */ - ps.last_u_d = true; + state->keyword = 4; /* a type name */ + state->last_u_d = true; goto found_typename; } } else { /* we have a keyword */ - ps.keyword = p->rwcode; - ps.last_u_d = true; + state->keyword = p->rwcode; + state->last_u_d = true; switch (p->rwcode) { case 7: /* it is a switch */ return (swstmt); @@ -333,9 +335,9 @@ lexi(void) case 4: /* one of the declaration keywords */ found_typename: - if (ps.p_l_follow) { + if (state->p_l_follow) { /* inside parens: cast, param list, offsetof or sizeof */ - ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.not_cast_mask; + state->cast_mask |= (1 << state->p_l_follow) & ~state->not_cast_mask; break; } last_code = decl; @@ -358,15 +360,15 @@ lexi(void) return (ident); } /* end of switch */ } /* end of if (found_it) */ - if (*buf_ptr == '(' && ps.tos <= 1 && ps.ind_level == 0 && - ps.in_parameter_declaration == 0 && ps.block_init == 0) { + if (*buf_ptr == '(' && state->tos <= 1 && state->ind_level == 0 && + state->in_parameter_declaration == 0 && state->block_init == 0) { char *tp = buf_ptr; while (tp < buf_end) if (*tp++ == ')' && (*tp == ';' || *tp == ',')) goto not_proc; - strncpy(ps.procname, token, sizeof ps.procname - 1); - if (ps.in_decl) - ps.in_parameter_declaration = 1; + strncpy(state->procname, token, sizeof state->procname - 1); + if (state->in_decl) + state->in_parameter_declaration = 1; return (last_code = funcname); not_proc:; } @@ -376,19 +378,19 @@ lexi(void) * typedefd */ if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha(*buf_ptr) || *buf_ptr == '_') - && !ps.p_l_follow - && !ps.block_init - && (ps.last_token == rparen || ps.last_token == semicolon || - ps.last_token == decl || - ps.last_token == lbrace || ps.last_token == rbrace)) { - ps.keyword = 4; /* a type name */ - ps.last_u_d = true; + && !state->p_l_follow + && !state->block_init + && (state->last_token == rparen || state->last_token == semicolon || + state->last_token == decl || + state->last_token == lbrace || state->last_token == rbrace)) { + state->keyword = 4; /* a type name */ + state->last_u_d = true; last_code = decl; return decl; } if (last_code == decl) /* if this is a declared variable, then * following sign is unary */ - ps.last_u_d = true; /* will make "int a -1" work */ + state->last_u_d = true; /* will make "int a -1" work */ last_code = ident; return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ @@ -403,8 +405,8 @@ lexi(void) switch (*token) { case '\n': - unary_delim = ps.last_u_d; - ps.last_nl = true; /* remember that we just had a newline */ + unary_delim = state->last_u_d; + state->last_nl = true; /* remember that we just had a newline */ code = (had_eof ? 0 : newline); /* @@ -473,7 +475,7 @@ stop_lit: break; case '#': - unary_delim = ps.last_u_d; + unary_delim = state->last_u_d; code = preesc; break; @@ -496,21 +498,21 @@ stop_lit: unary_delim = true; /* - * if (ps.in_or_st) ps.block_init = 1; + * if (state->in_or_st) state->block_init = 1; */ - /* ? code = ps.block_init ? lparen : lbrace; */ + /* ? code = state->block_init ? lparen : lbrace; */ code = lbrace; break; case ('}'): unary_delim = true; - /* ? code = ps.block_init ? rparen : rbrace; */ + /* ? code = state->block_init ? rparen : rbrace; */ code = rbrace; break; case 014: /* a form feed */ - unary_delim = ps.last_u_d; - ps.last_nl = true; /* remember this so we can set 'ps.col_1' + unary_delim = state->last_u_d; + state->last_nl = true; /* remember this so we can set 'state->col_1' * right */ code = form_feed; break; @@ -527,7 +529,7 @@ stop_lit: case '-': case '+': /* check for -, +, --, ++ */ - code = (ps.last_u_d ? unary_op : binary_op); + code = (state->last_u_d ? unary_op : binary_op); unary_delim = true; if (*buf_ptr == token[0]) { @@ -535,7 +537,7 @@ stop_lit: *e_token++ = *buf_ptr++; /* buffer overflow will be checked at end of loop */ if (last_code == ident || last_code == rparen) { - code = (ps.last_u_d ? unary_op : postop); + code = (state->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; } @@ -548,14 +550,14 @@ stop_lit: *e_token++ = *buf_ptr++; unary_delim = false; code = unary_op; - ps.want_blank = false; + state->want_blank = false; } break; /* buffer overflow will be checked at end of * switch */ case '=': - if (ps.in_or_st) - ps.block_init = 1; + if (state->in_or_st) + state->block_init = 1; #ifdef undef if (chartype[*buf_ptr] == opchar) { /* we have two char assignment */ e_token[-1] = *buf_ptr++; @@ -586,7 +588,7 @@ stop_lit: } if (*buf_ptr == '=') *e_token++ = *buf_ptr++; - code = (ps.last_u_d ? unary_op : binary_op); + code = (state->last_u_d ? unary_op : binary_op); unary_delim = true; break; @@ -599,7 +601,7 @@ stop_lit: fill_buffer(); code = comment; - unary_delim = ps.last_u_d; + unary_delim = state->last_u_d; break; } while (*(e_token - 1) == *buf_ptr || *buf_ptr == '=') { @@ -610,7 +612,7 @@ stop_lit: if (++buf_ptr >= buf_end) fill_buffer(); } - code = (ps.last_u_d ? unary_op : binary_op); + code = (state->last_u_d ? unary_op : binary_op); unary_delim = true; @@ -621,7 +623,7 @@ stop_lit: } if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer(); - ps.last_u_d = unary_delim; + state->last_u_d = unary_delim; *e_token = '\0'; /* null terminate the token */ return (code); } From owner-svn-src-head@freebsd.org Sun Jun 3 15:28:57 2018 Return-Path: Delivered-To: svn-src-head@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 C6A93FE1FA9; Sun, 3 Jun 2018 15:28:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 796A36B168; Sun, 3 Jun 2018 15:28:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A8E620678; Sun, 3 Jun 2018 15:28:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53FSusO051782; Sun, 3 Jun 2018 15:28:56 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53FSttd051776; Sun, 3 Jun 2018 15:28:55 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031528.w53FSttd051776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 15:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334563 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 15:28:57 -0000 Author: pstef Date: Sun Jun 3 15:28:55 2018 New Revision: 334563 URL: https://svnweb.freebsd.org/changeset/base/334563 Log: indent(1): improve handling of boxed comments indentation The trick is to copy everything from the start of the line into the buffer that stores newlines and comments until indent finds a brace or an else. pr_comment() will use that information to calculate the original indentation of the boxed comment. This requires storing two pieces of information: the real start of the buffer (sc_buf) and the start of the comment (save_com). Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/pr_comment.c head/usr.bin/indent/tests/comments.0 head/usr.bin/indent/tests/comments.0.stdout Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 15:12:40 2018 (r334562) +++ head/usr.bin/indent/indent.c Sun Jun 3 15:28:55 2018 (r334563) @@ -341,6 +341,7 @@ main(int argc, char **argv) switch (type_code) { case newline: if (sc_end == NULL) { + save_com = sc_buf; save_com[0] = save_com[1] = ' '; sc_end = &save_com[2]; } @@ -359,6 +360,13 @@ main(int argc, char **argv) break; case comment: if (sc_end == NULL) { + /* + * Copy everything from the start of the line, because + * pr_comment() will use that to calculate original + * indentation of a boxed comment. + */ + memcpy(sc_buf, in_buffer, buf_ptr - in_buffer - 4); + save_com = sc_buf + (buf_ptr - in_buffer - 4); save_com[0] = save_com[1] = ' '; sc_end = &save_com[2]; } @@ -1172,9 +1180,11 @@ check_type: e_lab--; if (e_lab - s_lab == com_end && bp_save == NULL) { /* comment on preprocessor line */ - if (sc_end == NULL) /* if this is the first comment, we - * must set up the buffer */ - sc_end = &(save_com[0]); + if (sc_end == NULL) { /* if this is the first comment, + * we must set up the buffer */ + save_com = sc_buf; + sc_end = &save_com[0]; + } else { *sc_end++ = '\n'; /* add newline between * comments */ Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 15:12:40 2018 (r334562) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 15:28:55 2018 (r334563) @@ -126,8 +126,9 @@ char *buf_ptr; /* ptr to next character to be t * in_buffer */ char *buf_end; /* ptr to first after last char in in_buffer */ -char save_com[sc_size]; /* input text is saved here when looking for +char sc_buf[sc_size]; /* input text is saved here when looking for * the brace after an if, while, etc */ +char *save_com; /* start of the comment stored in sc_buf */ char *sc_end; /* pointer into save_com buffer */ char *bp_save; /* saved value of buf_ptr when taking input @@ -241,8 +242,12 @@ struct parser_state { int box_com; /* set to true when we are in a "boxed" * comment. In that case, the first non-blank * char should be lined up with the / in / followed by * */ - int comment_delta, - n_comment_delta; + int comment_delta; /* used to set up indentation for all lines + * of a boxed comment after the first one */ + int n_comment_delta;/* remembers how many columns there were + * before the start of a box comment so that + * forthcoming lines of the comment are + * indented properly */ int cast_mask; /* indicates which close parens potentially * close off casts */ int not_cast_mask; /* indicates which close parens definitely Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jun 3 15:12:40 2018 (r334562) +++ head/usr.bin/indent/pr_comment.c Sun Jun 3 15:28:55 2018 (r334563) @@ -158,8 +158,11 @@ pr_comment(void) * The comment we're about to read usually comes from in_buffer, * unless it has been copied into save_com. */ - char *start = buf_ptr >= save_com && buf_ptr < save_com + sc_size ? bp_save : buf_ptr; - ps.n_comment_delta = 1 - count_spaces_until(1, in_buffer, start - 2); + char *start; + + start = buf_ptr >= save_com && buf_ptr < save_com + sc_size ? + sc_buf : in_buffer; + ps.n_comment_delta = 1 - count_spaces_until(1, start, buf_ptr - 2); } else { ps.n_comment_delta = 0; Modified: head/usr.bin/indent/tests/comments.0 ============================================================================== --- head/usr.bin/indent/tests/comments.0 Sun Jun 3 15:12:40 2018 (r334562) +++ head/usr.bin/indent/tests/comments.0 Sun Jun 3 15:28:55 2018 (r334563) @@ -30,3 +30,23 @@ void t(void) { /* r309343 */ } + +int c(void) +{ + if (1) { /*- a christmas tree * + *** + ***** */ + /*- another one * + *** + ***** */ + 7; + } + + if (1) /*- a christmas tree * + *** + ***** */ + /*- another one * + *** + ***** */ + 1; +} Modified: head/usr.bin/indent/tests/comments.0.stdout ============================================================================== --- head/usr.bin/indent/tests/comments.0.stdout Sun Jun 3 15:12:40 2018 (r334562) +++ head/usr.bin/indent/tests/comments.0.stdout Sun Jun 3 15:28:55 2018 (r334563) @@ -37,3 +37,24 @@ t(void) /* r309343 */ } + +int +c(void) +{ + if (1) { /*- a christmas tree * + *** + ***** */ + /*- another one * + *** + ***** */ + 7; + } + + if (1) /*- a christmas tree * + *** + ***** */ + /*- another one * + *** + ***** */ + 1; +} From owner-svn-src-head@freebsd.org Sun Jun 3 16:21:17 2018 Return-Path: Delivered-To: svn-src-head@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 D3ED5FD582E; Sun, 3 Jun 2018 16:21:16 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1656D41C; Sun, 3 Jun 2018 16:21:16 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C67C20ED4; Sun, 3 Jun 2018 16:21:16 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53GLGRr077471; Sun, 3 Jun 2018 16:21:16 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53GLFWj077466; Sun, 3 Jun 2018 16:21:15 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031621.w53GLFWj077466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 16:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334564 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 16:21:17 -0000 Author: pstef Date: Sun Jun 3 16:21:15 2018 New Revision: 334564 URL: https://svnweb.freebsd.org/changeset/base/334564 Log: indent(1): disjoint parser state from lexi() The function is sometimes used as a look-ahead, so ideally it should bear no information about parser state. Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/struct.0 head/usr.bin/indent/tests/struct.0.stdout Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 15:28:55 2018 (r334563) +++ head/usr.bin/indent/indent.c Sun Jun 3 16:21:15 2018 (r334564) @@ -995,6 +995,9 @@ check_type: prefix_blankline_requested = 0; goto copy_id; + case structure: + if (ps.p_l_follow > 0) + goto copy_id; case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Sun Jun 3 15:28:55 2018 (r334563) +++ head/usr.bin/indent/indent_codes.h Sun Jun 3 16:21:15 2018 (r334564) @@ -74,4 +74,4 @@ #define storage 34 #define funcname 35 #define type_def 36 - +#define structure 37 Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 15:28:55 2018 (r334563) +++ head/usr.bin/indent/lexi.c Sun Jun 3 16:21:15 2018 (r334564) @@ -145,8 +145,6 @@ lexi(struct parser_state *state) { int unary_delim; /* this is set to 1 if the current token * forces a following operator to be unary */ - static int last_code; /* the last token type returned */ - static int l_struct; /* set to 1 if the last token was 'struct' */ int code; /* internal code to be returned */ char qchar; /* the delimiter character for a string */ @@ -283,21 +281,17 @@ lexi(struct parser_state *state) fill_buffer(); } state->keyword = 0; - if (l_struct && !state->p_l_follow) { + if (state->last_token == structure && !state->p_l_follow) { /* if last token was 'struct' and we're not * in parentheses, then this token * should be treated as a declaration */ - l_struct = false; - last_code = ident; state->last_u_d = true; return (decl); } - state->last_u_d = l_struct; /* Operator after identifier is - * binary unless last token was - * 'struct' */ - l_struct = false; - last_code = ident; /* Remember that this is the code we will - * return */ + /* + * Operator after identifier is binary unless last token was 'struct' + */ + state->last_u_d = (state->last_token == structure); p = bsearch(s_token, specials, @@ -326,21 +320,17 @@ lexi(struct parser_state *state) return (casestmt); case 3: /* a "struct" */ - /* - * Next time around, we will want to know that we have had a - * 'struct' - */ - l_struct = true; /* FALLTHROUGH */ - case 4: /* one of the declaration keywords */ found_typename: if (state->p_l_follow) { /* inside parens: cast, param list, offsetof or sizeof */ state->cast_mask |= (1 << state->p_l_follow) & ~state->not_cast_mask; - break; } - last_code = decl; + if (p != NULL && p->rwcode == 3) + return (structure); + if (state->p_l_follow) + break; return (decl); case 5: /* if, while, for */ @@ -369,7 +359,7 @@ lexi(struct parser_state *state) strncpy(state->procname, token, sizeof state->procname - 1); if (state->in_decl) state->in_parameter_declaration = 1; - return (last_code = funcname); + return (funcname); not_proc:; } /* @@ -385,13 +375,11 @@ lexi(struct parser_state *state) state->last_token == lbrace || state->last_token == rbrace)) { state->keyword = 4; /* a type name */ state->last_u_d = true; - last_code = decl; return decl; } - if (last_code == decl) /* if this is a declared variable, then - * following sign is unary */ + if (state->last_token == decl) /* if this is a declared variable, + * then following sign is unary */ state->last_u_d = true; /* will make "int a -1" work */ - last_code = ident; return (ident); /* the ident is not in the list */ } /* end of procesing for alpanum character */ @@ -536,7 +524,7 @@ stop_lit: /* check for doubled character */ *e_token++ = *buf_ptr++; /* buffer overflow will be checked at end of loop */ - if (last_code == ident || last_code == rparen) { + if (state->last_token == ident || state->last_token == rparen) { code = (state->last_u_d ? unary_op : postop); /* check for following ++ or -- */ unary_delim = false; @@ -617,10 +605,6 @@ stop_lit: } /* end of switch */ - if (code != newline) { - l_struct = false; - last_code = code; - } if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer(); state->last_u_d = unary_delim; Modified: head/usr.bin/indent/tests/struct.0 ============================================================================== --- head/usr.bin/indent/tests/struct.0 Sun Jun 3 15:28:55 2018 (r334563) +++ head/usr.bin/indent/tests/struct.0 Sun Jun 3 16:21:15 2018 (r334564) @@ -1,4 +1,7 @@ /* $FreeBSD$ */ + +int f(struct x *a); + /* See r303485 */ void t(void) @@ -10,4 +13,9 @@ t(void) { D, E }, { F, G } }; +} + +void u(struct x a) { + int b; + struct y c = (struct y *)&a; } Modified: head/usr.bin/indent/tests/struct.0.stdout ============================================================================== --- head/usr.bin/indent/tests/struct.0.stdout Sun Jun 3 15:28:55 2018 (r334563) +++ head/usr.bin/indent/tests/struct.0.stdout Sun Jun 3 16:21:15 2018 (r334564) @@ -1,4 +1,7 @@ /* $FreeBSD$ */ + +int f(struct x *a); + /* See r303485 */ void t(void) @@ -10,4 +13,11 @@ t(void) {D, E}, {F, G} }; +} + +void +u(struct x a) +{ + int b; + struct y c = (struct y *)&a; } From owner-svn-src-head@freebsd.org Sun Jun 3 16:27:41 2018 Return-Path: Delivered-To: svn-src-head@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 166A2FDB682; Sun, 3 Jun 2018 16:27:41 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0EF76D852; Sun, 3 Jun 2018 16:27:40 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A22AE21027; Sun, 3 Jun 2018 16:27:40 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53GRerG081524; Sun, 3 Jun 2018 16:27:40 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53GRebs081523; Sun, 3 Jun 2018 16:27:40 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031627.w53GRebs081523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 16:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334565 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 16:27:41 -0000 Author: pstef Date: Sun Jun 3 16:27:40 2018 New Revision: 334565 URL: https://svnweb.freebsd.org/changeset/base/334565 Log: indent(1): remove is_procname. It was a shorthand for checking if ps.procname is a non-empty string; the same can be done with ps.procname[0] which avoids the need for updating is_procname after every call to lexi(). Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 16:21:15 2018 (r334564) +++ head/usr.bin/indent/indent.c Sun Jun 3 16:27:40 2018 (r334565) @@ -322,13 +322,11 @@ main(int argc, char **argv) while (1) { /* this is the main loop. it will go until we * reach eof */ - int is_procname; int comment_buffered = false; type_code = lexi(&ps); /* lexi reads one token. The actual * characters read are stored in "token". lexi * returns a code indicating the type of token */ - is_procname = ps.procname[0]; /* * The following code moves newlines and comments following an if (), @@ -596,7 +594,7 @@ check_type: ps.p_l_follow--; } if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && - !is_procname && ps.paren_level == 0) { + ps.procname[0] == '\0' && ps.paren_level == 0) { /* function pointer declarations */ if (troff) { sprintf(e_code, "\n.Du %dp+\200p \"%s\"\n", dec_ind * 7, token); @@ -672,8 +670,8 @@ check_type: break; case unary_op: /* this could be any unary operation */ - if (!ps.dumped_decl_indent && ps.in_decl && !is_procname && - !ps.block_init && ps.paren_level == 0) { + if (!ps.dumped_decl_indent && ps.in_decl && !ps.block_init && + ps.procname[0] == '\0' && ps.paren_level == 0) { /* pointer declarations */ if (troff) { if (ps.want_blank) @@ -1105,7 +1103,7 @@ check_type: ps.want_blank = (s_code != e_code); /* only put blank after comma * if comma does not start the * line */ - if (ps.in_decl && is_procname == 0 && !ps.block_init && + if (ps.in_decl && ps.procname[0] == '\0' && !ps.block_init && !ps.dumped_decl_indent && ps.paren_level == 0) { /* indent leading commas and not the actual identifiers */ indent_declaration(dec_ind - 1, tabs_to_var); From owner-svn-src-head@freebsd.org Sun Jun 3 16:43:00 2018 Return-Path: Delivered-To: svn-src-head@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 52D08FDD5BF; Sun, 3 Jun 2018 16:43:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 029796E403; Sun, 3 Jun 2018 16:43:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D652021365; Sun, 3 Jun 2018 16:42:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Ggxju091474; Sun, 3 Jun 2018 16:42:59 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Ggwac091469; Sun, 3 Jun 2018 16:42:58 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031642.w53Ggwac091469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 16:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334566 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 16:43:00 -0000 Author: pstef Date: Sun Jun 3 16:42:58 2018 New Revision: 334566 URL: https://svnweb.freebsd.org/changeset/base/334566 Log: indent(1): don't format function declarations as variables Added: head/usr.bin/indent/tests/f_decls.0 (contents, props changed) head/usr.bin/indent/tests/f_decls.0.stdout (contents, props changed) Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/Makefile Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 16:27:40 2018 (r334565) +++ head/usr.bin/indent/indent.c Sun Jun 3 16:42:58 2018 (r334566) @@ -1029,30 +1029,31 @@ check_type: case funcname: case ident: /* got an identifier or constant */ - if (ps.in_decl) { /* if we are in a declaration, we must indent - * identifier */ - if (type_code != funcname || !procnames_start_line) { - if (!ps.block_init && !ps.dumped_decl_indent && ps.paren_level == 0) { - if (troff) { - if (ps.want_blank) - *e_code++ = ' '; - sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7); - e_code += strlen(e_code); - } else - indent_declaration(dec_ind, tabs_to_var); - ps.dumped_decl_indent = true; - ps.want_blank = false; - } - } else { - if (ps.want_blank && !(procnames_start_line && - type_code == funcname)) - *e_code++ = ' '; - ps.want_blank = false; - if (dec_ind && s_code != e_code) { + if (ps.in_decl) { + if (type_code == funcname) { + ps.in_decl = false; + if (procnames_start_line && s_code != e_code) { *e_code = '\0'; dump_line(); } - dec_ind = 0; + else if (ps.want_blank) { + *e_code++ = ' '; + } + ps.want_blank = false; + } + else if (!ps.block_init && !ps.dumped_decl_indent && + ps.paren_level == 0) { /* if we are in a declaration, we + * must indent identifier */ + + if (troff) { + if (ps.want_blank) + *e_code++ = ' '; + sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7); + e_code += strlen(e_code); + } else + indent_declaration(dec_ind, tabs_to_var); + ps.dumped_decl_indent = true; + ps.want_blank = false; } } else if (sp_sw && ps.p_l_follow == 0) { Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 16:27:40 2018 (r334565) +++ head/usr.bin/indent/lexi.c Sun Jun 3 16:42:58 2018 (r334566) @@ -367,12 +367,12 @@ lexi(struct parser_state *state) * token is in fact a declaration keyword -- one that has been * typedefd */ - if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha(*buf_ptr) || *buf_ptr == '_') - && !state->p_l_follow - && !state->block_init - && (state->last_token == rparen || state->last_token == semicolon || - state->last_token == decl || - state->last_token == lbrace || state->last_token == rbrace)) { + else if (!state->p_l_follow && !state->block_init && + !state->in_stmt && + ((*buf_ptr == '*' && buf_ptr[1] != '=') || + isalpha((unsigned char)*buf_ptr)) && + (state->last_token == semicolon || state->last_token == lbrace || + state->last_token == rbrace)) { state->keyword = 4; /* a type name */ state->last_u_d = true; return decl; @@ -578,6 +578,34 @@ stop_lit: *e_token++ = *buf_ptr++; code = (state->last_u_d ? unary_op : binary_op); unary_delim = true; + break; + + case '*': + unary_delim = true; + if (!state->last_u_d) { + if (*buf_ptr == '=') + *e_token++ = *buf_ptr++; + code = binary_op; + break; + } + while (*buf_ptr == '*' || isspace((unsigned char)*buf_ptr)) { + if (*buf_ptr == '*') + *e_token++ = *buf_ptr; + if (++buf_ptr >= buf_end) + fill_buffer(); + } + if (ps.in_decl) { + char *tp = buf_ptr; + + while (isalpha((unsigned char)*tp) || + isspace((unsigned char)*tp)) { + if (++tp >= buf_end) + fill_buffer(); + } + if (*tp == '(') + ps.procname[0] = ' '; + } + code = unary_op; break; default: Modified: head/usr.bin/indent/tests/Makefile ============================================================================== --- head/usr.bin/indent/tests/Makefile Sun Jun 3 16:27:40 2018 (r334565) +++ head/usr.bin/indent/tests/Makefile Sun Jun 3 16:42:58 2018 (r334566) @@ -11,6 +11,8 @@ ${PACKAGE}FILES+= declarations.0.stdout ${PACKAGE}FILES+= elsecomment.0 ${PACKAGE}FILES+= elsecomment.0.stdout ${PACKAGE}FILES+= elsecomment.0.pro +${PACKAGE}FILES+= f_decls.0 +${PACKAGE}FILES+= f_decls.0.stdout ${PACKAGE}FILES+= float.0 ${PACKAGE}FILES+= float.0.stdout ${PACKAGE}FILES+= label.0 Added: head/usr.bin/indent/tests/f_decls.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/f_decls.0 Sun Jun 3 16:42:58 2018 (r334566) @@ -0,0 +1,29 @@ +/* $FreeBSD$ */ + +char * x(void) +{ + type identifier; + type *pointer; + unused * value; + (void)unused * value; + + dmax = (double)3 * 10.0; + dmin = (double)dmax * 10.0; + davg = (double)dmax * dmin; + + return NULL; +} + +int * +y(void) { + +} + +int +z(void) { + +} + +int x; +int *y; +int * * * * z; Added: head/usr.bin/indent/tests/f_decls.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/f_decls.0.stdout Sun Jun 3 16:42:58 2018 (r334566) @@ -0,0 +1,32 @@ +/* $FreeBSD$ */ + +char * +x(void) +{ + type identifier; + type *pointer; + unused *value; + (void)unused * value; + + dmax = (double)3 * 10.0; + dmin = (double)dmax * 10.0; + davg = (double)dmax * dmin; + + return NULL; +} + +int * +y(void) +{ + +} + +int +z(void) +{ + +} + +int x; +int *y; +int ****z; From owner-svn-src-head@freebsd.org Sun Jun 3 16:52:31 2018 Return-Path: Delivered-To: svn-src-head@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 B677BFDE97D; Sun, 3 Jun 2018 16:52:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6843A6EAE4; Sun, 3 Jun 2018 16:52:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B02E21501; Sun, 3 Jun 2018 16:52:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53GqVlf096264; Sun, 3 Jun 2018 16:52:31 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53GqVMW096263; Sun, 3 Jun 2018 16:52:31 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031652.w53GqVMW096263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 16:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334567 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 16:52:31 -0000 Author: pstef Date: Sun Jun 3 16:52:30 2018 New Revision: 334567 URL: https://svnweb.freebsd.org/changeset/base/334567 Log: indent(1): recognize more type names Most are from C99. Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 16:42:58 2018 (r334566) +++ head/usr.bin/indent/lexi.c Sun Jun 3 16:52:30 2018 (r334567) @@ -74,11 +74,17 @@ struct templ { */ struct templ specials[] = { + {"_Bool", 4}, + {"_Complex", 4}, + {"_Imaginary", 4}, {"auto", 10}, + {"bool", 4}, {"break", 9}, {"case", 8}, {"char", 4}, + {"complex", 4}, {"const", 4}, + {"continue", 12}, {"default", 8}, {"do", 6}, {"double", 4}, @@ -90,12 +96,16 @@ struct templ specials[] = {"global", 4}, {"goto", 9}, {"if", 5}, + {"imaginary", 4}, + {"inline", 12}, {"int", 4}, {"long", 4}, {"offsetof", 1}, {"register", 10}, + {"restrict", 12}, {"return", 9}, {"short", 4}, + {"signed", 4}, {"sizeof", 2}, {"static", 10}, {"struct", 3}, From owner-svn-src-head@freebsd.org Sun Jun 3 17:03:57 2018 Return-Path: Delivered-To: svn-src-head@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 67E98FDFD4F; Sun, 3 Jun 2018 17:03:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E81E6F1E9; Sun, 3 Jun 2018 17:03:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9A2421693; Sun, 3 Jun 2018 17:03:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53H3uDH001538; Sun, 3 Jun 2018 17:03:56 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53H3ufe001534; Sun, 3 Jun 2018 17:03:56 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031703.w53H3ufe001534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 17:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334568 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:03:57 -0000 Author: pstef Date: Sun Jun 3 17:03:55 2018 New Revision: 334568 URL: https://svnweb.freebsd.org/changeset/base/334568 Log: indent(1): limit character classification functions' input to unsigned char Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.c head/usr.bin/indent/io.c head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 16:52:30 2018 (r334567) +++ head/usr.bin/indent/args.c Sun Jun 3 17:03:55 2018 (r334568) @@ -217,7 +217,7 @@ scan_profile(FILE *f) } else if (i == '/' && comment && p > buf && p[-1] == '*') { p = buf + comment - 1; comment = 0; - } else if (isspace(i)) { + } else if (isspace((unsigned char)i)) { if (p > buf && !comment) break; } else { @@ -321,7 +321,7 @@ found: break; case PRO_INT: - if (!isdigit(*param_start)) { + if (!isdigit((unsigned char)*param_start)) { need_param: errx(1, "%s: ``%s'' requires a parameter", option_source, p->p_name); } Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 16:52:30 2018 (r334567) +++ head/usr.bin/indent/indent.c Sun Jun 3 17:03:55 2018 (r334568) @@ -402,7 +402,7 @@ main(int argc, char **argv) * if there was a newline resulting from the "{" before, * it must be scanned now and ignored. */ - while (isspace((int)*buf_ptr)) { + while (isspace((unsigned char)*buf_ptr)) { if (++buf_ptr >= buf_end) fill_buffer(); if (*buf_ptr == '\n') @@ -429,7 +429,7 @@ main(int argc, char **argv) ps.search_brace = false; goto check_type; } - while (sc_end > save_com && isblank((int)sc_end[-1])) { + while (sc_end > save_com && isblank((unsigned char)sc_end[-1])) { sc_end--; } if (swallow_optional_blanklines || @@ -1070,7 +1070,7 @@ check_type: e_code = chfont(&bodyf, &keywordf, e_code); for (t_ptr = token; *t_ptr; ++t_ptr) { CHECK_SIZE_CODE; - *e_code++ = keywordf.allcaps && islower(*t_ptr) + *e_code++ = keywordf.allcaps && islower((unsigned char)*t_ptr) ? toupper(*t_ptr) : *t_ptr; } e_code = chfont(&keywordf, &bodyf, e_code); Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 16:52:30 2018 (r334567) +++ head/usr.bin/indent/io.c Sun Jun 3 17:03:55 2018 (r334568) @@ -243,7 +243,7 @@ dump_line(void) cur_col = 1; ++ps.out_lines; } - while (e_com > com_st && isspace(e_com[-1])) + while (e_com > com_st && isspace((unsigned char)e_com[-1])) e_com--; (void)pad_output(cur_col, target); fwrite(com_st, e_com - com_st, 1, output); @@ -638,9 +638,9 @@ parsefont(struct fstate *f, const char *s0) memset(f, '\0', sizeof(*f)); while (*s) { - if (isdigit(*s)) + if (isdigit((unsigned char)*s)) f->size = f->size * 10 + *s - '0'; - else if (isupper(*s)) + else if (isupper((unsigned char)*s)) if (f->font[0]) f->font[1] = *s; else Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 16:52:30 2018 (r334567) +++ head/usr.bin/indent/lexi.c Sun Jun 3 17:03:55 2018 (r334568) @@ -173,13 +173,15 @@ lexi(struct parser_state *state) } /* Scan an alphanumeric token */ - if (chartype[(int)*buf_ptr] == alphanum || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) { + if (chartype[*buf_ptr & 127] == alphanum || + (buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) { /* * we have a character or number */ struct templ *p; - if (isdigit(*buf_ptr) || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) { + if (isdigit((unsigned char)*buf_ptr) || + (buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) { enum base { BASE_2, BASE_8, BASE_10, BASE_16 }; @@ -193,7 +195,7 @@ lexi(struct parser_state *state) in_base = BASE_2; else if (buf_ptr[1] == 'x' || buf_ptr[1] == 'X') in_base = BASE_16; - else if (isdigit(buf_ptr[1])) + else if (isdigit((unsigned char)buf_ptr[1])) in_base = BASE_8; } switch (in_base) { @@ -215,7 +217,7 @@ lexi(struct parser_state *state) case BASE_16: *e_token++ = *buf_ptr++; *e_token++ = *buf_ptr++; - while (isxdigit(*buf_ptr)) { + while (isxdigit((unsigned char)*buf_ptr)) { CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; } @@ -230,7 +232,7 @@ lexi(struct parser_state *state) } CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; - if (!isdigit(*buf_ptr) && *buf_ptr != '.') { + if (!isdigit((unsigned char)*buf_ptr) && *buf_ptr != '.') { if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) break; else { @@ -264,7 +266,7 @@ lexi(struct parser_state *state) } } else - while (chartype[(int)*buf_ptr] == alphanum || *buf_ptr == BACKSLASH) { + while (chartype[*buf_ptr & 127] == alphanum || *buf_ptr == BACKSLASH) { /* fill_buffer() terminates buffer with newline */ if (*buf_ptr == BACKSLASH) { if (*(buf_ptr + 1) == '\n') { @@ -557,7 +559,7 @@ stop_lit: if (state->in_or_st) state->block_init = 1; #ifdef undef - if (chartype[*buf_ptr] == opchar) { /* we have two char assignment */ + if (chartype[*buf_ptr & 127] == opchar) { /* we have two char assignment */ e_token[-1] = *buf_ptr++; if ((e_token[-1] == '<' || e_token[-1] == '>') && e_token[-1] == *buf_ptr) *e_token++ = *buf_ptr++; From owner-svn-src-head@freebsd.org Sun Jun 3 17:05:56 2018 Return-Path: Delivered-To: svn-src-head@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 25806FE00B5; Sun, 3 Jun 2018 17:05:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD5AF6F3C5; Sun, 3 Jun 2018 17:05:55 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C39621696; Sun, 3 Jun 2018 17:05:55 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53H5tJr001659; Sun, 3 Jun 2018 17:05:55 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53H5t26001658; Sun, 3 Jun 2018 17:05:55 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031705.w53H5t26001658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 17:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334569 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:05:56 -0000 Author: pstef Date: Sun Jun 3 17:05:55 2018 New Revision: 334569 URL: https://svnweb.freebsd.org/changeset/base/334569 Log: indent(1): use errx() instead of abort() Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 17:03:55 2018 (r334568) +++ head/usr.bin/indent/indent.c Sun Jun 3 17:05:55 2018 (r334569) @@ -495,7 +495,7 @@ main(int argc, char **argv) while (*buf_ptr == ' ' || *buf_ptr == '\t') { *sc_end++ = *buf_ptr++; if (sc_end >= &save_com[sc_size]) { - abort(); + errx(1, "input too long"); } } if (buf_ptr >= buf_end) { @@ -1196,7 +1196,7 @@ check_type: bcopy(s_lab + com_start, sc_end, com_end - com_start); sc_end += com_end - com_start; if (sc_end >= &save_com[sc_size]) - abort(); + errx(1, "input too long"); e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; From owner-svn-src-head@freebsd.org Sun Jun 3 17:07:57 2018 Return-Path: Delivered-To: svn-src-head@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 77E81FE0579; Sun, 3 Jun 2018 17:07:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5B16F5D9; Sun, 3 Jun 2018 17:07:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F9CF21699; Sun, 3 Jun 2018 17:07:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53H7u3j001773; Sun, 3 Jun 2018 17:07:56 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53H7udd001772; Sun, 3 Jun 2018 17:07:56 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031707.w53H7udd001772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 17:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334570 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:07:57 -0000 Author: pstef Date: Sun Jun 3 17:07:56 2018 New Revision: 334570 URL: https://svnweb.freebsd.org/changeset/base/334570 Log: indent(1): the check for buffer overflow has to be done before copy Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 17:05:55 2018 (r334569) +++ head/usr.bin/indent/indent.c Sun Jun 3 17:07:56 2018 (r334570) @@ -1193,10 +1193,10 @@ check_type: *sc_end++ = ' '; --line_no; } + if (sc_end - save_com + com_end - com_start > sc_size) + errx(1, "input too long"); bcopy(s_lab + com_start, sc_end, com_end - com_start); sc_end += com_end - com_start; - if (sc_end >= &save_com[sc_size]) - errx(1, "input too long"); e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; From owner-svn-src-head@freebsd.org Sun Jun 3 17:11:02 2018 Return-Path: Delivered-To: svn-src-head@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 47F37FE0AE1; Sun, 3 Jun 2018 17:11:02 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC5A06F9E7; Sun, 3 Jun 2018 17:11:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD214216C3; Sun, 3 Jun 2018 17:11:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53HB1oB005542; Sun, 3 Jun 2018 17:11:01 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53HB1vN005541; Sun, 3 Jun 2018 17:11:01 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031711.w53HB1vN005541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 17:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334571 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:11:02 -0000 Author: pstef Date: Sun Jun 3 17:11:01 2018 New Revision: 334571 URL: https://svnweb.freebsd.org/changeset/base/334571 Log: indent(1): avoid resetting last_bl to a bogus value when reallocating underlying buffer Modified: head/usr.bin/indent/indent_globs.h Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 17:07:56 2018 (r334570) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 17:11:01 2018 (r334571) @@ -67,12 +67,17 @@ FILE *output; /* the output file */ if (e_com >= l_com) { \ int nsize = l_com-s_com+400; \ int com_len = e_com - s_com; \ - int blank_pos = last_bl - s_com; \ + int blank_pos; \ + if (last_bl != NULL) \ + blank_pos = last_bl - combuf; \ + else \ + blank_pos = -1; \ combuf = (char *) realloc(combuf, nsize); \ if (combuf == NULL) \ err(1, NULL); \ e_com = combuf + com_len + 1; \ - last_bl = combuf + blank_pos + 1; \ + if (blank_pos > 0) \ + last_bl = combuf + blank_pos; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } From owner-svn-src-head@freebsd.org Sun Jun 3 17:20:24 2018 Return-Path: Delivered-To: svn-src-head@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 DCB92FE1C0B; Sun, 3 Jun 2018 17:20:23 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [5.9.17.157]) (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 3C4797015A; Sun, 3 Jun 2018 17:20:23 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail6 [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id 26147298DD; Sun, 3 Jun 2018 19:20:16 +0200 (CEST) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id DC9C59CC62; Sun, 3 Jun 2018 19:20:15 +0200 (CEST) X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id km7gqWSgln_d; Sun, 3 Jun 2018 19:20:15 +0200 (CEST) Received: from nibbler-osx.fritz.box (p5DF5CD2D.dip0.t-ipconnect.de [93.245.205.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id 0954F9CC43; Sun, 3 Jun 2018 19:20:14 +0200 (CEST) Subject: Re: svn commit: r334474 - head/usr.bin/top To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806010551.w515pfoB090926@repo.freebsd.org> From: Florian Smeets Autocrypt: addr=flo@smeets.xyz; keydata= xsFNBFpyBwsBEADLq0c46orEtbMn4SptX+VJxR1wB4YwaErZme1bqF4nZHIhlRNET22HsHdQ doagaB4uACq0Rj5kHcu614ZnnNkLPyCxWQATx+cbdiFO4/hfT8tAvKnBtiy3awKJ5uGCNO2E zJwXW6KwdDA8XPRySqN8m1yPl+dW0Cls+/vO/QL/6+YLMupmEpSvFxRzAZTQuKyX4+xl+dYI d24JiPd1yfCuDNOY3+OZ3QBMT00u/699N8lUWRtiTwaQMwAOww8r/26YM6/SgcgFuLH2E/CV plY0sDvfoISlAj8agxdomNXfPjCMQ6w5yGZmA+huFpPCVBTi3on/SWgbQO7dLVpN4BNPuScP osCb/dsOg0S74zCClsIU3gdUGh9rwJY00/Ebid6V0R3c1Czwbg8LQedzlGDuXYXmzp6W2ujg r1cqbUD6lUWikUv2IMdCbb8MxYhHLi3GYUs5Xpi+W7vM6T45KbuMr7O/1SjtcGOlNeDvGNgj cDk20fOgPPZ+M6i9vX5Q2oI9HoYaeTiYNwILkBLVP/L40kTo5EkiQOt4OW6BMbylqXPOaQMW uGVbmhCJQpbx8Vo80s2yiBBVWkLkWQIcIm3KZlLldJqKEFpQBWLBE1eFFqboYgAWzFn73CaV 5tihobijMmmOV3a8cI1fI4kREyl3g+8bW+O0u3m3tuzVOpDpjwARAQABzR9GbG9yaWFuIFNt ZWV0cyA8ZmxvQHNtZWV0cy54eXo+wsGXBBMBCgBBAhsDBQkHhh+ABQsJCAcDBRUKCQgLBRYD AgEAAh4BAheAFiEE7LNouHkIv7aRTXJp71uk3NWp88AFAlpyB1gCGQEACgkQ71uk3NWp88DB 8RAAuwXf65kTtVwDAJEFnXQmRx8q/bfV5WWMVVZMM9zMOmLM006PlJlns9vDEwfXkUsTOKpC 9GEREdCVxsqQ/WqYrO0O8yLYRMY0IQ6w2B5cVzvf1DwY6Foc7zOpEgvAt5mCR9BoJ1eHf90K rHYUxf8AaWjJ/CE4EdN4wDvEY23tQ1ov0ReiNZokKfKKRF8rRbBhpwRcRyzV4eah3WvKKyOy PIGKquXG0GWhgty3rfNtion8AomFoQlK0lCq57okQj0HLS3vLTzXexvfWsLc+nLXT8eo87cl MQaYz7h5EjqM0r4FPRmGJ18nQ5wArt5vOf5oRv90RSH3QJLaxVdvt0BCDr2s1J5tTG7gZP/r Kyz9BrPtVvBwiHEW8jhw4lDbV3xIUEVkj4UEsM9XkHrHqd8JiFNZZOPE25VkuAeoeyB3j9km fZczF/f41cHp5v5RyTavta9QWA6Q07ARPu2JCBMMN+lJ9G/Ok8JlUgSGOwHZ+3R7jjvDMEFh 4DJhF2B77DdLxpLVJS0h5cS8WM6a/jm1Sk6DAi4bgksetvdyE/N/yxQmHokdKYW2LGDgd7cw dM2X660avFRe4ogZ0PeLRimPbyJuSN2+hZC/fy5jEv5PvZ+6spuwYMYDClefRpvBDqmCCxtf M1LNFRiXjdYvUdHvQ3facDzNpOkPLp0VexjJJ2HOwU0EWnIHCwEQANHrOm5vydK/ij1zkDyL Zzbogk5zjMh6oAr3cH4oGbJHPLlyFZTCVBYUwD4kh6NV1sKuZOeX/aygyVg1RyLulnzsc6Yj XOIxlqhqQwGI8k8ssAIpMSf029781CNF2HC42CrJeHtXNONDNOjsMuoxzga9zLQCh4jLTlE/ TUJo6KVABWBVRtTVh2Z77pKtN7j2NPFBHvp7K0WHfV+TYnlsgjhUA0ACZnUdHS2YRzBhCzzQ eludxBz54S9xbUq1mfZfVx8AbAGXF2zxo68nvvAAJn48HiBS3dMhCGYJDdZdja6QdUFPiemi nOxwkUzCqmKxm+Aj7USue1SbZZqJxmMI1eF4Ork/BJJI74Z/FnJgYR4UkEiD3J/KUocQCIH3 daB1+/CXlh99Ib7AP+QGuKk3vnNHh7VBq3E+VAiM5LU0BmgW+cdRPHkiwM7sDa2VnV3VqvV7 QmoMKnHFzUB6Nn8uE+iakp5J81Pr68kDOq7kLW3UnGmg1PUqbsnCaTimJb3JAYWzOW/9CYcP lbAdIqi+wH7MOoeL+PA99A3kW/881rGmeOYFzzrsNVLtea+AJfXtp4LN5gOVIPIpovCNSVXX EKgl7a4vjUGzVBzrH7PzT+k4XUEQwNCACfGZxEExtny19bjvumZ0rv+AEAHvsWSKXHUVJzIN jqd9UioaEbKGAPlPABEBAAHCwXwEGAEKACYWIQTss2i4eQi/tpFNcmnvW6Tc1anzwAUCWnIH CwIbDAUJB4YfgAAKCRDvW6Tc1anzwM/8D/9IbDzMvsz4O+Gcz1oUx4IMxbQDw99qgJexR5cj W207GkRnKVJ0zqx7Xc+U3AytniuwqHEXeV4qIqP6h14pEuCqdRJ+fSm65rB4+ZdeM2Y5YYvU BByOM78Mbs6SZy2k5X0EL5FXjNVIMOv2ImblyeRWhWK6gCfc/l7kV1EYVx9LV3umsc7K+ceZ lfE1U8hWbie8r7tl3V9ggF2g1cyc9ru0qW3sg8D4vNTS1uwdqeccKRc3osrVw4WrW1nGxTmT TCqVYGHjF2sANF9o1JB93hoXz8lydmDdhJ/62/XHapeT1FB8m7gulinM33VeOCCjN+dUgLQk 5tAGg+iHQWhC4Q/o4m0OqfdcSYdhCJ7h2I4GwOoGaxzoXqEL47Guxz+zE4osAFP5JLxCTbi2 x5sduCvxx3WbO95kZJKp7D0BIKpbKcfkyWse53YBI9wSrkIil+InnqvSDzU9nMvIyKSjv4ui wvZi1HY7tPiir/P2naZaiQ1SAM0KLP3g123WcnhRKo++ZRHhay5/70SKGdxEmKf3nld8xNCs 9EIWOTpRaqc9+zOcD1zVTZwnwgBrnPqzfPW9+d7FwAP1MdJbrROuC2bfzNZyoR4uHAnDOyNW wGSmShv7hhdettO8dJblneTY8vhzxo36pWmojEdgghXNw9Ji7kyInAmWq9kwV5Vou3ZNFw== Message-ID: Date: Sun, 3 Jun 2018 19:19:47 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201806010551.w515pfoB090926@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5OOJnSK4dcKaDFl5MFjvOoT7UHV879xib" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:20:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5OOJnSK4dcKaDFl5MFjvOoT7UHV879xib Content-Type: multipart/mixed; boundary="RKhASXiOaIqqvJvyxgaZGBxK0Jk3ykQmh"; protected-headers="v1" From: Florian Smeets To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r334474 - head/usr.bin/top References: <201806010551.w515pfoB090926@repo.freebsd.org> In-Reply-To: <201806010551.w515pfoB090926@repo.freebsd.org> --RKhASXiOaIqqvJvyxgaZGBxK0Jk3ykQmh Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 01.06.18 07:51, Eitan Adler wrote: > Author: eadler > Date: Fri Jun 1 05:51:40 2018 > New Revision: 334474 > URL: https://svnweb.freebsd.org/changeset/base/334474 >=20 > Log: > top(1): Display of TID when using 'H' flag > =20 > Some users prefer seeing the TID when viewing individual threads. Thi= s > makes sense as the PID will be the same for multiple entries. An atte= mpt > was made to include both, but there is insufficient room. As such, us= ing > the TID. > =20 > While here, rename the header variables to be more understandable. > =20 > Discussed with: mmacy > Reported on: 2009-10-07 >=20 Hi, I think this is a mistake. The 'H' flag should keep the PID, AFAIK you cannot use the TID anywhere in top in contrast to the PID. I usually start top with the 'S' and 'H' flags. Now I cannot use 'k' to kill a process in that view, as I don't see the PID. IMHO showing TIDs should be a separate flag, 'h' maybe, as this commit changes current/expected behavior (POLA?). Also, this is not documented in the man page. Florian --RKhASXiOaIqqvJvyxgaZGBxK0Jk3ykQmh-- --5OOJnSK4dcKaDFl5MFjvOoT7UHV879xib Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7LNouHkIv7aRTXJp71uk3NWp88AFAlsUI05fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVD QjM2OEI4NzkwOEJGQjY5MTRENzI2OUVGNUJBNERDRDVBOUYzQzAACgkQ71uk3NWp 88DseQ/9FmSsirHQ4KDv9uvNpf1zXss8dzO0VRfr1BxTwEqz8ketK6vAi04olR4a TWdHZ+ril/ybAwzcuZkUY8PXdoWZQmmQyaB6L2fQkCO8GV6Br7/8zH0NI8Avxu/8 1Y0YKpKPA+YFo0Iv0aQsqY2aeL05FF9y/selp2KKoWn2jgNhz0AFDqEQtOhd1ZOt IuiY/M7qknIQs/Z3Qv8VKG1ArYS5Kd42+7uAg+C3wEDGgXxVHuz6IvBNIRSy9ItD BlP1Fwa7+PXxJNpASRDeTQMGuNnSRIagb8Z86xPJPYPxLfjgaRFfnIozQ5Dux2MD RHV/N/olZ5mIciPDcR7E0DCGgXzzPmjxcCiVUWjaUojEM+OYeJXogduKSt2F58nr JKmWlYXz4+QKb5+1rGnn/afPuZUFtPSEu4irvZ2XgE2vhiRpWj5RCuFq3sanD1mH qBMpkrhSI/3QCUWpK2KT2jSKtNJQUXpfluqnSgaDzdvR44mbO2F4z0Kt3dHkXEXT zRaZ3eboqeMiPQvBkzt15SwaQVyXpNdgS+JzkLf+IObyQmTeaO7hvlUXs68VqJD2 D3NfBiaL+lR5VE12KUcUxk6Q5Z78OoDfP3NtmrAc9aRV9PQOP11pRMZ505HhcPqy abwwAofgF9dXTDClelbvWnvYuU7xls/fgsEJLtYtXr3+pCMNCT4= =6hLe -----END PGP SIGNATURE----- --5OOJnSK4dcKaDFl5MFjvOoT7UHV879xib-- From owner-svn-src-head@freebsd.org Sun Jun 3 17:55:53 2018 Return-Path: Delivered-To: svn-src-head@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 876B9FE6086; Sun, 3 Jun 2018 17:55:53 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB7C71D93; Sun, 3 Jun 2018 17:55:53 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1F7321EC6; Sun, 3 Jun 2018 17:55:52 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53HtqYu026646; Sun, 3 Jun 2018 17:55:52 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Htp6b026637; Sun, 3 Jun 2018 17:55:51 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031755.w53Htp6b026637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 17:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334574 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:55:53 -0000 Author: pstef Date: Sun Jun 3 17:55:50 2018 New Revision: 334574 URL: https://svnweb.freebsd.org/changeset/base/334574 Log: indent(1): remove troff output support The troff output in indent was invented at Sun and the online documentation for some post-SunOS operating system includes this: The usual way to get a troffed listing is with the command indent -troff program.c | troff -mindent The indent manual page in FreeBSD 1.0 already lacks that information and troff -mindent complains about not being able to find the macro file. It seems that the file did exist on SunOS and was supposed to be imported into 4.3BSD together with the feature, but that has never happened. Removal of troff output support simplifies a lot of indent's code. vgrind(1) seems to be a promising replacement. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent.h head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c head/usr.bin/indent/lexi.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/args.c Sun Jun 3 17:55:50 2018 (r334574) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #define PRO_SPECIAL 1 /* special case */ #define PRO_BOOL 2 /* boolean */ #define PRO_INT 3 /* integer */ -#define PRO_FONT 4 /* troff font */ /* profile specials for booleans */ #define ON 1 /* turn it on */ @@ -119,15 +118,9 @@ struct pro { {"d", PRO_INT, 0, 0, &ps.unindent_displace}, {"eei", PRO_BOOL, false, ON, &extra_expression_indent}, {"ei", PRO_BOOL, true, ON, &ps.else_if}, - {"fbc", PRO_FONT, 0, 0, (int *) &blkcomf}, {"fbs", PRO_BOOL, true, ON, &function_brace_split}, - {"fbx", PRO_FONT, 0, 0, (int *) &boxcomf}, - {"fb", PRO_FONT, 0, 0, (int *) &bodyf}, {"fc1", PRO_BOOL, true, ON, &format_col1_comments}, {"fcb", PRO_BOOL, true, ON, &format_block_comments}, - {"fc", PRO_FONT, 0, 0, (int *) &scomf}, - {"fk", PRO_FONT, 0, 0, (int *) &keywordf}, - {"fs", PRO_FONT, 0, 0, (int *) &stringf}, {"ip", PRO_BOOL, true, ON, &ps.indent_parameters}, {"i", PRO_INT, 8, 0, &ps.ind_size}, {"lc", PRO_INT, 0, 0, &block_comment_max_col}, @@ -167,7 +160,6 @@ struct pro { {"st", PRO_SPECIAL, 0, STDIN, 0}, {"ta", PRO_BOOL, false, ON, &auto_typedefs}, {"ts", PRO_INT, 8, 0, &tabsize}, - {"troff", PRO_BOOL, false, ON, &troff}, {"ut", PRO_BOOL, true, ON, &use_tabs}, {"v", PRO_BOOL, false, ON, &verbose}, /* whew! */ @@ -259,7 +251,7 @@ set_defaults(void) */ ps.case_indent = 0.0; /* -cli0.0 */ for (p = pro; p->p_name; p++) - if (p->p_type != PRO_SPECIAL && p->p_type != PRO_FONT) + if (p->p_type != PRO_SPECIAL) *p->p_obj = p->p_default; } @@ -326,10 +318,6 @@ found: errx(1, "%s: ``%s'' requires a parameter", option_source, p->p_name); } *p->p_obj = atoi(param_start); - break; - - case PRO_FONT: - parsefont((struct fstate *) p->p_obj, param_start); break; default: Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/indent.1 Sun Jun 3 17:55:50 2018 (r334574) @@ -84,7 +84,6 @@ .Ek .Op Fl \&st .Op Fl \&ta -.Op Fl troff .Op Fl ts Ns Ar n .Op Fl U Ns Ar file .Op Fl ut | Fl nut @@ -453,16 +452,6 @@ language and cannot find all instances of .Ic typedef . -.It Fl troff -Causes -.Nm -to format the program for processing by -.Xr troff 1 . -It will produce a fancy -listing in much the same spirit as -.Xr vgrind 1 . -If the output file is not specified, the default is standard output, -rather than formatting in place. .It Fl ts Ns Ar n Assumed distance between tab stops. The default is 8. Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/indent.c Sun Jun 3 17:55:50 2018 (r334574) @@ -240,7 +240,7 @@ main(int argc, char **argv) if (input == NULL) input = stdin; if (output == NULL) { - if (troff || input == stdin) + if (input == stdin) output = stdout; else { out_name = in_name; @@ -260,26 +260,6 @@ main(int argc, char **argv) if (ps.com_ind <= 1) ps.com_ind = 2; /* dont put normal comments before column 2 */ - if (troff) { - if (bodyf.font[0] == 0) - parsefont(&bodyf, "R"); - if (scomf.font[0] == 0) - parsefont(&scomf, "I"); - if (blkcomf.font[0] == 0) - blkcomf = scomf, blkcomf.size += 2; - if (boxcomf.font[0] == 0) - boxcomf = blkcomf; - if (stringf.font[0] == 0) - parsefont(&stringf, "L"); - if (keywordf.font[0] == 0) - parsefont(&keywordf, "B"); - writefdef(&bodyf, 'B'); - writefdef(&scomf, 'C'); - writefdef(&blkcomf, 'L'); - writefdef(&boxcomf, 'X'); - writefdef(&stringf, 'S'); - writefdef(&keywordf, 'K'); - } if (block_comment_max_col <= 0) block_comment_max_col = max_col; if (ps.local_decl_indent < 0) /* if not specified by user, set this */ @@ -307,15 +287,7 @@ main(int argc, char **argv) if (col > ps.ind_size) ps.ind_level = ps.i_l_follow = col / ps.ind_size; } - if (troff) { - const char *p = in_name, - *beg = in_name; - while (*p) - if (*p++ == '/') - beg = p; - fprintf(output, ".Fn \"%s\"\n", beg); - } /* * START OF MAIN LOOP */ @@ -596,13 +568,7 @@ check_type: if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && ps.procname[0] == '\0' && ps.paren_level == 0) { /* function pointer declarations */ - if (troff) { - sprintf(e_code, "\n.Du %dp+\200p \"%s\"\n", dec_ind * 7, token); - e_code += strlen(e_code); - } - else { - indent_declaration(dec_ind, tabs_to_var); - } + indent_declaration(dec_ind, tabs_to_var); ps.dumped_decl_indent = true; } else if (ps.want_blank && *token != '[' && @@ -614,8 +580,7 @@ check_type: ps.keyword + Bill_Shannon > 2)) *e_code++ = ' '; ps.want_blank = false; - if (!troff) - *e_code++ = token[0]; + *e_code++ = token[0]; ps.paren_indents[ps.p_l_follow - 1] = count_spaces_until(1, s_code, e_code) - 1; if (sp_sw && ps.p_l_follow == 1 && extra_expression_indent && ps.paren_indents[0] < 2 * ps.ind_size) @@ -673,33 +638,22 @@ check_type: if (!ps.dumped_decl_indent && ps.in_decl && !ps.block_init && ps.procname[0] == '\0' && ps.paren_level == 0) { /* pointer declarations */ - if (troff) { - if (ps.want_blank) - *e_code++ = ' '; - sprintf(e_code, "\n.Du %dp+\200p \"%s\"\n", dec_ind * 7, - token); - e_code += strlen(e_code); - } - else { - /* if this is a unary op in a declaration, we should - * indent this token */ - for (i = 0; token[i]; ++i) - /* find length of token */; - indent_declaration(dec_ind - i, tabs_to_var); - } + + /* + * if this is a unary op in a declaration, we should indent + * this token + */ + for (i = 0; token[i]; ++i) + /* find length of token */; + indent_declaration(dec_ind - i, tabs_to_var); ps.dumped_decl_indent = true; } else if (ps.want_blank) *e_code++ = ' '; - { - const char *res = token; - if (troff && token[0] == '-' && token[1] == '>') - res = "\\(->"; - for (t_ptr = res; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; - } + for (t_ptr = token; *t_ptr; ++t_ptr) { + CHECK_SIZE_CODE; + *e_code++ = *t_ptr; } ps.want_blank = false; break; @@ -707,34 +661,9 @@ check_type: case binary_op: /* any binary operation */ if (ps.want_blank) *e_code++ = ' '; - { - const char *res = token; - - if (troff) - switch (token[0]) { - case '<': - if (token[1] == '=') - res = "\\(<="; - break; - case '>': - if (token[1] == '=') - res = "\\(>="; - break; - case '!': - if (token[1] == '=') - res = "\\(!="; - break; - case '|': - if (token[1] == '|') - res = "\\(br\\(br"; - else if (token[1] == 0) - res = "\\(br"; - break; - } - for (t_ptr = res; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; /* move the operator */ - } + for (t_ptr = token; *t_ptr; ++t_ptr) { + CHECK_SIZE_CODE; + *e_code++ = *t_ptr; /* move the operator */ } ps.want_blank = true; break; @@ -1044,14 +973,7 @@ check_type: else if (!ps.block_init && !ps.dumped_decl_indent && ps.paren_level == 0) { /* if we are in a declaration, we * must indent identifier */ - - if (troff) { - if (ps.want_blank) - *e_code++ = ' '; - sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7); - e_code += strlen(e_code); - } else - indent_declaration(dec_ind, tabs_to_var); + indent_declaration(dec_ind, tabs_to_var); ps.dumped_decl_indent = true; ps.want_blank = false; } @@ -1066,20 +988,10 @@ check_type: copy_id: if (ps.want_blank) *e_code++ = ' '; - if (troff && ps.keyword) { - e_code = chfont(&bodyf, &keywordf, e_code); - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = keywordf.allcaps && islower((unsigned char)*t_ptr) - ? toupper(*t_ptr) : *t_ptr; - } - e_code = chfont(&keywordf, &bodyf, e_code); + for (t_ptr = token; *t_ptr; ++t_ptr) { + CHECK_SIZE_CODE; + *e_code++ = *t_ptr; } - else - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; - } if (type_code != funcname) ps.want_blank = true; break; @@ -1145,8 +1057,6 @@ check_type: fill_buffer(); switch (*e_lab++) { case BACKSLASH: - if (troff) - *e_lab++ = BACKSLASH; if (!in_comment) { *e_lab++ = *buf_ptr++; if (buf_ptr >= buf_end) Modified: head/usr.bin/indent/indent.h ============================================================================== --- head/usr.bin/indent/indent.h Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/indent.h Sun Jun 3 17:55:50 2018 (r334574) @@ -43,9 +43,7 @@ void diag4(int, const char *, int, int); void dump_line(void); void fill_buffer(void); void parse(int); -void parsefont(struct fstate *, const char *); void pr_comment(void); void set_defaults(void); void set_option(char *); void set_profile(const char *); -void writefdef(struct fstate *f, int); Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 17:55:50 2018 (r334574) @@ -166,7 +166,6 @@ int cuddle_else; /* true if else should cuddle int star_comment_cont; /* true iff comment continuation lines should * have stars at the beginning of each line. */ int comment_delimiter_on_blankline; -int troff; /* true iff were generating troff input */ int procnames_start_line; /* if true, the names of procedures * being defined get placed in column * 1 (ie. a newline is placed between @@ -218,29 +217,10 @@ int auto_typedefs; /* set true to recognize ident int space_after_cast; /* "b = (int) a" vs "b = (int)a" */ int tabsize; /* the size of a tab */ -/* -troff font state information */ - -struct fstate { - char font[4]; - char size; - int allcaps:1; -} __aligned(sizeof(int)); -char *chfont(struct fstate *, struct fstate *, char *); - -struct fstate - keywordf, /* keyword font */ - stringf, /* string font */ - boxcomf, /* Box comment font */ - blkcomf, /* Block comment font */ - scomf, /* Same line comment font */ - bodyf; /* major body font */ - - #define STACKSIZE 256 struct parser_state { int last_token; - struct fstate cfont; /* Current font */ int p_stack[STACKSIZE]; /* this is the parsers stack */ int il[STACKSIZE]; /* this stack stores indentation levels */ float cstk[STACKSIZE];/* used to store case stmt indentation levels */ Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/io.c Sun Jun 3 17:55:50 2018 (r334574) @@ -68,13 +68,6 @@ dump_line(void) static int not_first_line; if (ps.procname[0]) { - if (troff) { - if (comment_open) { - comment_open = 0; - fprintf(output, ".*/\n"); - } - fprintf(output, ".Pr \"%s\"\n", ps.procname); - } ps.ind_level = 0; ps.procname[0] = 0; } @@ -163,99 +156,38 @@ dump_line(void) putc(*p, output); cur_col = count_spaces(cur_col, s_code); } - if (s_com != e_com) { - if (troff) { - int all_here = 0; - char *p; + if (s_com != e_com) { /* print comment, if any */ + int target = ps.com_col; + char *com_st = s_com; - if (e_com[-1] == '/' && e_com[-2] == '*') - e_com -= 2, all_here++; - while (e_com > s_com && e_com[-1] == ' ') - e_com--; - *e_com = 0; - p = s_com; - while (*p == ' ') - p++; - if (p[0] == '/' && p[1] == '*') - p += 2, all_here++; - else if (p[0] == '*') - p += p[1] == '/' ? 2 : 1; - while (*p == ' ') - p++; - if (*p == 0) - goto inhibit_newline; - if (comment_open < 2 && ps.box_com) { - comment_open = 0; - fprintf(output, ".*/\n"); - } - if (comment_open == 0) { - if ('a' <= *p && *p <= 'z') - *p = *p + 'A' - 'a'; - if (e_com - p < 50 && all_here == 2) { - char *follow = p; - fprintf(output, "\n.nr C! \\w\1"); - while (follow < e_com) { - switch (*follow) { - case '\n': - putc(' ', output); - case 1: - break; - case '\\': - putc('\\', output); - /* add a backslash to escape the '\' */ - default: - putc(*follow, output); - } - follow++; - } - putc(1, output); - } - fprintf(output, "\n./* %dp %d %dp\n", - ps.com_col * 7, - (s_code != e_code || s_lab != e_lab) - ps.box_com, - target_col * 7); - } - comment_open = 1 + ps.box_com; - while (*p) { - if (*p == BACKSLASH) - putc(BACKSLASH, output); - putc(*p++, output); - } + target += ps.comment_delta; + while (*com_st == '\t') /* consider original indentation in + * case this is a box comment */ + com_st++, target += tabsize; + while (target <= 0) + if (*com_st == ' ') + target++, com_st++; + else if (*com_st == '\t') + target = tabsize * (1 + (target - 1) / tabsize) + 1, com_st++; + else + target = 1; + if (cur_col > target) { /* if comment can't fit on this line, + * put it on next line */ + putc('\n', output); + cur_col = 1; + ++ps.out_lines; } - else { /* print comment, if any */ - int target = ps.com_col; - char *com_st = s_com; - - target += ps.comment_delta; - while (*com_st == '\t') /* consider original indentation in - * case this is a box comment */ - com_st++, target += tabsize; - while (target <= 0) - if (*com_st == ' ') - target++, com_st++; - else if (*com_st == '\t') - target = tabsize * (1 + (target - 1) / tabsize) + 1, com_st++; - else - target = 1; - if (cur_col > target) { /* if comment can't fit on this line, - * put it on next line */ - putc('\n', output); - cur_col = 1; - ++ps.out_lines; - } - while (e_com > com_st && isspace((unsigned char)e_com[-1])) - e_com--; - (void)pad_output(cur_col, target); - fwrite(com_st, e_com - com_st, 1, output); - ps.comment_delta = ps.n_comment_delta; - ++ps.com_lines; /* count lines with comments */ - } + while (e_com > com_st && isspace((unsigned char)e_com[-1])) + e_com--; + (void)pad_output(cur_col, target); + fwrite(com_st, e_com - com_st, 1, output); + ps.comment_delta = ps.n_comment_delta; + ++ps.com_lines; /* count lines with comments */ } if (ps.use_ff) putc('\014', output); else putc('\n', output); -inhibit_newline: ++ps.out_lines; if (ps.just_saw_decl == 1 && blanklines_after_declarations) { prefix_blankline_requested = 1; @@ -460,26 +392,22 @@ pad_output(int current, int target) /* current: the current column value */ /* target: position we want it at */ { + int curr; /* internal column pointer */ - if (troff) - fprintf(output, "\\h'|%dp'", (target - 1) * 7); - else { - int curr; /* internal column pointer */ + if (current >= target) + return (current); /* line is already long enough */ + curr = current; + if (use_tabs) { + int tcur; - if (current >= target) - return (current); /* line is already long enough */ - curr = current; - if (use_tabs) { - int tcur; - - while ((tcur = tabsize * (1 + (curr - 1) / tabsize) + 1) <= target) { - putc('\t', output); - curr = tcur; - } - } - while (curr++ < target) - putc(' ', output); /* pad with final blanks */ + while ((tcur = tabsize * (1 + (curr - 1) / tabsize) + 1) <= target) { + putc('\t', output); + curr = tcur; + } } + while (curr++ < target) + putc(' ', output); /* pad with final blanks */ + return (target); } @@ -593,77 +521,3 @@ diag2(int level, const char *msg) } } -void -writefdef(struct fstate *f, int nm) -{ - fprintf(output, ".ds f%c %s\n.nr s%c %d\n", - nm, f->font, nm, f->size); -} - -char * -chfont(struct fstate *of, struct fstate *nf, char *s) -{ - if (of->font[0] != nf->font[0] - || of->font[1] != nf->font[1]) { - *s++ = '\\'; - *s++ = 'f'; - if (nf->font[1]) { - *s++ = '('; - *s++ = nf->font[0]; - *s++ = nf->font[1]; - } - else - *s++ = nf->font[0]; - } - if (nf->size != of->size) { - *s++ = '\\'; - *s++ = 's'; - if (nf->size < of->size) { - *s++ = '-'; - *s++ = '0' + of->size - nf->size; - } - else { - *s++ = '+'; - *s++ = '0' + nf->size - of->size; - } - } - return s; -} - -void -parsefont(struct fstate *f, const char *s0) -{ - const char *s = s0; - int sizedelta = 0; - - memset(f, '\0', sizeof(*f)); - while (*s) { - if (isdigit((unsigned char)*s)) - f->size = f->size * 10 + *s - '0'; - else if (isupper((unsigned char)*s)) - if (f->font[0]) - f->font[1] = *s; - else - f->font[0] = *s; - else if (*s == 'c') - f->allcaps = 1; - else if (*s == '+') - sizedelta++; - else if (*s == '-') - sizedelta--; - else { - errx(1, "bad font specification: %s", s0); - } - s++; - } - if (f->font[0] == 0) - f->font[0] = 'R'; - if (bodyf.size == 0) - bodyf.size = 11; - if (f->size == 0) - f->size = bodyf.size + sizedelta; - else if (sizedelta > 0) - f->size += bodyf.size; - else - f->size = bodyf.size - f->size; -} Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/lexi.c Sun Jun 3 17:55:50 2018 (r334574) @@ -418,12 +418,6 @@ lexi(struct parser_state *state) case '\'': /* start of quoted character */ case '"': /* start of string */ qchar = *token; - if (troff) { - e_token[-1] = '`'; - if (qchar == '"') - *e_token++ = '`'; - e_token = chfont(&bodyf, &stringf, e_token); - } do { /* copy the string */ while (1) { /* move one character or [/] */ if (*buf_ptr == '\n') { @@ -439,11 +433,6 @@ lexi(struct parser_state *state) if (*e_token == BACKSLASH) { /* if escape, copy extra char */ if (*buf_ptr == '\n') /* check for escaped newline */ ++line_no; - if (troff) { - *++e_token = BACKSLASH; - if (*buf_ptr == BACKSLASH) - *++e_token = BACKSLASH; - } *++e_token = *buf_ptr++; ++e_token; /* we must increment this again because we * copied two chars */ @@ -454,11 +443,6 @@ lexi(struct parser_state *state) break; /* we copied one character */ } /* end of while (1) */ } while (*e_token++ != qchar); - if (troff) { - e_token = chfont(&stringf, &bodyf, e_token - 1); - if (qchar == '"') - *e_token++ = '\''; - } stop_lit: code = ident; break; Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jun 3 17:49:45 2018 (r334573) +++ head/usr.bin/indent/pr_comment.c Sun Jun 3 17:55:50 2018 (r334574) @@ -201,9 +201,6 @@ pr_comment(void) *e_com++ = ' ', *e_com++ = '*', *e_com++ = ' '; } - if (troff) - adj_max_col = 80; - /* Start to copy the comment */ while (1) { /* this loop will go until the comment is From owner-svn-src-head@freebsd.org Sun Jun 3 18:19:43 2018 Return-Path: Delivered-To: svn-src-head@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 40D74FE8DEC; Sun, 3 Jun 2018 18:19:43 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3F61738B8; Sun, 3 Jun 2018 18:19:42 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AABE322207; Sun, 3 Jun 2018 18:19:42 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53IJgHN038358; Sun, 3 Jun 2018 18:19:42 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53IJfII038354; Sun, 3 Jun 2018 18:19:41 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031819.w53IJfII038354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 18:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334576 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 18:19:43 -0000 Author: pstef Date: Sun Jun 3 18:19:41 2018 New Revision: 334576 URL: https://svnweb.freebsd.org/changeset/base/334576 Log: indent(1): improve CHECK_SIZE_ macros Rewrite the macros so that they take a parameter. Consumers use it to signal how much room in the buffer they need; this lets them do that once when required space is known instead of doing the check once every loop step. Also take the parameter value into consideration when resizing the buffer; the requested space may be larger than the constant 400 bytes that the previous version used - now it's the sum of those two values. On the consumer side, don't copy strings byte by byte - use memcpy(). Deduplicate code that copied base 2, base 8 and base 16 literals. Don't advance the e_token pointer once the token has been copied into s_token. This allows easy calculation of the token's length. Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/lexi.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 18:17:07 2018 (r334575) +++ head/usr.bin/indent/indent.c Sun Jun 3 18:19:41 2018 (r334576) @@ -520,11 +520,12 @@ check_type: * '}' */ if (s_com != e_com) { /* the turkey has embedded a comment * in a line. fix it */ + int len = e_com - s_com; + + CHECK_SIZE_CODE(len + 3); *e_code++ = ' '; - for (t_ptr = s_com; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; - } + memcpy(e_code, s_com, len); + e_code += len; *e_code++ = ' '; *e_code = '\0'; /* null terminate code sect */ ps.want_blank = false; @@ -540,7 +541,10 @@ check_type: /*-----------------------------------------------------*\ | do switch on type of token scanned | \*-----------------------------------------------------*/ - CHECK_SIZE_CODE; + CHECK_SIZE_CODE(3); /* maximum number of increments of e_code + * before the next CHECK_SIZE_CODE or + * dump_line() is 2. After that there's the + * final increment for the null character. */ switch (type_code) { /* now, decide what to do with the token */ case form_feed: /* found a form feed in line */ @@ -651,19 +655,25 @@ check_type: else if (ps.want_blank) *e_code++ = ' '; - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; + { + int len = e_token - s_token; + + CHECK_SIZE_CODE(len); + memcpy(e_code, token, len); + e_code += len; } ps.want_blank = false; break; case binary_op: /* any binary operation */ - if (ps.want_blank) - *e_code++ = ' '; - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; /* move the operator */ + { + int len = e_token - s_token; + + CHECK_SIZE_CODE(len + 1); + if (ps.want_blank) + *e_code++ = ' '; + memcpy(e_code, token, len); + e_code += len; } ps.want_blank = true; break; @@ -704,13 +714,20 @@ check_type: } ps.in_stmt = false; /* seeing a label does not imply we are in a * stmt */ - for (t_ptr = s_code; *t_ptr; ++t_ptr) - *e_lab++ = *t_ptr; /* turn everything so far into a label */ - e_code = s_code; - *e_lab++ = ':'; - *e_lab++ = ' '; - *e_lab = '\0'; + /* + * turn everything so far into a label + */ + { + int len = e_code - s_code; + CHECK_SIZE_LAB(len + 3); + memcpy(e_lab, s_code, len); + e_lab += len; + *e_lab++ = ':'; + *e_lab++ = ' '; + *e_lab = '\0'; + e_code = s_code; + } force_nl = ps.pcase = scase; /* ps.pcase will be used by * dump_line to decide how to * indent the label. force_nl @@ -986,22 +1003,28 @@ check_type: parse(hd_type); } copy_id: - if (ps.want_blank) - *e_code++ = ' '; - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; + { + int len = e_token - s_token; + + CHECK_SIZE_CODE(len + 1); + if (ps.want_blank) + *e_code++ = ' '; + memcpy(e_code, s_token, len); + e_code += len; } if (type_code != funcname) ps.want_blank = true; break; case strpfx: - if (ps.want_blank) - *e_code++ = ' '; - for (t_ptr = token; *t_ptr; ++t_ptr) { - CHECK_SIZE_CODE; - *e_code++ = *t_ptr; + { + int len = e_token - s_token; + + CHECK_SIZE_CODE(len + 1); + if (ps.want_blank) + *e_code++ = ' '; + memcpy(e_code, token, len); + e_code += len; } ps.want_blank = false; break; @@ -1038,6 +1061,7 @@ check_type: (s_lab != e_lab) || (s_code != e_code)) dump_line(); + CHECK_SIZE_LAB(1); *e_lab++ = '#'; /* move whole line to 'label' buffer */ { int in_comment = 0; @@ -1051,7 +1075,7 @@ check_type: fill_buffer(); } while (*buf_ptr != '\n' || (in_comment && !had_eof)) { - CHECK_SIZE_LAB; + CHECK_SIZE_LAB(2); *e_lab = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer(); @@ -1119,6 +1143,7 @@ check_type: buf_end = sc_end; sc_end = NULL; } + CHECK_SIZE_LAB(1); *e_lab = '\0'; /* null terminate line */ ps.pcase = false; } @@ -1249,14 +1274,14 @@ indent_declaration(int cur_dec_ind, int tabs_to_var) if (tabs_to_var) { int tpos; + CHECK_SIZE_CODE(cur_dec_ind / tabsize); while ((tpos = tabsize * (1 + pos / tabsize)) <= cur_dec_ind) { - CHECK_SIZE_CODE; *e_code++ = '\t'; pos = tpos; } } + CHECK_SIZE_CODE(cur_dec_ind - pos + 1); while (pos < cur_dec_ind) { - CHECK_SIZE_CODE; *e_code++ = ' '; pos++; } Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 18:17:07 2018 (r334575) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 18:19:41 2018 (r334576) @@ -52,9 +52,9 @@ FILE *input; /* the fid for the input file */ FILE *output; /* the output file */ -#define CHECK_SIZE_CODE \ - if (e_code >= l_code) { \ - int nsize = l_code-s_code+400; \ +#define CHECK_SIZE_CODE(desired_size) \ + if (e_code + (desired_size) >= l_code) { \ + int nsize = l_code-s_code + 400 + desired_size; \ int code_len = e_code-s_code; \ codebuf = (char *) realloc(codebuf, nsize); \ if (codebuf == NULL) \ @@ -63,9 +63,9 @@ FILE *output; /* the output file */ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ } -#define CHECK_SIZE_COM \ - if (e_com >= l_com) { \ - int nsize = l_com-s_com+400; \ +#define CHECK_SIZE_COM(desired_size) \ + if (e_com + (desired_size) >= l_com) { \ + int nsize = l_com-s_com + 400 + desired_size; \ int com_len = e_com - s_com; \ int blank_pos; \ if (last_bl != NULL) \ @@ -81,9 +81,9 @@ FILE *output; /* the output file */ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ } -#define CHECK_SIZE_LAB \ - if (e_lab >= l_lab) { \ - int nsize = l_lab-s_lab+400; \ +#define CHECK_SIZE_LAB(desired_size) \ + if (e_lab + (desired_size) >= l_lab) { \ + int nsize = l_lab-s_lab + 400 + desired_size; \ int label_len = e_lab - s_lab; \ labbuf = (char *) realloc(labbuf, nsize); \ if (labbuf == NULL) \ @@ -92,9 +92,9 @@ FILE *output; /* the output file */ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ } -#define CHECK_SIZE_TOKEN \ - if (e_token >= l_token) { \ - int nsize = l_token-s_token+400; \ +#define CHECK_SIZE_TOKEN(desired_size) \ + if (e_token + (desired_size) >= l_token) { \ + int nsize = l_token-s_token + 400 + desired_size; \ int token_len = e_token - s_token; \ tokenbuf = (char *) realloc(tokenbuf, nsize); \ if (tokenbuf == NULL) \ Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 18:17:07 2018 (r334575) +++ head/usr.bin/indent/lexi.c Sun Jun 3 18:19:41 2018 (r334576) @@ -182,47 +182,32 @@ lexi(struct parser_state *state) if (isdigit((unsigned char)*buf_ptr) || (buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) { - enum base { - BASE_2, BASE_8, BASE_10, BASE_16 - }; int seendot = 0, seenexp = 0, seensfx = 0; - enum base in_base = BASE_10; - if (*buf_ptr == '0') { + /* + * base 2, base 8, base 16: + */ + if (buf_ptr[0] == '0' && buf_ptr[1] != '.') { + int len; + if (buf_ptr[1] == 'b' || buf_ptr[1] == 'B') - in_base = BASE_2; + len = strspn(buf_ptr + 2, "01") + 2; else if (buf_ptr[1] == 'x' || buf_ptr[1] == 'X') - in_base = BASE_16; - else if (isdigit((unsigned char)buf_ptr[1])) - in_base = BASE_8; - } - switch (in_base) { - case BASE_2: - *e_token++ = *buf_ptr++; - *e_token++ = *buf_ptr++; - while (*buf_ptr == '0' || *buf_ptr == '1') { - CHECK_SIZE_TOKEN; - *e_token++ = *buf_ptr++; + len = strspn(buf_ptr + 2, "0123456789ABCDEFabcdef") + 2; + else + len = strspn(buf_ptr + 1, "012345678") + 1; + if (len > 0) { + CHECK_SIZE_TOKEN(len); + memcpy(e_token, buf_ptr, len); + e_token += len; + buf_ptr += len; } - break; - case BASE_8: - *e_token++ = *buf_ptr++; - while (*buf_ptr >= '0' && *buf_ptr <= '8') { - CHECK_SIZE_TOKEN; - *e_token++ = *buf_ptr++; - } - break; - case BASE_16: - *e_token++ = *buf_ptr++; - *e_token++ = *buf_ptr++; - while (isxdigit((unsigned char)*buf_ptr)) { - CHECK_SIZE_TOKEN; - *e_token++ = *buf_ptr++; - } - break; - case BASE_10: + else + diag2(1, "Unterminated literal"); + } + else /* base 10: */ while (1) { if (*buf_ptr == '.') { if (seendot) @@ -230,7 +215,7 @@ lexi(struct parser_state *state) else seendot++; } - CHECK_SIZE_TOKEN; + CHECK_SIZE_TOKEN(3); *e_token++ = *buf_ptr++; if (!isdigit((unsigned char)*buf_ptr) && *buf_ptr != '.') { if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp) @@ -238,24 +223,21 @@ lexi(struct parser_state *state) else { seenexp++; seendot++; - CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; if (*buf_ptr == '+' || *buf_ptr == '-') *e_token++ = *buf_ptr++; } } } - break; - } + while (1) { + CHECK_SIZE_TOKEN(2); if (!(seensfx & 1) && (*buf_ptr == 'U' || *buf_ptr == 'u')) { - CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; seensfx |= 1; continue; } if (!(seensfx & 2) && (strchr("fFlL", *buf_ptr) != NULL)) { - CHECK_SIZE_TOKEN; if (buf_ptr[1] == buf_ptr[0]) *e_token++ = *buf_ptr++; *e_token++ = *buf_ptr++; @@ -276,13 +258,13 @@ lexi(struct parser_state *state) } else break; } - CHECK_SIZE_TOKEN; + CHECK_SIZE_TOKEN(1); /* copy it over */ *e_token++ = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer(); } - *e_token++ = '\0'; + *e_token = '\0'; if (s_token[0] == 'L' && s_token[1] == '\0' && (*buf_ptr == '"' || *buf_ptr == '\'')) @@ -397,6 +379,7 @@ lexi(struct parser_state *state) /* Scan a non-alphanumeric token */ + CHECK_SIZE_TOKEN(3); /* things like "<<=" */ *e_token++ = *buf_ptr; /* if it is only a one-character token, it is * moved here */ *e_token = '\0'; @@ -424,9 +407,7 @@ lexi(struct parser_state *state) diag2(1, "Unterminated literal"); goto stop_lit; } - CHECK_SIZE_TOKEN; /* Only have to do this once in this loop, - * since CHECK_SIZE guarantees that there - * are at least 5 entries left */ + CHECK_SIZE_TOKEN(2); *e_token = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer(); @@ -585,8 +566,10 @@ stop_lit: break; } while (*buf_ptr == '*' || isspace((unsigned char)*buf_ptr)) { - if (*buf_ptr == '*') + if (*buf_ptr == '*') { + CHECK_SIZE_TOKEN(1); *e_token++ = *buf_ptr; + } if (++buf_ptr >= buf_end) fill_buffer(); } @@ -620,6 +603,7 @@ stop_lit: /* * handle ||, &&, etc, and also things as in int *****i */ + CHECK_SIZE_TOKEN(1); *e_token++ = *buf_ptr; if (++buf_ptr >= buf_end) fill_buffer(); @@ -632,6 +616,7 @@ stop_lit: if (buf_ptr >= buf_end) /* check for input buffer empty */ fill_buffer(); state->last_u_d = unary_delim; + CHECK_SIZE_TOKEN(1); *e_token = '\0'; /* null terminate the token */ return (code); } Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jun 3 18:17:07 2018 (r334575) +++ head/usr.bin/indent/pr_comment.c Sun Jun 3 18:19:41 2018 (r334576) @@ -205,9 +205,9 @@ pr_comment(void) while (1) { /* this loop will go until the comment is * copied */ - CHECK_SIZE_COM; switch (*buf_ptr) { /* this checks for various spcl cases */ case 014: /* check for a form feed */ + CHECK_SIZE_COM(3); if (!ps.box_com) { /* in a text comment, break the line here */ ps.use_ff = true; /* fix so dump_line uses a form feed */ @@ -232,6 +232,7 @@ pr_comment(void) return; } last_bl = NULL; + CHECK_SIZE_COM(4); if (ps.box_com || ps.last_nl) { /* if this is a boxed comment, * we dont ignore the newline */ if (s_com == e_com) @@ -255,7 +256,6 @@ pr_comment(void) */ else { /* otherwise, insert one */ last_bl = e_com; - CHECK_SIZE_COM; *e_com++ = ' '; } } @@ -282,12 +282,11 @@ pr_comment(void) * of comment */ if (++buf_ptr >= buf_end) /* get to next char after * */ fill_buffer(); - + CHECK_SIZE_COM(4); if (*buf_ptr == '/') { /* it is the end!!! */ end_of_comment: if (++buf_ptr >= buf_end) fill_buffer(); - CHECK_SIZE_COM; if (break_delim) { if (e_com > s_com + 3) { dump_line(); @@ -308,6 +307,7 @@ pr_comment(void) default: /* we have a random char */ now_col = count_spaces_until(ps.com_col, s_com, e_com); do { + CHECK_SIZE_COM(1); *e_com = *buf_ptr++; if (buf_ptr >= buf_end) fill_buffer(); @@ -337,11 +337,16 @@ pr_comment(void) t_ptr++) ; last_bl = NULL; + /* + * t_ptr will be somewhere between e_com (dump_line() reset) + * and l_com. So it's safe to copy byte by byte from t_ptr + * to e_com without any CHECK_SIZE_COM(). + */ while (*t_ptr != '\0') { if (*t_ptr == ' ' || *t_ptr == '\t') last_bl = e_com; *e_com++ = *t_ptr++; - } + } } break; } From owner-svn-src-head@freebsd.org Sun Jun 3 18:29:21 2018 Return-Path: Delivered-To: svn-src-head@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 754D2FE9F94; Sun, 3 Jun 2018 18:29:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2919A740BB; Sun, 3 Jun 2018 18:29:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B625223A2; Sun, 3 Jun 2018 18:29:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53ITKGW043168; Sun, 3 Jun 2018 18:29:20 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53ITKaa043167; Sun, 3 Jun 2018 18:29:20 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031829.w53ITKaa043167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334578 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 18:29:21 -0000 Author: pstef Date: Sun Jun 3 18:29:20 2018 New Revision: 334578 URL: https://svnweb.freebsd.org/changeset/base/334578 Log: indent(1): don't overflow di_stack[] Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 18:19:48 2018 (r334577) +++ head/usr.bin/indent/indent.c Sun Jun 3 18:29:20 2018 (r334578) @@ -831,7 +831,12 @@ check_type: * with '{' */ if (ps.in_decl && ps.in_or_st) { /* this is either a structure * declaration or an init */ - di_stack[ps.dec_nest++] = dec_ind; + di_stack[ps.dec_nest] = dec_ind; + if (++ps.dec_nest == nitems(di_stack)) { + diag3(0, "Reached internal limit of %d struct levels", + nitems(di_stack)); + ps.dec_nest--; + } /* ? dec_ind = 0; */ } else { From owner-svn-src-head@freebsd.org Sun Jun 3 18:32:12 2018 Return-Path: Delivered-To: svn-src-head@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 82F98FEA4C5; Sun, 3 Jun 2018 18:32:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34F3E7451D; Sun, 3 Jun 2018 18:32:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 163322252E; Sun, 3 Jun 2018 18:32:12 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53IWBTO047921; Sun, 3 Jun 2018 18:32:11 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53IWBI1047920; Sun, 3 Jun 2018 18:32:11 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031832.w53IWBI1047920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 18:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334579 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 18:32:12 -0000 Author: pstef Date: Sun Jun 3 18:32:11 2018 New Revision: 334579 URL: https://svnweb.freebsd.org/changeset/base/334579 Log: indent(1): ignore null characters from input Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 18:29:20 2018 (r334578) +++ head/usr.bin/indent/io.c Sun Jun 3 18:32:11 2018 (r334579) @@ -300,7 +300,8 @@ fill_buffer(void) had_eof = true; break; } - *p++ = i; + if (i != '\0') + *p++ = i; if (i == '\n') break; } From owner-svn-src-head@freebsd.org Sun Jun 3 18:34:37 2018 Return-Path: Delivered-To: svn-src-head@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 60ECCFEAA47; Sun, 3 Jun 2018 18:34:37 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC7574805; Sun, 3 Jun 2018 18:34:37 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E18E12254B; Sun, 3 Jun 2018 18:34:36 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53IYa6i048069; Sun, 3 Jun 2018 18:34:36 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53IYatM048068; Sun, 3 Jun 2018 18:34:36 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031834.w53IYatM048068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 18:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334580 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 18:34:37 -0000 Author: pstef Date: Sun Jun 3 18:34:36 2018 New Revision: 334580 URL: https://svnweb.freebsd.org/changeset/base/334580 Log: indent(1): don't add a space after a label It's not needed and it fools pr_comment(). Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 18:32:11 2018 (r334579) +++ head/usr.bin/indent/indent.c Sun Jun 3 18:34:36 2018 (r334580) @@ -724,7 +724,6 @@ check_type: memcpy(e_lab, s_code, len); e_lab += len; *e_lab++ = ':'; - *e_lab++ = ' '; *e_lab = '\0'; e_code = s_code; } From owner-svn-src-head@freebsd.org Sun Jun 3 18:38:04 2018 Return-Path: Delivered-To: svn-src-head@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 5BEF6FEB239; Sun, 3 Jun 2018 18:38:04 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9C074B8D; Sun, 3 Jun 2018 18:38:04 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4A5722558; Sun, 3 Jun 2018 18:38:03 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Ic312048247; Sun, 3 Jun 2018 18:38:03 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Ic3YJ048246; Sun, 3 Jun 2018 18:38:03 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031838.w53Ic3YJ048246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 18:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334581 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 18:38:04 -0000 Author: pstef Date: Sun Jun 3 18:38:03 2018 New Revision: 334581 URL: https://svnweb.freebsd.org/changeset/base/334581 Log: indent(1): if the token is a "[" then neither of the blocks is relevant Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 18:34:36 2018 (r334580) +++ head/usr.bin/indent/indent.c Sun Jun 3 18:38:03 2018 (r334581) @@ -569,13 +569,15 @@ check_type: nitems(ps.paren_indents)); ps.p_l_follow--; } - if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && + if (*token == '[') + /* not a function pointer declaration or a function call */; + else if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && ps.procname[0] == '\0' && ps.paren_level == 0) { /* function pointer declarations */ indent_declaration(dec_ind, tabs_to_var); ps.dumped_decl_indent = true; } - else if (ps.want_blank && *token != '[' && + else if (ps.want_blank && ((ps.last_token != ident && ps.last_token != funcname) || proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets From owner-svn-src-head@freebsd.org Sun Jun 3 19:05:22 2018 Return-Path: Delivered-To: svn-src-head@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 91EA0FEE134; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F4C75E4B; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2069A22A2E; Sun, 3 Jun 2018 19:05:22 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53J5L7t063220; Sun, 3 Jun 2018 19:05:21 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53J5LWg063216; Sun, 3 Jun 2018 19:05:21 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806031905.w53J5LWg063216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 19:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334583 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 19:05:22 -0000 Author: pstef Date: Sun Jun 3 19:05:20 2018 New Revision: 334583 URL: https://svnweb.freebsd.org/changeset/base/334583 Log: indent(1): if an identifier can be either a typedef name or as a struct member, it is taken as the latter Modified: head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/parens.0 head/usr.bin/indent/tests/parens.0.pro head/usr.bin/indent/tests/parens.0.stdout Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/lexi.c Sun Jun 3 19:05:20 2018 (r334583) @@ -321,6 +321,10 @@ lexi(struct parser_state *state) /* inside parens: cast, param list, offsetof or sizeof */ state->cast_mask |= (1 << state->p_l_follow) & ~state->not_cast_mask; } + if (state->last_token == period || state->last_token == unary_op) { + state->keyword = 0; + break; + } if (p != NULL && p->rwcode == 3) return (structure); if (state->p_l_follow) Modified: head/usr.bin/indent/tests/parens.0 ============================================================================== --- head/usr.bin/indent/tests/parens.0 Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0 Sun Jun 3 19:05:20 2018 (r334583) @@ -21,4 +21,7 @@ test(void) char *xxx = firstf(secondf2(p1, p2)); } + + rb->allocfunc(1); + rb2.allocfunc(7); } Modified: head/usr.bin/indent/tests/parens.0.pro ============================================================================== --- head/usr.bin/indent/tests/parens.0.pro Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0.pro Sun Jun 3 19:05:20 2018 (r334583) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ --ts4 -i4 -di12 +-ts4 -i4 -di12 -Tallocfunc Modified: head/usr.bin/indent/tests/parens.0.stdout ============================================================================== --- head/usr.bin/indent/tests/parens.0.stdout Sun Jun 3 18:39:13 2018 (r334582) +++ head/usr.bin/indent/tests/parens.0.stdout Sun Jun 3 19:05:20 2018 (r334583) @@ -21,4 +21,7 @@ test(void) char *xxx = firstf(secondf2(p1, p2)); } + + rb->allocfunc(1); + rb2.allocfunc(7); } From owner-svn-src-head@freebsd.org Sun Jun 3 19:37:10 2018 Return-Path: Delivered-To: svn-src-head@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 4608BFF1A9B; Sun, 3 Jun 2018 19:37:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED58E77AEF; Sun, 3 Jun 2018 19:37:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE5BB22F18; Sun, 3 Jun 2018 19:37:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Jb91R079025; Sun, 3 Jun 2018 19:37:09 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Jb95l079024; Sun, 3 Jun 2018 19:37:09 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806031937.w53Jb95l079024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 3 Jun 2018 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334584 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 334584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 19:37:10 -0000 Author: mmacy Date: Sun Jun 3 19:37:09 2018 New Revision: 334584 URL: https://svnweb.freebsd.org/changeset/base/334584 Log: pmc: remove assert that is invalid in interrupt context Modified: head/sys/sys/pmckern.h Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Sun Jun 3 19:05:20 2018 (r334583) +++ head/sys/sys/pmckern.h Sun Jun 3 19:37:09 2018 (r334584) @@ -217,7 +217,6 @@ do { \ */ #define PMC_CALL_HOOK_UNLOCKED(t, cmd, arg) \ do { \ - MPASS(!in_epoch()); \ if (pmc_hook != NULL) \ (pmc_hook)((t), (cmd), (arg)); \ } while (0) From owner-svn-src-head@freebsd.org Sun Jun 3 19:37:18 2018 Return-Path: Delivered-To: svn-src-head@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 81EA6FF1AE7; Sun, 3 Jun 2018 19:37:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BEC077BD8; Sun, 3 Jun 2018 19:37:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CF6F22F19; Sun, 3 Jun 2018 19:37:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53JbHb6079079; Sun, 3 Jun 2018 19:37:17 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53JbHoj079078; Sun, 3 Jun 2018 19:37:17 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806031937.w53JbHoj079078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 3 Jun 2018 19:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334585 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 19:37:18 -0000 Author: mmacy Date: Sun Jun 3 19:37:17 2018 New Revision: 334585 URL: https://svnweb.freebsd.org/changeset/base/334585 Log: hwpmc: ensure that mapin updates are synchronous Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Sun Jun 3 19:37:09 2018 (r334584) +++ head/sys/dev/hwpmc/hwpmc_logging.c Sun Jun 3 19:37:17 2018 (r334585) @@ -958,7 +958,7 @@ pmclog_process_map_in(struct pmc_owner *po, pid_t pid, PMCLOG_EMIT32(pid); PMCLOG_EMITADDR(start); PMCLOG_EMITSTRING(path,pathlen); - PMCLOG_DESPATCH(po); + PMCLOG_DESPATCH_SYNC(po); } void From owner-svn-src-head@freebsd.org Sun Jun 3 19:46:45 2018 Return-Path: Delivered-To: svn-src-head@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 04EC8FF2DAA; Sun, 3 Jun 2018 19:46:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE79778625; Sun, 3 Jun 2018 19:46:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0A23230CC; Sun, 3 Jun 2018 19:46:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Jki6c084474; Sun, 3 Jun 2018 19:46:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53JkiHm084473; Sun, 3 Jun 2018 19:46:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806031946.w53JkiHm084473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 3 Jun 2018 19:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334586 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 334586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 19:46:45 -0000 Author: rmacklem Date: Sun Jun 3 19:46:44 2018 New Revision: 334586 URL: https://svnweb.freebsd.org/changeset/base/334586 Log: Fix a gcc8 warning about a write only variable. gcc8 warns that "verf" was set but not used. This was because the code that uses it is disabled via a "#if 0". This patch adds a "#if 0" to the variable's declaration and assignment to get rid of the warning. This way the code could be re-enabled without difficulty. Requested by: mmacy MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:37:17 2018 (r334585) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:46:44 2018 (r334586) @@ -1574,7 +1574,10 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, struct nfsvattr at; int nlen, error = 0, getret = 1; int siz, cnt, fullsiz, eofflag, ncookies; - u_int64_t off, toff, verf; + u_int64_t off, toff; +#if 0 + u_int64_t verf; +#endif u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; @@ -1591,7 +1594,9 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); off = fxdr_hyper(tl); tl += 2; +#if 0 verf = fxdr_hyper(tl); +#endif tl += 2; } toff = off; From owner-svn-src-head@freebsd.org Sun Jun 3 20:24:26 2018 Return-Path: Delivered-To: svn-src-head@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 35452FF7648 for ; Sun, 3 Jun 2018 20:24:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 C639F7A8C7 for ; Sun, 3 Jun 2018 20:24:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id d10-v6so7673227itj.1 for ; Sun, 03 Jun 2018 13:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XAG3dTq6vXxS3zcSIAM5Hv/0G+LDAdrXf1LHQ7N/8mg=; b=gLfpsPY9Nid32lNI8t3ECtUxRAjqOc0lw2iZXJohXIEFr/LHP3nJkyFCZ32KKsCKSW lC544j42AZnV9z2V/b+rIESbuxk8qA33xyeVzH9zXgR80D7uNxD3Udy8TbTGDQncsuFe pnMVAlFkVrxtijBuuM0ClOzE3ybNTUlO7CpA7lwY8Q6bp7D0IiV3xMUFd1qVJK7pemK0 6l8ftwFFP06E/UX6wn7Fmu+OGUU4xJcSrymSbkD8Yq1NdswVsHy+XptXOrGEIcBdoi0X b2gy8J3EKbjP9spiLmS+S08OjzvEvJWz3eu897/8lK035Z7PNDAHQnu62M/U5m1lrHSR sKiQ== 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=XAG3dTq6vXxS3zcSIAM5Hv/0G+LDAdrXf1LHQ7N/8mg=; b=ZoimXJgHwG4T5Ek9bb5Q8BlUEIlUEJlAFSNcsVN2d3PnZbh/odw3GSxmLcfaFb64Ey qN5otv2CSauW70MkGrmjaZ6wooLgk8E9eDenW7t1AMy1paDvjGZ17OpjDBB5Knidv6Z/ fcHEIrsz4cZjefpemxxZ8yk3b5KE7XWId1zmkvXrd8EfYzIGbNqjoIHEykoyRdkRQUZN ICZCxmzF6TrqAgRtF8Lj8lBpsmCrasfpXxnjL0w3n80I9UO7B4SijdxkNFuw1pciiVzr BNkQ4LqB/Q35aYnfNEuwVGRr8eP2gBNVgelXyC6BiYumq0UlBLbhtvHK677uKgQbm58e E0LQ== X-Gm-Message-State: ALKqPwffIlBw4EHC6Awkym46UmMgvGnSjf7ZAmNPGNymB4/aW8GRNqsG GO/RGMT4Bit+9sytwV1C7zxgaFIbR+Y3TItaM5N3Sg== X-Google-Smtp-Source: ADUXVKJCRow3rKPW/M//zUwymwhABh8chkieK/r/NNAup8wsWh/RtfEnrEhKFWZd+M3pnNzkBa3GsDK9wZOYTC/gQjw= X-Received: by 2002:a24:5b81:: with SMTP id g123-v6mr9358878itb.1.1528057464973; Sun, 03 Jun 2018 13:24:24 -0700 (PDT) MIME-Version: 1.0 References: <201806030507.w5357kMm036583@repo.freebsd.org> In-Reply-To: <201806030507.w5357kMm036583@repo.freebsd.org> From: Warner Losh Date: Sun, 3 Jun 2018 14:24:13 -0600 Message-ID: Subject: Re: svn commit: r334552 - head/usr.bin/top To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 20:24:26 -0000 This came up a few days ago on tech-kern@netbsd.org mailing list as well... Warner On Sat, Jun 2, 2018, 11:07 PM Eitan Adler wrote: > Author: eadler > Date: Sun Jun 3 05:07:46 2018 > New Revision: 334552 > URL: https://svnweb.freebsd.org/changeset/base/334552 > > Log: > top(1): remove chdir to / > > While this came out of a conversation in IRC, it turn out that some > people don't like it. Since this was a courtesy feature, just remove it. > > Modified: > head/usr.bin/top/top.c > > Modified: head/usr.bin/top/top.c > > ============================================================================== > --- head/usr.bin/top/top.c Sun Jun 3 05:07:39 2018 (r334551) > +++ head/usr.bin/top/top.c Sun Jun 3 05:07:46 2018 (r334552) > @@ -260,15 +260,6 @@ main(int argc, char *argv[]) > #define CMD_order 26 > #define CMD_pid 27 > > - /* > - * Since top(1) is often long running and > - * doesn't typically care about where its running from > - * chdir to the root to allow unmounting of its > - * original wd. Failure is alright as this is > - * just a courtesy for users. > - */ > - chdir("/"); > - > /* set the buffer for stdout */ > #ifdef DEBUG > extern FILE *debug; > > From owner-svn-src-head@freebsd.org Sun Jun 3 20:25:29 2018 Return-Path: Delivered-To: svn-src-head@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 45697FF7801 for ; Sun, 3 Jun 2018 20:25:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::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 CD5FB7AA50 for ; Sun, 3 Jun 2018 20:25:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id d185-v6so7667783ioe.0 for ; Sun, 03 Jun 2018 13:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yN9LC7isxNMkH1FAneZs16d6/7yOmUaUEDZYwieoiMU=; b=dyRnxxk0qoutuPnLvzIYk1UMlz9TIlwqTpPq6H/eh00AwzaIEIrGT8P5ujPEA3AZ5a epck93ydLurM1usaV1Do631mqhAbSvwguwIbZ2kcFKTLi6/9Txrm7yGOtebsIh3kPd0z xJ21Ggye6XCz67eifcOjD4VjE1rHXrBznT9TBr1inxtNkqJT186vvHIzjF2xH+zQVnsy MB05w9PlxrNeh2deA1Skx0j9Dlr4jiXOp7XwXGvokdqd7ZJPqzKQQrzn9iwEyCBwIsjM Duh/Gd+WvYnsfUVYoZ03MkqQ0K1B9zrnIAQrEmnQS4e7eFzTiX3Om+NxV3dFy/KRtOU+ ci1A== 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=yN9LC7isxNMkH1FAneZs16d6/7yOmUaUEDZYwieoiMU=; b=VwSmnxPtZxvWroYwy3qjyfr72qhk7L/SivIbmg+RKLeyCppEFXV046BxVvuG7ixSUI ZkISQOLd1ina/iCLhPWx/YlWXY+omJ7pKydtt769sTFkkYLZZzFzTy/8njZTDAfYxWUh C+4RhgyNft79NEhI/WGkTc1p6CYloXpXP/8gKQzWI3j8IaBYvXtzaSpGJXCtIj1Wvk+t hPiGBtNnqsDhPYCMLin7mGvgSMGGnVndvFiWnWiAFmgShpJQEMEPlRXN5yJ/xEyGBLdb LO0bQCbuw+UScYTMq9ISTi8yOK5sTs3c9Nw6ZtPHfMvxNBZ+4lMKiYcAFHNDd6ehhx/i d/dw== X-Gm-Message-State: ALKqPwdo5phiW6vhYbzefiI11cbIEwdxLj4HCCCcbmPR7h3quJmyc7US sdxtqlZnoJV67okearuas5YULRatEx4TqekDMH5Rxg== X-Google-Smtp-Source: ADUXVKKda61rIFin4ALo4U/sj9O6ooPxU2nDZa+03hXZeOKZC41olx39Taq1wXdSiNVvHurj95Z/CRAW9PWt1w4fGUI= X-Received: by 2002:a6b:1c87:: with SMTP id c129-v6mr18604964ioc.39.1528057528206; Sun, 03 Jun 2018 13:25:28 -0700 (PDT) MIME-Version: 1.0 References: <201806030507.w5357kMm036583@repo.freebsd.org> In-Reply-To: <201806030507.w5357kMm036583@repo.freebsd.org> From: Warner Losh Date: Sun, 3 Jun 2018 14:25:16 -0600 Message-ID: Subject: Re: svn commit: r334552 - head/usr.bin/top To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 20:25:29 -0000 Also, this is a mistake. You should put it back in. Warner On Sat, Jun 2, 2018, 11:07 PM Eitan Adler wrote: > Author: eadler > Date: Sun Jun 3 05:07:46 2018 > New Revision: 334552 > URL: https://svnweb.freebsd.org/changeset/base/334552 > > Log: > top(1): remove chdir to / > > While this came out of a conversation in IRC, it turn out that some > people don't like it. Since this was a courtesy feature, just remove it. > > Modified: > head/usr.bin/top/top.c > > Modified: head/usr.bin/top/top.c > > ============================================================================== > --- head/usr.bin/top/top.c Sun Jun 3 05:07:39 2018 (r334551) > +++ head/usr.bin/top/top.c Sun Jun 3 05:07:46 2018 (r334552) > @@ -260,15 +260,6 @@ main(int argc, char *argv[]) > #define CMD_order 26 > #define CMD_pid 27 > > - /* > - * Since top(1) is often long running and > - * doesn't typically care about where its running from > - * chdir to the root to allow unmounting of its > - * original wd. Failure is alright as this is > - * just a courtesy for users. > - */ > - chdir("/"); > - > /* set the buffer for stdout */ > #ifdef DEBUG > extern FILE *debug; > > From owner-svn-src-head@freebsd.org Sun Jun 3 20:49:00 2018 Return-Path: Delivered-To: svn-src-head@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 EA76FFD36A0; Sun, 3 Jun 2018 20:48:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 989917B73D; Sun, 3 Jun 2018 20:48:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CEA423A83; Sun, 3 Jun 2018 20:48:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Kmxm4015156; Sun, 3 Jun 2018 20:48:59 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53KmxdH015155; Sun, 3 Jun 2018 20:48:59 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806032048.w53KmxdH015155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 20:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334587 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 20:49:00 -0000 Author: pstef Date: Sun Jun 3 20:48:58 2018 New Revision: 334587 URL: https://svnweb.freebsd.org/changeset/base/334587 Log: indent(1): manual page corretions Add missing options, synchronize syntax summary with the actual option list, and other fixes. Submitted by: Tom Lane Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Jun 3 19:46:44 2018 (r334586) +++ head/usr.bin/indent/indent.1 Sun Jun 3 20:48:58 2018 (r334587) @@ -43,14 +43,9 @@ .Op Fl bad | Fl nbad .Op Fl badp | Fl nbadp .Op Fl bap | Fl nbap -.Bk -words -.Op Fl ei | Fl ei -.Op Fl eei | Fl eei .Op Fl bbb | Fl nbbb -.Ek .Op Fl \&bc | Fl nbc -.Op Fl \&bl -.Op Fl \&br +.Op Fl \&bl | Fl \&br .Op Fl bs | Fl nbs .Op Fl c Ns Ar n .Op Fl \&cd Ns Ar n @@ -62,7 +57,12 @@ .Op Fl cli Ns Ar n .Op Fl d Ns Ar n .Op Fl \&di Ns Ar n +.Op Fl dj | Fl ndj .Bk -words +.Op Fl ei | Fl nei +.Op Fl eei | Fl neei +.Ek +.Bk -words .Op Fl fbs | Fl nfbs .Op Fl fc1 | Fl nfc1 .Op Fl fcb | Fl nfcb @@ -84,6 +84,7 @@ .Ek .Op Fl \&st .Op Fl \&ta +.Op Fl T Ns Ar typename .Op Fl ts Ns Ar n .Op Fl U Ns Ar file .Op Fl ut | Fl nut @@ -177,10 +178,10 @@ is specified, then a newline is forced after each comm turns off this option. Default: .Fl \&nbc . -.It Fl \&br , \&bl +.It Fl \&bl , \&br Specifying .Fl \&bl -lines-up compound statements like this: +lines up compound statements like this: .Bd -literal -offset indent if (...) { @@ -265,7 +266,7 @@ means that such comments are placed one indentation le left of code. Specifying the default .Fl \&d\&0 -lines-up these comments with the code. +lines up these comments with the code. See the section on comment indentation below. .It Fl \&di Ns Ar n @@ -332,7 +333,7 @@ Block comments are then handled like box comments. The default is .Fl fcb . .It Fl i Ns Ar n -The number of spaces for one indentation level. +The number of columns for one indentation level. The default is 8. .It Fl \&ip , nip Enables (disables) the indentation of parameter declarations from the left @@ -353,7 +354,7 @@ relative to the beginning of their type declaration. The default is for local variable names to be indented by the same amount as global ones. .It Fl \&lp , nlp -Lines-up code surrounded by parenthesis in continuation lines. +Lines up code surrounded by parentheses in continuation lines. If a line has a left paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left From owner-svn-src-head@freebsd.org Sun Jun 3 21:00:01 2018 Return-Path: Delivered-To: svn-src-head@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 484BCFD4F7C; Sun, 3 Jun 2018 21:00:01 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA9D77C1DD; Sun, 3 Jun 2018 21:00:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C930A23C35; Sun, 3 Jun 2018 21:00:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53L00OY020252; Sun, 3 Jun 2018 21:00:00 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53KxxUK020187; Sun, 3 Jun 2018 20:59:59 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806032059.w53KxxUK020187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 20:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334588 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:00:01 -0000 Author: pstef Date: Sun Jun 3 20:59:59 2018 New Revision: 334588 URL: https://svnweb.freebsd.org/changeset/base/334588 Log: indent(1): new option -lpl (always line up to parenthesis) With -lp, if a line has an opening paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the opening paren. Submitted by: Tom Lane Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 20:48:58 2018 (r334587) +++ head/usr.bin/indent/args.c Sun Jun 3 20:59:59 2018 (r334588) @@ -125,6 +125,7 @@ struct pro { {"i", PRO_INT, 8, 0, &ps.ind_size}, {"lc", PRO_INT, 0, 0, &block_comment_max_col}, {"ldi", PRO_INT, -1, 0, &ps.local_decl_indent}, + {"lpl", PRO_BOOL, false, ON, &lineup_to_parens_always}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens}, {"l", PRO_INT, 78, 0, &max_col}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation}, @@ -143,6 +144,7 @@ struct pro { {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments}, {"nfcb", PRO_BOOL, true, OFF, &format_block_comments}, {"nip", PRO_BOOL, true, OFF, &ps.indent_parameters}, + {"nlpl", PRO_BOOL, false, OFF, &lineup_to_parens_always}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Jun 3 20:48:58 2018 (r334587) +++ head/usr.bin/indent/indent.1 Sun Jun 3 20:59:59 2018 (r334588) @@ -73,6 +73,7 @@ .Op Fl \&lc Ns Ar n .Op Fl \&ldi Ns Ar n .Op Fl \&lp | Fl nlp +.Op Fl \&lpl | Fl nlpl .Op Fl npro .Op Fl P Ns Ar file .Op Fl pcs | Fl npcs @@ -355,7 +356,9 @@ The default is for local variable names to be indented by the same amount as global ones. .It Fl \&lp , nlp Lines up code surrounded by parentheses in continuation lines. -If a line +With +.Fl \&lp , +if a line has a left paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left paren. @@ -382,6 +385,19 @@ p1\ =\ first_procedure(second_procedure(p2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ third_procedure(p4, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p5)); .Ed +.It Fl \&lpl , nlpl +With +.Fl \&lpl , +code surrounded by parentheses in continuation lines is lined up even if it +would extend past the right margin. +With +.Fl \&nlpl +(the default), such a line that would extend past the right margin is moved +left to keep it within the margin, if that does not require placing it to +the left of the prevailing indentation level. +These switches have no effect if +.Fl nlp +is selected. .It Fl npro Causes the profile files, .Sq Pa ./.indent.pro Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 20:48:58 2018 (r334587) +++ head/usr.bin/indent/indent.c Sun Jun 3 20:59:59 2018 (r334588) @@ -174,6 +174,7 @@ main(int argc, char **argv) #ifdef undef max_col = 78; /* -l78 */ lineup_to_parens = 1; /* -lp */ + lineup_to_parens_always = 0; /* -nlpl */ ps.ljust_decl = 0; /* -ndj */ ps.com_ind = 33; /* -c33 */ star_comment_cont = 1; /* -sc */ Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 20:48:58 2018 (r334587) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 20:59:59 2018 (r334588) @@ -186,6 +186,8 @@ int continuation_indent;/* set to the indentat * code and continuation lines */ int lineup_to_parens; /* if true, continued code within parens will * be lined up to the open paren */ +int lineup_to_parens_always; /* if true, do not attempt to keep + * lined-up code within the margin */ int Bill_Shannon; /* true iff a blank should always be inserted * after sizeof */ int blanklines_after_declarations_at_proctop; /* This is vaguely Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 20:48:58 2018 (r334587) +++ head/usr.bin/indent/io.c Sun Jun 3 20:59:59 2018 (r334588) @@ -226,6 +226,8 @@ compute_code_target(void) if (!lineup_to_parens) target_col += continuation_indent * (2 * continuation_indent == ps.ind_size ? 1 : ps.paren_level); + else if (lineup_to_parens_always) + target_col = paren_target; else { int w; int t = paren_target; From owner-svn-src-head@freebsd.org Sun Jun 3 21:24:29 2018 Return-Path: Delivered-To: svn-src-head@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 74B1EFDDD58 for ; Sun, 3 Jun 2018 21:24:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::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 E93DF7DBF7 for ; Sun, 3 Jun 2018 21:24:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id m194-v6so7766386itg.2 for ; Sun, 03 Jun 2018 14:24:28 -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=kkzU+R7P6O7qxoNzZ7hicVDRC0qbbEBlStc8zyiczlU=; b=tU0WxUG/JEDne5OUvT7uNk8Kp4T7+2iAohTmIMdvpTDNQmRpRpN1lmS8aRUi0YJNAe hhWEJZIYakB7D+BcntmI6XoXwwdkvMfBRs0mBn8cWiEqQEy+1VPMFwQ3W2zo9J6oNsAv E4xa8sKta/FXbNdCQE9DGm637R6vjgUzv6mkAUMZq71Cx8UnIv47OiP2iYoTV1D0l29o vfklDva+aQ7jI8M/Gv7XNsIFDXUhkqrU2idp9D12QYjGpTqsQLf/QkjjGs2QXbMADUsx 1pO7bdKwB+E5T1QPEd58Sd//D+U/MN6oO08c+t7qMYRUGoTsh537uivns4jRoi9XhrM+ LfZw== 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=kkzU+R7P6O7qxoNzZ7hicVDRC0qbbEBlStc8zyiczlU=; b=D0lAZLZokm+lkvE+YK205AA7hEMrH+WQX83cAY3Y3sNMvxxMpyT+B7WKwqBZHpJY9z 4ps7sBISKGmiQd+rGUfXG3aRha0HEzZN4vPGv3OkYivOgJpTFXY6raXmRCG+IOfelJ0G U+6O3V5byVHS9Y30uoYSH92eGzPr89Haci56n5Xsh2PNYq4+Qt/WGGlfvlAZUdpsu1+e PJCsJ2baMyr8OTC1zicBT/R3nKkuoj4lHuFEw2ZXwpTETxtbqIMJJav80CbPq1Pufo4e JEFV2RH9lyzyBnQnRqJ8mLMdD9w3pstEIls74MpexNCtUdFHTeHGaHMwNS9akohrQ4LC b1Ig== X-Gm-Message-State: APt69E2Zt3+fGRWG4Mdht0+lP0ZbhTC9czT9x3935t6jNWwSD1tOEV2G eAgTN2TDAZ/4sfww4Hbb/Jug6eTBeU9wayXqt5X4xg== X-Google-Smtp-Source: ADUXVKLt/r98wDOs5YwNP9ui/28crQDFxHxdOdV+CCXODuXepZ28/QGCz9PQZfQjAk/gzsP3GuyRP0mKOiaKU+LrtWk= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr4402482itd.73.1528061068317; Sun, 03 Jun 2018 14:24:28 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Sun, 3 Jun 2018 14:24:27 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806022206.w52M6S98020830@repo.freebsd.org> <201806022356.w52NuiFK088665@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 3 Jun 2018 15:24:27 -0600 X-Google-Sender-Auth: LjT7xRYg1q8hNRNgIh6sDDeZYZM Message-ID: Subject: Re: svn commit: r334543 - head/usr.bin/top To: Eitan Adler Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:24:29 -0000 On Sat, Jun 2, 2018 at 11:08 PM, Eitan Adler wrote: > On 2 June 2018 at 16:56, Rodney W. Grimes > wrote: > >> Author: eadler > >> Date: Sat Jun 2 22:06:27 2018 > >> New Revision: 334543 > >> URL: https://svnweb.freebsd.org/changeset/base/334543 > >> > >> Log: > >> top(1): chdir to / as init; remove unneeded comment > >> > >> - chdir to / to allow unmounting of wd > >> - remove warning about running top(1) as setuid. If this is a concern > we > >> should just drop privs instead. > >> > >> Modified: > >> head/usr.bin/top/machine.c > >> head/usr.bin/top/top.c > >> > >> Modified: head/usr.bin/top/machine.c > >> ============================================================ > ================== > >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 > (r334542) > >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 > (r334543) > >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) > >> /* > >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 if > >> * the process does not exist. > >> - * It is EXTREMELY IMPORTANT that this function work > correctly. > >> - * If top runs setuid root (as in SVR4), then this function > >> - * is the only thing that stands in the way of a serious > >> - * security problem. It validates requests for the "kill" > >> - * and "renice" commands. > >> */ > >> > >> int > >> > >> Modified: head/usr.bin/top/top.c > >> ============================================================ > ================== > >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) > >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) > >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) > >> #define CMD_order 26 > >> #define CMD_pid 27 > >> > >> + /* > >> + * Since top(1) is often long running and > >> + * doesn't typically care about where its running from > >> + * chdir to the root to allow unmounting of its > >> + * originall wd. Failure is alright as this is > >> + * just a courtesy for users. > >> + */ > >> + chdir("/"); > >> + > > > > Bad side effect of doing that is it is not hard to get a "core" > > from top when run as a user, as it is going to try to write > > to /, and it probably does not have permission for that. > > Another person made the point that other similar applications don't do > this, so I just reverted it. > Actually, it was a good change. I've had issues on other systems where I couldn't unmount a filesystem for reasons unknown. Not being able to take a core dump for top is a secondary concern: that can easily be worked around by rebuilding top. And chdiring to a different location defeats the point of chdir to "/". While we do have forced unmounts, I'm hesitant to use them unless I know for sure why I need to force it. Warner From owner-svn-src-head@freebsd.org Sun Jun 3 21:27:26 2018 Return-Path: Delivered-To: svn-src-head@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 8EB63FDE375; Sun, 3 Jun 2018 21:27:26 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9F817DE3B; Sun, 3 Jun 2018 21:27:25 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fPaWz-0002uT-Rs; Sun, 03 Jun 2018 23:27:18 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Eitan Adler" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Florian Smeets" Subject: Re: svn commit: r334474 - head/usr.bin/top References: <201806010551.w515pfoB090926@repo.freebsd.org> Date: Sun, 03 Jun 2018 23:27:20 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.5 X-Spam-Status: No, score=0.5 required=5.0 tests=ALL_TRUSTED, BAYES_60 autolearn=disabled version=3.4.0 X-Scan-Signature: 1fac81774939798d1cdb19633eb460de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:27:26 -0000 On Sun, 03 Jun 2018 19:19:47 +0200, Florian Smeets via svn-src-all wrote: > On 01.06.18 07:51, Eitan Adler wrote: >> Author: eadler >> Date: Fri Jun 1 05:51:40 2018 >> New Revision: 334474 >> URL: https://svnweb.freebsd.org/changeset/base/334474 >> >> Log: >> top(1): Display of TID when using 'H' flag >> >> Some users prefer seeing the TID when viewing individual threads. This >> makes sense as the PID will be the same for multiple entries. An >> attempt >> was made to include both, but there is insufficient room. As such, >> using >> the TID. >> >> While here, rename the header variables to be more understandable. >> >> Discussed with: mmacy >> Reported on: 2009-10-07 >> > > Hi, > > I think this is a mistake. The 'H' flag should keep the PID, AFAIK you > cannot use the TID anywhere in top in contrast to the PID. I usually > start top with the 'S' and 'H' flags. Now I cannot use 'k' to kill a > process in that view, as I don't see the PID. IMHO showing TIDs should > be a separate flag, 'h' maybe, as this commit changes current/expected > behavior (POLA?). > > Also, this is not documented in the man page. > > Florian > +1 for Florian I also like the PIDs to see which threads belong to the same process. Ronald. From owner-svn-src-head@freebsd.org Sun Jun 3 21:34:04 2018 Return-Path: Delivered-To: svn-src-head@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 4A3FAFDF225; Sun, 3 Jun 2018 21:34:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 522CC7E5D9; Sun, 3 Jun 2018 21:34:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w53LXvGJ092880; Sun, 3 Jun 2018 14:33:57 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w53LXvVY092879; Sun, 3 Jun 2018 14:33:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334543 - head/usr.bin/top In-Reply-To: To: Warner Losh Date: Sun, 3 Jun 2018 14:33:57 -0700 (PDT) CC: Eitan Adler , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:34:04 -0000 > On Sat, Jun 2, 2018 at 11:08 PM, Eitan Adler wrote: > > > On 2 June 2018 at 16:56, Rodney W. Grimes > > wrote: > > >> Author: eadler > > >> Date: Sat Jun 2 22:06:27 2018 > > >> New Revision: 334543 > > >> URL: https://svnweb.freebsd.org/changeset/base/334543 > > >> > > >> Log: > > >> top(1): chdir to / as init; remove unneeded comment > > >> > > >> - chdir to / to allow unmounting of wd > > >> - remove warning about running top(1) as setuid. If this is a concern > > we > > >> should just drop privs instead. > > >> > > >> Modified: > > >> head/usr.bin/top/machine.c > > >> head/usr.bin/top/top.c > > >> > > >> Modified: head/usr.bin/top/machine.c > > >> ============================================================ > > ================== > > >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 > > (r334542) > > >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 > > (r334543) > > >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) > > >> /* > > >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 if > > >> * the process does not exist. > > >> - * It is EXTREMELY IMPORTANT that this function work > > correctly. > > >> - * If top runs setuid root (as in SVR4), then this function > > >> - * is the only thing that stands in the way of a serious > > >> - * security problem. It validates requests for the "kill" > > >> - * and "renice" commands. > > >> */ > > >> > > >> int > > >> > > >> Modified: head/usr.bin/top/top.c > > >> ============================================================ > > ================== > > >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) > > >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) > > >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) > > >> #define CMD_order 26 > > >> #define CMD_pid 27 > > >> > > >> + /* > > >> + * Since top(1) is often long running and > > >> + * doesn't typically care about where its running from > > >> + * chdir to the root to allow unmounting of its > > >> + * originall wd. Failure is alright as this is > > >> + * just a courtesy for users. > > >> + */ > > >> + chdir("/"); > > >> + > > > > > > Bad side effect of doing that is it is not hard to get a "core" > > > from top when run as a user, as it is going to try to write > > > to /, and it probably does not have permission for that. > > > > Another person made the point that other similar applications don't do > > this, so I just reverted it. > > > > Actually, it was a good change. > > I've had issues on other systems where I couldn't unmount a filesystem for > reasons unknown. lsof is your friend here. That is the tool of choice for finding cwd of processes that are in directories you can not unmount. > Not being able to take a core dump for top is a secondary concern: that can > easily be worked around by rebuilding top. And chdiring to a different > location defeats the point of chdir to "/". Rebuilding top is *not* an "easy" solution, that assumes srcs are installed, and the problem can easily be retriggered. One could argue we should do this to lots of binaries based on the long running nature, like tail (-f). You would also have to know that top didnt core for you cause it could not write to /, and that is not going to be a well known fact. True long running things like daemons often do cd to well known places. > While we do have forced unmounts, I'm hesitant to use them unless I know > for sure why I need to force it. That is an administrative issue easily solved with lsof. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Jun 3 21:34:31 2018 Return-Path: Delivered-To: svn-src-head@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 E0D2DFDF2D9; Sun, 3 Jun 2018 21:34:30 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9611C7E742; Sun, 3 Jun 2018 21:34:30 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73100242AB; Sun, 3 Jun 2018 21:34:30 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53LYUMQ040037; Sun, 3 Jun 2018 21:34:30 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53LYTGf040033; Sun, 3 Jun 2018 21:34:29 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806032134.w53LYTGf040033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 21:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334589 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:34:31 -0000 Author: pstef Date: Sun Jun 3 21:34:29 2018 New Revision: 334589 URL: https://svnweb.freebsd.org/changeset/base/334589 Log: indent(1): revert introduction of -lpl That was committed with the wrong message. Will be re-added. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 20:59:59 2018 (r334588) +++ head/usr.bin/indent/args.c Sun Jun 3 21:34:29 2018 (r334589) @@ -125,7 +125,6 @@ struct pro { {"i", PRO_INT, 8, 0, &ps.ind_size}, {"lc", PRO_INT, 0, 0, &block_comment_max_col}, {"ldi", PRO_INT, -1, 0, &ps.local_decl_indent}, - {"lpl", PRO_BOOL, false, ON, &lineup_to_parens_always}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens}, {"l", PRO_INT, 78, 0, &max_col}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation}, @@ -144,7 +143,6 @@ struct pro { {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments}, {"nfcb", PRO_BOOL, true, OFF, &format_block_comments}, {"nip", PRO_BOOL, true, OFF, &ps.indent_parameters}, - {"nlpl", PRO_BOOL, false, OFF, &lineup_to_parens_always}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Jun 3 20:59:59 2018 (r334588) +++ head/usr.bin/indent/indent.1 Sun Jun 3 21:34:29 2018 (r334589) @@ -73,7 +73,6 @@ .Op Fl \&lc Ns Ar n .Op Fl \&ldi Ns Ar n .Op Fl \&lp | Fl nlp -.Op Fl \&lpl | Fl nlpl .Op Fl npro .Op Fl P Ns Ar file .Op Fl pcs | Fl npcs @@ -356,9 +355,7 @@ The default is for local variable names to be indented by the same amount as global ones. .It Fl \&lp , nlp Lines up code surrounded by parentheses in continuation lines. -With -.Fl \&lp , -if a line +If a line has a left paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left paren. @@ -385,19 +382,6 @@ p1\ =\ first_procedure(second_procedure(p2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ third_procedure(p4, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p5)); .Ed -.It Fl \&lpl , nlpl -With -.Fl \&lpl , -code surrounded by parentheses in continuation lines is lined up even if it -would extend past the right margin. -With -.Fl \&nlpl -(the default), such a line that would extend past the right margin is moved -left to keep it within the margin, if that does not require placing it to -the left of the prevailing indentation level. -These switches have no effect if -.Fl nlp -is selected. .It Fl npro Causes the profile files, .Sq Pa ./.indent.pro Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 20:59:59 2018 (r334588) +++ head/usr.bin/indent/indent.c Sun Jun 3 21:34:29 2018 (r334589) @@ -174,7 +174,6 @@ main(int argc, char **argv) #ifdef undef max_col = 78; /* -l78 */ lineup_to_parens = 1; /* -lp */ - lineup_to_parens_always = 0; /* -nlpl */ ps.ljust_decl = 0; /* -ndj */ ps.com_ind = 33; /* -c33 */ star_comment_cont = 1; /* -sc */ Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 20:59:59 2018 (r334588) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 21:34:29 2018 (r334589) @@ -186,8 +186,6 @@ int continuation_indent;/* set to the indentat * code and continuation lines */ int lineup_to_parens; /* if true, continued code within parens will * be lined up to the open paren */ -int lineup_to_parens_always; /* if true, do not attempt to keep - * lined-up code within the margin */ int Bill_Shannon; /* true iff a blank should always be inserted * after sizeof */ int blanklines_after_declarations_at_proctop; /* This is vaguely Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 20:59:59 2018 (r334588) +++ head/usr.bin/indent/io.c Sun Jun 3 21:34:29 2018 (r334589) @@ -226,8 +226,6 @@ compute_code_target(void) if (!lineup_to_parens) target_col += continuation_indent * (2 * continuation_indent == ps.ind_size ? 1 : ps.paren_level); - else if (lineup_to_parens_always) - target_col = paren_target; else { int w; int t = paren_target; From owner-svn-src-head@freebsd.org Sun Jun 3 21:40:40 2018 Return-Path: Delivered-To: svn-src-head@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 42BEDFE0016; Sun, 3 Jun 2018 21:40:40 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D63557EBA0; Sun, 3 Jun 2018 21:40:39 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87CF242B7; Sun, 3 Jun 2018 21:40:39 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53LedUV040337; Sun, 3 Jun 2018 21:40:39 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53LecMa040332; Sun, 3 Jun 2018 21:40:38 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806032140.w53LecMa040332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 3 Jun 2018 21:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334590 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:40:40 -0000 Author: pstef Date: Sun Jun 3 21:40:38 2018 New Revision: 334590 URL: https://svnweb.freebsd.org/changeset/base/334590 Log: indent(1): new option -lpl With -lpl, code surrounded by parentheses in continuation lines is lined up even if it would extend past the right margin. With -nlpl (the default), such a line that would extend past the right margin is moved left to keep it within the margin, if that does not require placing it to the left of the prevailing indentation level. These switches have no effect if -nlp is selected. Submitted by: Tom Lane Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/io.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Sun Jun 3 21:34:29 2018 (r334589) +++ head/usr.bin/indent/args.c Sun Jun 3 21:40:38 2018 (r334590) @@ -125,6 +125,7 @@ struct pro { {"i", PRO_INT, 8, 0, &ps.ind_size}, {"lc", PRO_INT, 0, 0, &block_comment_max_col}, {"ldi", PRO_INT, -1, 0, &ps.local_decl_indent}, + {"lpl", PRO_BOOL, false, ON, &lineup_to_parens_always}, {"lp", PRO_BOOL, true, ON, &lineup_to_parens}, {"l", PRO_INT, 78, 0, &max_col}, {"nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation}, @@ -143,6 +144,7 @@ struct pro { {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments}, {"nfcb", PRO_BOOL, true, OFF, &format_block_comments}, {"nip", PRO_BOOL, true, OFF, &ps.indent_parameters}, + {"nlpl", PRO_BOOL, false, OFF, &lineup_to_parens_always}, {"nlp", PRO_BOOL, true, OFF, &lineup_to_parens}, {"npcs", PRO_BOOL, false, OFF, &proc_calls_space}, {"npro", PRO_SPECIAL, 0, IGN, 0}, Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Jun 3 21:34:29 2018 (r334589) +++ head/usr.bin/indent/indent.1 Sun Jun 3 21:40:38 2018 (r334590) @@ -73,6 +73,7 @@ .Op Fl \&lc Ns Ar n .Op Fl \&ldi Ns Ar n .Op Fl \&lp | Fl nlp +.Op Fl \&lpl | Fl nlpl .Op Fl npro .Op Fl P Ns Ar file .Op Fl pcs | Fl npcs @@ -355,7 +356,9 @@ The default is for local variable names to be indented by the same amount as global ones. .It Fl \&lp , nlp Lines up code surrounded by parentheses in continuation lines. -If a line +With +.Fl \&lp , +if a line has a left paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the left paren. @@ -382,6 +385,19 @@ p1\ =\ first_procedure(second_procedure(p2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ third_procedure(p4, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p5)); .Ed +.It Fl \&lpl , nlpl +With +.Fl \&lpl , +code surrounded by parentheses in continuation lines is lined up even if it +would extend past the right margin. +With +.Fl \&nlpl +(the default), such a line that would extend past the right margin is moved +left to keep it within the margin, if that does not require placing it to +the left of the prevailing indentation level. +These switches have no effect if +.Fl nlp +is selected. .It Fl npro Causes the profile files, .Sq Pa ./.indent.pro Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 21:34:29 2018 (r334589) +++ head/usr.bin/indent/indent.c Sun Jun 3 21:40:38 2018 (r334590) @@ -174,6 +174,7 @@ main(int argc, char **argv) #ifdef undef max_col = 78; /* -l78 */ lineup_to_parens = 1; /* -lp */ + lineup_to_parens_always = 0; /* -nlpl */ ps.ljust_decl = 0; /* -ndj */ ps.com_ind = 33; /* -c33 */ star_comment_cont = 1; /* -sc */ Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Sun Jun 3 21:34:29 2018 (r334589) +++ head/usr.bin/indent/indent_globs.h Sun Jun 3 21:40:38 2018 (r334590) @@ -186,6 +186,8 @@ int continuation_indent;/* set to the indentat * code and continuation lines */ int lineup_to_parens; /* if true, continued code within parens will * be lined up to the open paren */ +int lineup_to_parens_always; /* if true, do not attempt to keep + * lined-up code within the margin */ int Bill_Shannon; /* true iff a blank should always be inserted * after sizeof */ int blanklines_after_declarations_at_proctop; /* This is vaguely Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Sun Jun 3 21:34:29 2018 (r334589) +++ head/usr.bin/indent/io.c Sun Jun 3 21:40:38 2018 (r334590) @@ -226,6 +226,8 @@ compute_code_target(void) if (!lineup_to_parens) target_col += continuation_indent * (2 * continuation_indent == ps.ind_size ? 1 : ps.paren_level); + else if (lineup_to_parens_always) + target_col = paren_target; else { int w; int t = paren_target; From owner-svn-src-head@freebsd.org Sun Jun 3 21:58:57 2018 Return-Path: Delivered-To: svn-src-head@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 8DD7DFE22F2; Sun, 3 Jun 2018 21:58:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84BB7F8AC; Sun, 3 Jun 2018 21:58:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [10.10.154.196] (unknown [185.93.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 92FC843D00; Sun, 3 Jun 2018 23:58:48 +0200 (CEST) From: Dimitry Andric Message-Id: <2231964C-8130-416D-963D-77F93DF2F08A@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_01C10913-2CF3-4271-ABB9-B9BA8952D58B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334586 - head/sys/fs/nfsserver Date: Sun, 3 Jun 2018 23:58:43 +0200 In-Reply-To: <201806031946.w53JkiHm084473@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Rick Macklem References: <201806031946.w53JkiHm084473@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 21:58:57 -0000 --Apple-Mail=_01C10913-2CF3-4271-ABB9-B9BA8952D58B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 3 Jun 2018, at 21:46, Rick Macklem wrote: >=20 > Author: rmacklem > Date: Sun Jun 3 19:46:44 2018 > New Revision: 334586 > URL: https://svnweb.freebsd.org/changeset/base/334586 >=20 > Log: > Fix a gcc8 warning about a write only variable. >=20 > gcc8 warns that "verf" was set but not used. This was because the = code > that uses it is disabled via a "#if 0". > This patch adds a "#if 0" to the variable's declaration and = assignment > to get rid of the warning. > This way the code could be re-enabled without difficulty. >=20 > Requested by: mmacy > MFC after: 2 weeks >=20 > Modified: > head/sys/fs/nfsserver/nfs_nfsdport.c >=20 > Modified: head/sys/fs/nfsserver/nfs_nfsdport.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:37:17 2018 = (r334585) > +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:46:44 2018 = (r334586) > @@ -1574,7 +1574,10 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int = isdgram, > struct nfsvattr at; > int nlen, error =3D 0, getret =3D 1; > int siz, cnt, fullsiz, eofflag, ncookies; > - u_int64_t off, toff, verf; > + u_int64_t off, toff; > +#if 0 > + u_int64_t verf; > +#endif > u_long *cookies =3D NULL, *cookiep; > struct uio io; > struct iovec iv; > @@ -1591,7 +1594,9 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int = isdgram, > NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); > off =3D fxdr_hyper(tl); > tl +=3D 2; > +#if 0 > verf =3D fxdr_hyper(tl); > +#endif This functionally changes the code, though. Is fxdr_hyper() no longer supposed to be called? -Dimitry --Apple-Mail=_01C10913-2CF3-4271-ABB9-B9BA8952D58B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWxRkkwAKCRCwXqMKLiCW o0XdAJ0fRKuGePH3FJo0SXM8teDcYIJfJgCg2DvcL3Pj3626zidWL9LHHNloH3E= =rw8x -----END PGP SIGNATURE----- --Apple-Mail=_01C10913-2CF3-4271-ABB9-B9BA8952D58B-- From owner-svn-src-head@freebsd.org Sun Jun 3 22:15:49 2018 Return-Path: Delivered-To: svn-src-head@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 56FBFFE45D2; Sun, 3 Jun 2018 22:15:49 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670056.outbound.protection.outlook.com [40.107.67.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D33CD80654; Sun, 3 Jun 2018 22:15:48 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM (52.132.44.24) by YTOPR0101MB1865.CANPRD01.PROD.OUTLOOK.COM (52.132.48.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.13; Sun, 3 Jun 2018 22:15:47 +0000 Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::a860:9237:2e9f:f87f]) by YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::a860:9237:2e9f:f87f%3]) with mapi id 15.20.0820.015; Sun, 3 Jun 2018 22:15:47 +0000 From: Rick Macklem To: Dimitry Andric , Rick Macklem CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r334586 - head/sys/fs/nfsserver Thread-Topic: svn commit: r334586 - head/sys/fs/nfsserver Thread-Index: AQHT+4YVJyrXGoCjUUiu9sjs/OUO7KRPF+u9 Date: Sun, 3 Jun 2018 22:15:47 +0000 Message-ID: References: <201806031946.w53JkiHm084473@repo.freebsd.org>, <2231964C-8130-416D-963D-77F93DF2F08A@FreeBSD.org> In-Reply-To: <2231964C-8130-416D-963D-77F93DF2F08A@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1865; 7:32u/OZ4oCvUc536GBtN7RPABSLfwH3YYbCMLZVjvc2mBO8C2TlnRuGUAGcyoCxtbyHFGcKecyE6XafofEFHnjW6fLXtBNZ9b9+/AfXFFZPB14/Hx8B+3KpgKI5UGu4/BA4oPKlfeMFZfpDmbip9h0ttEfNPWIs2EoEuu32OL7002jKJHvnWKlpvDVAZRZbvjFxflGkqrzppsIft1Um+EFTPcC7JiOJGZLOfkd8tc3zhm2PC11f/WQgkL/iqIGXim x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1865; x-ms-traffictypediagnostic: YTOPR0101MB1865: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB1865; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1865; x-forefront-prvs: 069255B8B8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(39380400002)(39860400002)(396003)(199004)(189003)(105586002)(74316002)(305945005)(186003)(59450400001)(7696005)(486006)(99286004)(76176011)(446003)(11346002)(476003)(68736007)(2906002)(316002)(33656002)(3660700001)(3280700002)(97736004)(5250100002)(54906003)(786003)(26005)(966005)(86362001)(25786009)(6246003)(229853002)(2900100001)(110136005)(5660300001)(478600001)(102836004)(8676002)(8936002)(6436002)(81166006)(9686003)(81156014)(6306002)(106356001)(6506007)(74482002)(450100002)(55016002)(53936002)(4326008)(14454004)(3714002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1865; H:YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: JPtCxuR/UNaFLp/abvt01FFk6Qyw42JNTqk/c3ZaFU4nLK0H8opeITMyWx7M9lnP28W2BoUnU1FS3F0DG0O4B5pvYwpMduIoLXSUmUooN8ryCZ0uq5gBJiSgaBo4QG4aX7pTh3UfxsnJVvhHYm6Ob+qwD5dvIaP/30ilIFOSvp5EMIlgmT7M0tpL8hQXKBQf spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f29943f8-57db-4320-d9f2-08d5c99f8ee5 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: f29943f8-57db-4320-d9f2-08d5c99f8ee5 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2018 22:15:47.6891 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1865 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 22:15:49 -0000 Dimitry Andric wrote: >On 3 Jun 2018, at 21:46, Rick Macklem wrote: >> >> Author: rmacklem >> Date: Sun Jun 3 19:46:44 2018 >> New Revision: 334586 >> URL: https://svnweb.freebsd.org/changeset/base/334586 >> >> Log: >> Fix a gcc8 warning about a write only variable. >> >> gcc8 warns that "verf" was set but not used. This was because the code >> that uses it is disabled via a "#if 0". >> This patch adds a "#if 0" to the variable's declaration and assignment >> to get rid of the warning. >> This way the code could be re-enabled without difficulty. >> >> Requested by: mmacy >> MFC after: 2 weeks >> >> Modified: >> head/sys/fs/nfsserver/nfs_nfsdport.c >> >> Modified: head/sys/fs/nfsserver/nfs_nfsdport.c >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=3D=3D=3D= =3D=3D=3D=3D=3D=3D >> --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:37:17 2018 = (r334585) >> +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 3 19:46:44 2018 = >(r334586) >> @@ -1574,7 +1574,10 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isd= gram, >> struct nfsvattr at; >> int nlen, error =3D 0, getret =3D 1; >> int siz, cnt, fullsiz, eofflag, ncookies; >> - u_int64_t off, toff, verf; >> + u_int64_t off, toff; >> +#if 0 >> + u_int64_t verf; >> +#endif >> u_long *cookies =3D NULL, *cookiep; >> struct uio io; >> struct iovec iv; >> @@ -1591,7 +1594,9 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdg= ram, >> NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); >> off =3D fxdr_hyper(tl); >> tl +=3D 2; >> +#if 0 >> verf =3D fxdr_hyper(tl); >> +#endif > >This functionally changes the code, though. Is fxdr_hyper() no longer >supposed to be called? It's not a problem. fxdr_hyper() is a "pure function with no side effects" = and just returns the translated value. It translates a 64bit number from XDR fo= rmat (big endian) to native architecture format. (The argument is a ptr to where= the value is in XDR. (Stands for eXternal Data Representation. A Sun thing from= the mid 1980s.) rick From owner-svn-src-head@freebsd.org Sun Jun 3 22:42:56 2018 Return-Path: Delivered-To: svn-src-head@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 0DB95FE775F; Sun, 3 Jun 2018 22:42:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AED95819C7; Sun, 3 Jun 2018 22:42:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7875224DD4; Sun, 3 Jun 2018 22:42:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53MgtSf074711; Sun, 3 Jun 2018 22:42:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Mgs5c074706; Sun, 3 Jun 2018 22:42:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806032242.w53Mgs5c074706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 22:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334591 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 22:42:56 -0000 Author: eadler Date: Sun Jun 3 22:42:54 2018 New Revision: 334591 URL: https://svnweb.freebsd.org/changeset/base/334591 Log: top(1): top warnings and cleanup - Add const where helpful - add missing 'static' for file-local functions - use nitems where possible - convert manual abort() to assert - use strndup instead of homegrown version Tested with clang, gcc7, and gcc9 Modified: head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/display.c Sun Jun 3 22:42:54 2018 (r334591) @@ -66,12 +66,12 @@ static int display_width = MAX_COLS; /* buffer of proc information lines for display updating */ static char *screenbuf = NULL; -static char **procstate_names; -static char **cpustate_names; -static char **memory_names; -static char **arc_names; -static char **carc_names; -static char **swap_names; +static const char * const *procstate_names; +static const char * const *cpustate_names; +static const char * const *memory_names; +static const char * const *arc_names; +static const char * const *carc_names; +static const char * const *swap_names; static int num_procstates; static int num_cpustates; @@ -735,8 +735,8 @@ static int header_length; * allocated area with the trimmed header. */ -char * -trim_header(char *text) +const char * +trim_header(const char *text) { char *s; int width; @@ -745,11 +745,9 @@ trim_header(char *text) width = display_width; header_length = strlen(text); if (header_length >= width) { - s = calloc((width + 1), sizeof(char)); + s = strndup(text, width); if (s == NULL) return (NULL); - strncpy(s, text, width); - s[width] = '\0'; } return (s); } @@ -761,9 +759,9 @@ trim_header(char *text) */ void -i_header(char *text) +i_header(const char *text) { - char *s; + const char *s; s = trim_header(text); if (s != NULL) @@ -783,7 +781,7 @@ i_header(char *text) } void -u_header(char *text __unused) +u_header(const char *text __unused) { if (header_status == ERASE) Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/display.h Sun Jun 3 22:42:54 2018 (r334591) @@ -9,7 +9,7 @@ int display_updatecpus(struct statics *statics); void clear_message(void); int display_resize(void); -void i_header(char *text); +void i_header(const char *text); char *printable(char *string); void display_header(int t); int display_init(struct statics *statics); @@ -26,12 +26,12 @@ void i_timeofday(time_t *tod); void i_uptime(struct timeval *bt, time_t *tod); void new_message(int type, const char *msgfmt, ...); int readline(char *buffer, int size, int numeric); -char *trim_header(char *text); +const char *trim_header(const char *text); void u_arc(int *stats); void u_carc(int *stats); void u_cpustates(int *states); void u_endscreen(int hi); -void u_header(char *text); +void u_header(const char *text); void u_loadave(int mpid, double *avenrun); void u_memory(int *stats); void u_message(void); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/machine.c Sun Jun 3 22:42:54 2018 (r334591) @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -92,27 +93,27 @@ struct handle { * These definitions control the format of the per-process area */ -static char io_header[] = +static const char io_header[] = " PID%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; -#define io_Proc_format \ - "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s" +static const char io_Proc_format[] = + "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; -static char smp_header_thr_and_pid[] = +static const char smp_header_thr_and_pid[] = " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; -static char smp_header_tid_only[] = +static const char smp_header_tid_only[] = " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; -#define smp_Proc_format \ - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s" +static const char smp_Proc_format[] = + "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; static char up_header_thr_and_pid[] = " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_header_tid_only[] = " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; -#define up_Proc_format \ - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s" +static char up_Proc_format[] = + "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; /* process state names for the "STATE" column of the display */ @@ -147,7 +148,7 @@ static long cp_diff[CPUSTATES]; /* these are for detailing the process states */ static int process_states[8]; -static char *procstatenames[] = { +static const char *procstatenames[] = { "", " starting, ", " running, ", " sleeping, ", " stopped, ", " zombie, ", " waiting, ", " lock, ", NULL @@ -156,32 +157,32 @@ static char *procstatenames[] = { /* these are for detailing the cpu states */ static int cpu_states[CPUSTATES]; -static char *cpustatenames[] = { +static const char *cpustatenames[] = { "user", "nice", "system", "interrupt", "idle", NULL }; /* these are for detailing the memory statistics */ static int memory_stats[7]; -static char *memorynames[] = { +static const char *memorynames[] = { "K Active, ", "K Inact, ", "K Laundry, ", "K Wired, ", "K Buf, ", "K Free", NULL }; static int arc_stats[7]; -static char *arcnames[] = { +static const char *arcnames[] = { "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", NULL }; static int carc_stats[4]; -static char *carcnames[] = { +static const char *carcnames[] = { "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", NULL }; static int swap_stats[7]; -static char *swapnames[] = { +static const char *swapnames[] = { "K Total, ", "K Used, ", "K Free, ", "% Inuse, ", "K In, ", "K Out", NULL }; @@ -412,8 +413,8 @@ machine_init(struct statics *statics) return (0); } -char * -format_header(char *uname_field) +const char * +format_header(const char *uname_field) { static char Header[128]; const char *prehead; @@ -660,7 +661,7 @@ get_old_proc(struct kinfo_proc *pp) * store the values individually in the pointers passed in. */ static long -get_io_stats(struct kinfo_proc *pp, long *inp, long *oup, long *flp, +get_io_stats(const struct kinfo_proc *pp, long *inp, long *oup, long *flp, long *vcsw, long *ivcsw) { const struct kinfo_proc *oldp; @@ -734,7 +735,7 @@ proc_used_cpu(struct kinfo_proc *pp) * Return the total number of block in/out and faults by a process. */ static long -get_io_total(struct kinfo_proc *pp) +get_io_total(const struct kinfo_proc *pp) { long dummy; @@ -935,7 +936,7 @@ format_next_process(caddr_t xhandle, char *(*get_useri char thr_buf[6]; char jid_buf[TOP_JID_LEN + 1], swap_buf[TOP_SWAP_LEN + 1]; char *cmdbuf = NULL; - char **args; + const char * const *args; const int cmdlen = 128; /* find and remember the next proc structure */ @@ -988,10 +989,11 @@ format_next_process(caddr_t xhandle, char *(*get_useri break; default: - if (state < sizeof(state_abbrev) / sizeof(*state_abbrev)) + if (state < nitems(state_abbrev)) { sprintf(status, "%.6s", state_abbrev[state]); - else + } else { sprintf(status, "?%5zu", state); + } break; } @@ -1254,8 +1256,7 @@ compare_pid(const void *p1, const void *p2) const struct kinfo_proc * const *pp1 = p1; const struct kinfo_proc * const *pp2 = p2; - if ((*pp2)->ki_pid < 0 || (*pp1)->ki_pid < 0) - abort(); + assert((*pp2)->ki_pid >= 0 && (*pp1)->ki_pid >= 0); return ((*pp1)->ki_pid - (*pp2)->ki_pid); } @@ -1266,8 +1267,7 @@ compare_tid(const void *p1, const void *p2) const struct kinfo_proc * const *pp1 = p1; const struct kinfo_proc * const *pp2 = p2; - if ((*pp2)->ki_tid < 0 || (*pp1)->ki_tid < 0) - abort(); + assert((*pp2)->ki_tid >= 0 && (*pp1)->ki_tid >= 0); return ((*pp1)->ki_tid - (*pp2)->ki_tid); } @@ -1371,45 +1371,9 @@ compare_cpu(const void *arg1, const void *arg2) return (0); } -/* "cpu" compare routines */ -static int compare_size(const void *arg1, const void *arg2); -static int compare_res(const void *arg1, const void *arg2); -static int compare_time(const void *arg1, const void *arg2); -static int compare_prio(const void *arg1, const void *arg2); -static int compare_threads(const void *arg1, const void *arg2); - -/* - * "io" compare routines. Context switches aren't i/o, but are displayed - * on the "io" display. - */ -static int compare_iototal(const void *arg1, const void *arg2); -static int compare_ioread(const void *arg1, const void *arg2); -static int compare_iowrite(const void *arg1, const void *arg2); -static int compare_iofault(const void *arg1, const void *arg2); -static int compare_vcsw(const void *arg1, const void *arg2); -static int compare_ivcsw(const void *arg1, const void *arg2); - -int (*compares[])(const void *arg1, const void *arg2) = { - compare_cpu, - compare_size, - compare_res, - compare_time, - compare_prio, - compare_threads, - compare_iototal, - compare_ioread, - compare_iowrite, - compare_iofault, - compare_vcsw, - compare_ivcsw, - compare_jid, - compare_swap, - NULL -}; - /* compare_size - the comparison function for sorting by total memory usage */ -int +static int compare_size(const void *arg1, const void *arg2) { const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; @@ -1427,7 +1391,7 @@ compare_size(const void *arg1, const void *arg2) /* compare_res - the comparison function for sorting by resident set size */ -int +static int compare_res(const void *arg1, const void *arg2) { const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; @@ -1445,7 +1409,7 @@ compare_res(const void *arg1, const void *arg2) /* compare_time - the comparison function for sorting by total cpu time */ -int +static int compare_time(const void *arg1, const void *arg2) { const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; @@ -1463,7 +1427,7 @@ compare_time(const void *arg1, const void *arg2) /* compare_prio - the comparison function for sorting by priority */ -int +static int compare_prio(const void *arg1, const void *arg2) { const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; @@ -1519,8 +1483,8 @@ compare_jid(const void *arg1, const void *arg2) static int compare_swap(const void *arg1, const void *arg2) { - const struct kinfo_proc *p1 = *(const struct kinfo_proc **)arg1; - const struct kinfo_proc *p2 = *(const struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; ORDERKEY_SWAP(p1, p2); ORDERKEY_PCTCPU(p1, p2); @@ -1535,11 +1499,11 @@ compare_swap(const void *arg1, const void *arg2) /* assorted comparison functions for sorting by i/o */ -int +static int compare_iototal(const void *arg1, const void *arg2) { - struct kinfo_proc * const p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc * const p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc * const p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc * const p2 = *(const struct kinfo_proc * const *)arg2; return (get_io_total(p2) - get_io_total(p1)); } @@ -1547,8 +1511,8 @@ compare_iototal(const void *arg1, const void *arg2) static int compare_ioread(const void *arg1, const void *arg2) { - struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; long dummy, inp1, inp2; (void) get_io_stats(p1, &inp1, &dummy, &dummy, &dummy, &dummy); @@ -1560,8 +1524,8 @@ compare_ioread(const void *arg1, const void *arg2) static int compare_iowrite(const void *arg1, const void *arg2) { - struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; long dummy, oup1, oup2; (void) get_io_stats(p1, &dummy, &oup1, &dummy, &dummy, &dummy); @@ -1573,8 +1537,8 @@ compare_iowrite(const void *arg1, const void *arg2) static int compare_iofault(const void *arg1, const void *arg2) { - struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; long dummy, flp1, flp2; (void) get_io_stats(p1, &dummy, &dummy, &flp1, &dummy, &dummy); @@ -1586,8 +1550,8 @@ compare_iofault(const void *arg1, const void *arg2) static int compare_vcsw(const void *arg1, const void *arg2) { - struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; long dummy, flp1, flp2; (void) get_io_stats(p1, &dummy, &dummy, &dummy, &flp1, &dummy); @@ -1596,11 +1560,11 @@ compare_vcsw(const void *arg1, const void *arg2) return (flp2 - flp1); } -int +static int compare_ivcsw(const void *arg1, const void *arg2) { - struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; - struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; + const struct kinfo_proc *p1 = *(const struct kinfo_proc * const *)arg1; + const struct kinfo_proc *p2 = *(const struct kinfo_proc * const *)arg2; long dummy, flp1, flp2; (void) get_io_stats(p1, &dummy, &dummy, &dummy, &dummy, &flp1); @@ -1608,6 +1572,25 @@ compare_ivcsw(const void *arg1, const void *arg2) return (flp2 - flp1); } + +int (*compares[])(const void *arg1, const void *arg2) = { + compare_cpu, + compare_size, + compare_res, + compare_time, + compare_prio, + compare_threads, + compare_iototal, + compare_ioread, + compare_iowrite, + compare_iofault, + compare_vcsw, + compare_ivcsw, + compare_jid, + compare_swap, + NULL +}; + /* * proc_owner(pid) - returns the uid that owns process "pid", or -1 if Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/machine.h Sun Jun 3 22:42:54 2018 (r334591) @@ -17,13 +17,13 @@ */ struct statics { - char **procstate_names; - char **cpustate_names; - char **memory_names; - char **arc_names; - char **carc_names; - char **swap_names; - char **order_names; + const char * const *procstate_names; + const char * const *cpustate_names; + const char * const *memory_names; + const char * const *arc_names; + const char * const *carc_names; + const char * const *swap_names; + const char * const *order_names; int ncpus; }; @@ -75,7 +75,7 @@ struct process_select /* routines defined by the machine dependent module */ -char *format_header(char *uname_field); +const char *format_header(const char *uname_field); char *format_next_process(caddr_t handle, char *(*get_userid)(int), int flags); void toggle_pcpustats(void); Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/top.c Sun Jun 3 22:42:54 2018 (r334591) @@ -78,7 +78,7 @@ static void (*d_arc)(int *stats) = i_arc; static void (*d_carc)(int *stats) = i_carc; static void (*d_swap)(int *stats) = i_swap; static void (*d_message)(void) = i_message; -static void (*d_header)(char *text) = i_header; +static void (*d_header)(const char *text) = i_header; static void (*d_process)(int line, char *thisline) = i_process; static void reset_display(void); @@ -207,8 +207,8 @@ main(int argc, char *argv[]) int sel_ret = 0; time_t curr_time; char *(*get_userid)(int) = username; - char *uname_field = "USERNAME"; - char *header_text; + const char *uname_field = "USERNAME"; + const char *header_text; char *env_top; char **preset_argv; int preset_argc = 0; @@ -228,7 +228,7 @@ main(int argc, char *argv[]) fd_set readfds; char old_system = false; - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwop"; + static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwop"; /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 #define CMD_update 1 Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sun Jun 3 21:40:38 2018 (r334590) +++ head/usr.bin/top/utils.c Sun Jun 3 22:42:54 2018 (r334591) @@ -89,7 +89,7 @@ char *itoa(unsigned int val) } /* - * (val) - like itoa, except the number is right justified in a 7 + * itoa7(val) - like itoa, except the number is right justified in a 7 * character field. This code is a duplication of itoa instead of * a front end to a more general routine for efficiency. */ From owner-svn-src-head@freebsd.org Sun Jun 3 23:36:30 2018 Return-Path: Delivered-To: svn-src-head@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 87080FED799; Sun, 3 Jun 2018 23:36:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BD6883D19; Sun, 3 Jun 2018 23:36:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18951255DE; Sun, 3 Jun 2018 23:36:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53NaT4T099685; Sun, 3 Jun 2018 23:36:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53NaT89099684; Sun, 3 Jun 2018 23:36:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806032336.w53NaT89099684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 3 Jun 2018 23:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334592 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 334592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 23:36:30 -0000 Author: asomers Date: Sun Jun 3 23:36:29 2018 New Revision: 334592 URL: https://svnweb.freebsd.org/changeset/base/334592 Log: audit(4): add tests for the cl audit class The only syscalls in this class are close, closefrom, munmap, and revoke. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15650 Added: head/tests/sys/audit/file-close.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Sun Jun 3 22:42:54 2018 (r334591) +++ head/tests/sys/audit/Makefile Sun Jun 3 23:36:29 2018 (r334592) @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/audit ATF_TESTS_C= file-create ATF_TESTS_C+= file-delete +ATF_TESTS_C+= file-close ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read @@ -11,6 +12,8 @@ SRCS.file-create+= file-create.c SRCS.file-create+= utils.c SRCS.file-delete+= file-delete.c SRCS.file-delete+= utils.c +SRCS.file-close+= file-close.c +SRCS.file-close+= utils.c SRCS.file-write+= file-write.c SRCS.file-write+= utils.c SRCS.file-read+= file-read.c @@ -22,6 +25,6 @@ TEST_METADATA+= is_exclusive="true" WARNS?= 6 -LDFLAGS+= -lbsm +LDFLAGS+= -lbsm -lutil .include Added: head/tests/sys/audit/file-close.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/file-close.c Sun Jun 3 23:36:29 2018 (r334592) @@ -0,0 +1,236 @@ +/*- + * Copyright 2018 Aniket Pandey + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "utils.h" + +static pid_t pid; +static struct pollfd fds[1]; +static mode_t mode = 0777; +static char extregex[80]; +static struct stat statbuff; +static const char *auclass = "cl"; +static const char *path = "fileforaudit"; +static const char *errpath = "dirdoesnotexist/fileforaudit"; +static const char *failurereg = "fileforaudit.*return,failure"; + + +ATF_TC_WITH_CLEANUP(munmap_success); +ATF_TC_HEAD(munmap_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "munmap(2) call"); +} + +ATF_TC_BODY(munmap_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "munmap.*%d.*return,success", pid); + + /* Allocate sample memory, to be removed by munmap(2) */ + char *addr = mmap(NULL, sizeof(char), PROT_READ , MAP_ANONYMOUS, -1, 0); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, munmap(addr, sizeof(char))); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(munmap_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(munmap_failure); +ATF_TC_HEAD(munmap_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "munmap(2) call"); +} + +ATF_TC_BODY(munmap_failure, tc) +{ + const char *regex = "munmap.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, munmap((void *)SIZE_MAX, -1)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(munmap_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(close_success); +ATF_TC_HEAD(close_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "close(2) call"); +} + +ATF_TC_BODY(close_success, tc) +{ + int filedesc; + /* File needs to exist to call close(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDWR, mode)) != -1); + /* Call stat(2) to store the Inode number of 'path' */ + ATF_REQUIRE_EQ(0, stat(path, &statbuff)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, close(filedesc)); + + /* intmax_t to support all architectures */ + snprintf(extregex, sizeof(extregex), "close.*%jd.*return,succes", + (intmax_t)statbuff.st_ino); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(close_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(close_failure); +ATF_TC_HEAD(close_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "close(2) call"); +} + +ATF_TC_BODY(close_failure, tc) +{ + const char *regex = "close.*return,failure"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, close(-1)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(close_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(closefrom_success); +ATF_TC_HEAD(closefrom_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "closefrom(2) call"); +} + +ATF_TC_BODY(closefrom_success, tc) +{ + const char *regex = "closefrom.*return,success"; + FILE *pipefd = setup(fds, auclass); + /* closefrom(2) returns 'void' */ + closefrom(INT_MAX); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(closefrom_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(revoke_success); +ATF_TC_HEAD(revoke_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "revoke(2) call"); +} + +ATF_TC_BODY(revoke_success, tc) +{ + int filedesc; + char *ptyname; + pid = getpid(); + snprintf(extregex, sizeof(extregex), "revoke.*%d.*return,success", pid); + + /* Obtain a pseudo terminal and get the path to slave device */ + ATF_REQUIRE((filedesc = posix_openpt(O_RDWR | O_NOCTTY)) != -1); + ATF_REQUIRE((ptyname = ptsname(filedesc)) != NULL); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, revoke(ptyname)); + check_audit(fds, extregex, pipefd); + + /* Close the file descriptor to pseudo terminal */ + ATF_REQUIRE_EQ(0, close(filedesc)); +} + +ATF_TC_CLEANUP(revoke_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(revoke_failure); +ATF_TC_HEAD(revoke_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "revoke(2) call"); +} + +ATF_TC_BODY(revoke_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, revoke(errpath)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(revoke_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, munmap_success); + ATF_TP_ADD_TC(tp, munmap_failure); + + ATF_TP_ADD_TC(tp, close_success); + ATF_TP_ADD_TC(tp, close_failure); + ATF_TP_ADD_TC(tp, closefrom_success); + + ATF_TP_ADD_TC(tp, revoke_success); + ATF_TP_ADD_TC(tp, revoke_failure); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Sun Jun 3 23:40:56 2018 Return-Path: Delivered-To: svn-src-head@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 44838FEDEB2; Sun, 3 Jun 2018 23:40:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E68E083FD0; Sun, 3 Jun 2018 23:40:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8A7E25606; Sun, 3 Jun 2018 23:40:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53NetrT099894; Sun, 3 Jun 2018 23:40:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Nesm4099887; Sun, 3 Jun 2018 23:40:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806032340.w53Nesm4099887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 3 Jun 2018 23:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334593 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 23:40:56 -0000 Author: eadler Date: Sun Jun 3 23:40:54 2018 New Revision: 334593 URL: https://svnweb.freebsd.org/changeset/base/334593 Log: top(1): another pass of cleanup - avoid the need to call a function to get size of known array. I'll likely re-arrange some of the indirect in a later to avoid the magic constants. - use correct type - add const - replace caddr_t with void*. This corrects an alignment warning. - remove duplicated include from immediately prior commit Under base clang we're now down to: - 3 warning in top.c, 1 warning in mahcine.c, 4 warning in display.c, - 1 warning in utils.c Tested with base clang, gcc7, gcc9, base gcc (mips) Modified: head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/display.c Sun Jun 3 23:40:54 2018 (r334593) @@ -28,6 +28,7 @@ * *_process, u_endscreen. */ +#include #include #include @@ -90,8 +91,7 @@ static int cpustates_column; static enum { OFF, ON, ERASE } header_status = ON; -static int string_count(char **); -static void summary_format(char *, int *, char **); +static void summary_format(char *, int *, const char * const *); static void line_update(char *, char *, int, int); int x_lastpid = 10; @@ -203,23 +203,23 @@ int display_init(struct statics * statics) { /* save pointers and allocate space for names */ procstate_names = statics->procstate_names; - num_procstates = string_count(procstate_names); + num_procstates = 8; assert(num_procstates > 0); lprocstates = calloc(num_procstates, sizeof(int)); cpustate_names = statics->cpustate_names; swap_names = statics->swap_names; - num_swap = string_count(swap_names); + num_swap = 7; assert(num_swap > 0); lswap = calloc(num_swap, sizeof(int)); - num_cpustates = string_count(cpustate_names); + num_cpustates = CPUSTATES; assert(num_cpustates > 0); lcpustates = calloc(num_cpustates * sizeof(int), statics->ncpus); cpustate_columns = calloc(num_cpustates, sizeof(int)); memory_names = statics->memory_names; - num_memory = string_count(memory_names); + num_memory = 7; assert(num_memory > 0); lmemory = calloc(num_memory, sizeof(int)); @@ -422,8 +422,8 @@ i_cpustates(int *states) { int i = 0; int value; - char **names; - char *thisname; + const char * const *names; + const char *thisname; int cpu; for (cpu = 0; cpu < num_cpus; cpu++) { @@ -761,7 +761,7 @@ trim_header(const char *text) void i_header(const char *text) { - const char *s; + char *s; s = trim_header(text); if (s != NULL) @@ -1075,23 +1075,11 @@ readline(char *buffer, int size, int numeric) /* internal support routines */ -static int string_count(char **pp) +static void summary_format(char *str, int *numbers, const char * const *names) { - int cnt; - - cnt = 0; - while (*pp++ != NULL) - { - cnt++; - } - return(cnt); -} - -static void summary_format(char *str, int *numbers, char **names) -{ char *p; int num; - char *thisname; + const char *thisname; char rbuf[6]; /* format each number followed by its string */ Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/machine.c Sun Jun 3 23:40:54 2018 (r334593) @@ -15,7 +15,6 @@ * $FreeBSD$ */ -#include #include #include #include @@ -147,12 +146,12 @@ static long cp_diff[CPUSTATES]; /* these are for detailing the process states */ -static int process_states[8]; static const char *procstatenames[] = { "", " starting, ", " running, ", " sleeping, ", " stopped, ", " zombie, ", " waiting, ", " lock, ", NULL }; +static int process_states[nitems(procstatenames)]; /* these are for detailing the cpu states */ @@ -163,29 +162,29 @@ static const char *cpustatenames[] = { /* these are for detailing the memory statistics */ -static int memory_stats[7]; static const char *memorynames[] = { "K Active, ", "K Inact, ", "K Laundry, ", "K Wired, ", "K Buf, ", "K Free", NULL }; +static int memory_stats[nitems(memorynames)]; -static int arc_stats[7]; static const char *arcnames[] = { "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", NULL }; +static int arc_stats[nitems(arcnames)]; -static int carc_stats[4]; static const char *carcnames[] = { "K Compressed, ", "K Uncompressed, ", ":1 Ratio, ", NULL }; +static int carc_stats[nitems(carcnames)]; -static int swap_stats[7]; static const char *swapnames[] = { "K Total, ", "K Used, ", "K Free, ", "% Inuse, ", "K In, ", "K Out", NULL }; +static int swap_stats[nitems(swapnames)]; /* these are for keeping track of the proc array */ @@ -914,13 +913,13 @@ get_process_info(struct system_info *si, struct proces /* pass back a handle */ handle.next_proc = pref; handle.remaining = active_procs; - return ((caddr_t)&handle); + return ((void*)&handle); } static char fmt[512]; /* static area where result is built */ char * -format_next_process(caddr_t xhandle, char *(*get_userid)(int), int flags) +format_next_process(void* xhandle, char *(*get_userid)(int), int flags) { struct kinfo_proc *pp; const struct kinfo_proc *oldp; @@ -932,11 +931,11 @@ format_next_process(caddr_t xhandle, char *(*get_useri size_t state; struct rusage ru, *rup; long p_tot, s_tot; - char *proc_fmt; + const char *proc_fmt; char thr_buf[6]; char jid_buf[TOP_JID_LEN + 1], swap_buf[TOP_SWAP_LEN + 1]; char *cmdbuf = NULL; - const char * const *args; + char **args; const int cmdlen = 128; /* find and remember the next proc structure */ @@ -1026,8 +1025,9 @@ format_next_process(caddr_t xhandle, char *(*get_useri "[%s]", pp->ki_comm); } } else { - char *src, *dst, *argbuf; - char *cmd; + const char *src; + char *dst, *argbuf; + const char *cmd; size_t argbuflen; size_t len; Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/machine.h Sun Jun 3 23:40:54 2018 (r334593) @@ -10,8 +10,11 @@ #ifndef MACHINE_H #define MACHINE_H -#include "top.h" +#define NUM_AVERAGES 3 +/* Log base 2 of 1024 is 10 (2^10 == 1024) */ +#define LOG1024 10 + /* * the statics struct is filled in by machine_init */ @@ -76,7 +79,7 @@ struct process_select /* routines defined by the machine dependent module */ const char *format_header(const char *uname_field); -char *format_next_process(caddr_t handle, char *(*get_userid)(int), +char *format_next_process(void* handle, char *(*get_userid)(int), int flags); void toggle_pcpustats(void); void get_system_info(struct system_info *si); Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/top.c Sun Jun 3 23:40:54 2018 (r334593) @@ -210,7 +210,7 @@ main(int argc, char *argv[]) const char *uname_field = "USERNAME"; const char *header_text; char *env_top; - char **preset_argv; + const char **preset_argv; int preset_argc = 0; char **av; int ac; Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/top.h Sun Jun 3 23:40:54 2018 (r334593) @@ -18,9 +18,6 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ #define MAX_COLS 512 -/* Log base 2 of 1024 is 10 (2^10 == 1024) */ -#define LOG1024 10 - /* Special atoi routine returns either a non-negative number or one of: */ #define Infinity -1 #define Invalid -2 @@ -31,8 +28,6 @@ extern int Header_lines; /* 7 */ /* * The entire display is based on these next numbers being defined as is. */ - -#define NUM_AVERAGES 3 /* Exit code for system errors */ #define TOP_EX_SYS_ERROR 23 Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/utils.c Sun Jun 3 23:40:54 2018 (r334593) @@ -142,7 +142,7 @@ int digits(int val) */ int -string_index(const char *string, char *array[]) +string_index(const char *string, const char * const *array) { size_t i = 0; @@ -165,8 +165,8 @@ string_index(const char *string, char *array[]) * squat about quotes. */ -char ** -argparse(char *line, int *cntp) +const char * const * +argparse(const char *line, int *cntp) { const char *from; char *to; @@ -175,7 +175,7 @@ argparse(char *line, int *cntp) int length; int lastch; char **argv; - char **argarray; + const char * const *argarray; char *args; /* unfortunately, the only real way to do this is to go thru the Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Sun Jun 3 23:36:29 2018 (r334592) +++ head/usr.bin/top/utils.h Sun Jun 3 23:40:54 2018 (r334593) @@ -16,11 +16,11 @@ int atoiwi(const char *); char *itoa(unsigned int); char *itoa7(int); int digits(int); -char **argparse(char *, int *); +const char * const *argparse(const char *, int *); long percentages(int, int *, long *, long *, long *); char *format_time(long); char *format_k(int); char *format_k2(unsigned long long); -int string_index(const char *string, char *array[]); +int string_index(const char *string, const char * const *array); int find_pid(pid_t pid); From owner-svn-src-head@freebsd.org Sun Jun 3 23:49:03 2018 Return-Path: Delivered-To: svn-src-head@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 EE074FEEE9E; Sun, 3 Jun 2018 23:49:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A30E8847FE; Sun, 3 Jun 2018 23:49:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 814F625781; Sun, 3 Jun 2018 23:49:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53Nn2rO005163; Sun, 3 Jun 2018 23:49:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53Nn2YV005162; Sun, 3 Jun 2018 23:49:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806032349.w53Nn2YV005162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 3 Jun 2018 23:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334594 - head/cddl/usr.sbin/dwatch X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch X-SVN-Commit-Revision: 334594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 23:49:03 -0000 Author: dteske Date: Sun Jun 3 23:49:02 2018 New Revision: 334594 URL: https://svnweb.freebsd.org/changeset/base/334594 Log: dwatch(1): Update manual to reference actual release MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/dwatch.1 Modified: head/cddl/usr.sbin/dwatch/dwatch.1 ============================================================================== --- head/cddl/usr.sbin/dwatch/dwatch.1 Sun Jun 3 23:40:54 2018 (r334593) +++ head/cddl/usr.sbin/dwatch/dwatch.1 Sun Jun 3 23:49:02 2018 (r334594) @@ -761,6 +761,6 @@ dwatch -F 'pid$target:::entry' -c true .Sh HISTORY .Nm first appeared in -.Fx 12.0-CURRENT . +.Fx 11.2 . .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org From owner-svn-src-head@freebsd.org Mon Jun 4 01:10:26 2018 Return-Path: Delivered-To: svn-src-head@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 57727FF7EDA; Mon, 4 Jun 2018 01:10:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05B9787C8C; Mon, 4 Jun 2018 01:10:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D768E2647A; Mon, 4 Jun 2018 01:10:25 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w541APmT044738; Mon, 4 Jun 2018 01:10:25 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w541ANZr044727; Mon, 4 Jun 2018 01:10:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040110.w541ANZr044727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 01:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat X-SVN-Commit-Revision: 334595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 01:10:26 -0000 Author: mmacy Date: Mon Jun 4 01:10:23 2018 New Revision: 334595 URL: https://svnweb.freebsd.org/changeset/base/334595 Log: hwpmc: support sampling both kernel and user stacks when interrupted in kernel This adds the -U options to pmcstat which will attribute in-kernel samples back to the user stack that invoked the system call. It is not the default, because when looking at kernel profiles it is generally more desirable to merge all instances of a given system call together. Although heavily revised, this change is directly derived from D7350 by Jonathan T. Looney. Obtained from: jtl Sponsored by: Juniper Networks, Limelight Networks Modified: head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/subr_trap.c head/sys/sys/pmc.h head/sys/sys/pmckern.h head/sys/sys/proc.h head/usr.sbin/pmcstat/pmcpl_callgraph.c head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon Jun 4 01:10:23 2018 (r334595) @@ -250,11 +250,9 @@ pmc_plb_rele(struct pmclog_buffer *plb) mtx_unlock_spin(&pmc_dom_hdrs[plb->plb_domain]->pdbh_mtx); } - /* * Get a log buffer */ - static int pmclog_get_buffer(struct pmc_owner *po) { @@ -345,7 +343,6 @@ pmclog_proc_ignite(void *handle, struct pmc_owner *po) * * This function is executed by each pmc owner's helper thread. */ - static void pmclog_loop(void *arg) { @@ -846,12 +843,15 @@ pmclog_schedule_one_cond(void *arg) { struct pmc_owner *po = arg; struct pmclog_buffer *plb; + int cpu; spinlock_enter(); + cpu = curcpu; /* tell hardclock not to run again */ - if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) + if (PMC_CPU_HAS_SAMPLES(cpu)) PMC_CALL_HOOK_UNLOCKED(curthread, PMC_FN_DO_SAMPLES, NULL); - plb = po->po_curbuf[curcpu]; + pmc_flush_samples(cpu); + plb = po->po_curbuf[cpu]; if (plb && plb->plb_ptr != plb->plb_base) pmclog_schedule_io(po, 1); spinlock_exit(); Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 4 01:10:23 2018 (r334595) @@ -207,6 +207,8 @@ static int pmc_debugflags_parse(char *newstr, char *fe #endif static int load(struct module *module, int cmd, void *arg); +static int pmc_add_sample(int cpu, int ring, struct pmc *pm, + struct trapframe *tf, int inuserspace); static void pmc_add_thread_descriptors_from_proc(struct proc *p, struct pmc_process *pp); static int pmc_attach_process(struct proc *p, struct pmc *pm); @@ -248,6 +250,7 @@ static void pmc_process_samples(int cpu, int soft); static void pmc_release_pmc_descriptor(struct pmc *pmc); static void pmc_process_thread_add(struct thread *td); static void pmc_process_thread_delete(struct thread *td); +static void pmc_process_thread_userret(struct thread *td); static void pmc_remove_owner(struct pmc_owner *po); static void pmc_remove_process_descriptor(struct pmc_process *pp); static void pmc_restore_cpu_binding(struct pmc_binding *pb); @@ -265,7 +268,7 @@ static int generic_switch_in(struct pmc_cpu *pc, struc static int generic_switch_out(struct pmc_cpu *pc, struct pmc_process *pp); static struct pmc_mdep *pmc_generic_cpu_initialize(void); static void pmc_generic_cpu_finalize(struct pmc_mdep *md); - +static void pmc_post_callchain_callback(void); /* * Kernel tunables and sysctl(8) interface. */ @@ -291,6 +294,10 @@ SYSCTL_COUNTER_U64(_kern_hwpmc_stats, OID_AUTO, buffer &pmc_stats.pm_buffer_requests_failed, "# of buffer requests which failed"); SYSCTL_COUNTER_U64(_kern_hwpmc_stats, OID_AUTO, log_sweeps, CTLFLAG_RW, &pmc_stats.pm_log_sweeps, "# of ?"); +SYSCTL_COUNTER_U64(_kern_hwpmc_stats, OID_AUTO, merges, CTLFLAG_RW, + &pmc_stats.pm_merges, "# of times kernel stack was found for user trace"); +SYSCTL_COUNTER_U64(_kern_hwpmc_stats, OID_AUTO, overwrites, CTLFLAG_RW, + &pmc_stats.pm_overwrites, "# of times a sample was overwritten before being logged"); static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, @@ -1703,6 +1710,19 @@ pmc_process_thread_delete(struct thread *td) } /* + * A userret() call for a thread. + */ +static void +pmc_process_thread_userret(struct thread *td) +{ + + thread_lock(td); + curthread->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + pmc_post_callchain_callback(); +} + +/* * A mapping change for a process. */ @@ -2030,6 +2050,7 @@ const char *pmc_hooknames[] = { "SOFTSAMPLING", "THR-CREATE", "THR-EXIT", + "THR-USERRET", }; #endif @@ -2194,6 +2215,7 @@ pmc_hook_handler(struct thread *td, int function, void cpu = PCPU_GET(cpuid); pmc_process_samples(cpu, PMC_HR); pmc_process_samples(cpu, PMC_SR); + pmc_process_samples(cpu, PMC_UR); break; case PMC_FN_MMAP: @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR, (struct trapframe *) arg); + + KASSERT(td->td_pinned == 1, + ("[pmc,%d] invalid td_pinned value", __LINE__)); + sched_unpin(); /* Can migrate safely now. */ + td->td_pflags &= ~TDP_CALLCHAIN; break; @@ -2223,8 +2250,18 @@ pmc_hook_handler(struct thread *td, int function, void */ KASSERT(td == curthread, ("[pmc,%d] td != curthread", __LINE__)); - pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_SR, + + cpu = PCPU_GET(cpuid); + pmc_capture_user_callchain(cpu, PMC_SR, (struct trapframe *) arg); + pmc_capture_user_callchain(cpu, PMC_UR, + (struct trapframe *) arg); + + KASSERT(td->td_pinned == 1, + ("[pmc,%d] invalid td_pinned value", __LINE__)); + + sched_unpin(); /* Can migrate safely now. */ + td->td_pflags &= ~TDP_CALLCHAIN; break; @@ -2245,6 +2282,12 @@ pmc_hook_handler(struct thread *td, int function, void pmc_process_thread_delete(td); break; + case PMC_FN_THR_USERRET: + KASSERT(td == curthread, ("[pmc,%d] td != curthread", + __LINE__)); + pmc_process_thread_userret(td); + break; + default: #ifdef HWPMC_DEBUG KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function)); @@ -2658,7 +2701,9 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * Loop (with a forced context switch) till the PMC's runcount * comes down to zero. */ + pmclog_flush(pm->pm_owner); while (counter_u64_fetch(pm->pm_runcount) > 0) { + pmclog_flush(pm->pm_owner); #ifdef HWPMC_DEBUG maxloop--; KASSERT(maxloop > 0, @@ -3264,7 +3309,7 @@ pmc_class_to_classdep(enum pmc_class class) return (NULL); } -#ifdef HWPMC_DEBUG +#if defined(HWPMC_DEBUG) && defined(KTR) static const char *pmc_op_to_name[] = { #undef __PMC_OP #define __PMC_OP(N, D) #N , @@ -3806,11 +3851,26 @@ pmc_syscall_handler(struct thread *td, void *syscall_a */ if ((pa.pm_flags & ~(PMC_F_DESCENDANTS | PMC_F_LOG_PROCCSW | - PMC_F_LOG_PROCEXIT | PMC_F_CALLCHAIN)) != 0) { + PMC_F_LOG_PROCEXIT | PMC_F_CALLCHAIN | + PMC_F_USERCALLCHAIN)) != 0) { error = EINVAL; break; } + /* PMC_F_USERCALLCHAIN is only valid with PMC_F_CALLCHAIN */ + if ((pa.pm_flags & (PMC_F_CALLCHAIN | PMC_F_USERCALLCHAIN)) == + PMC_F_USERCALLCHAIN) { + error = EINVAL; + break; + } + + /* PMC_F_USERCALLCHAIN is only valid for sampling mode */ + if (pa.pm_flags & PMC_F_USERCALLCHAIN && + mode != PMC_MODE_TS && mode != PMC_MODE_SS) { + error = EINVAL; + break; + } + /* process logging options are not allowed for system PMCs */ if (PMC_IS_SYSTEM_MODE(mode) && (pa.pm_flags & (PMC_F_LOG_PROCCSW | PMC_F_LOG_PROCEXIT))) { @@ -4533,8 +4593,6 @@ pmc_post_callchain_callback(void) } /* - * Interrupt processing. - * * Find a free slot in the per-cpu array of samples and capture the * current callchain there. If a sample was successfully added, a bit * is set in mask 'pmc_cpumask' denoting that the DO_SAMPLES hook @@ -4544,8 +4602,8 @@ pmc_post_callchain_callback(void) * use any of the locking primitives supplied by the OS. */ -int -pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, +static int +pmc_add_sample(int cpu, int ring, struct pmc *pm, struct trapframe *tf, int inuserspace) { int error, callchaindepth; @@ -4561,7 +4619,11 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p psb = pmc_pcpu[cpu]->pc_sb[ring]; ps = psb->ps_write; - if (ps->ps_nsamples) { /* in use, reader hasn't caught up */ + if (ps->ps_nsamples == PMC_SAMPLE_INUSE) { + counter_u64_add(ps->ps_pmc->pm_runcount, -1); + counter_u64_add(pmc_stats.pm_overwrites, 1); + ps->ps_nsamples = 0; + } else if (ps->ps_nsamples) { /* in use, reader hasn't caught up */ pm->pm_pcpu_state[cpu].pps_stalled = 1; counter_u64_add(pmc_stats.pm_intr_bufferfull, 1); PMCDBG6(SAM,INT,1,"(spc) cpu=%d pm=%p tf=%p um=%d wr=%d rd=%d", @@ -4573,7 +4635,6 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p goto done; } - /* Fill in entry. */ PMCDBG6(SAM,INT,1,"cpu=%d pm=%p tf=%p um=%d wr=%d rd=%d", cpu, pm, (void *) tf, inuserspace, @@ -4619,7 +4680,11 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p } ps->ps_nsamples = callchaindepth; /* mark entry as in use */ - + if (ring == PMC_UR) { + ps->ps_nsamples_actual = callchaindepth; /* mark entry as in use */ + ps->ps_nsamples = PMC_SAMPLE_INUSE; + } else + ps->ps_nsamples = callchaindepth; /* mark entry as in use */ /* increment write pointer, modulo ring buffer size */ ps++; if (ps == psb->ps_fence) @@ -4636,6 +4701,30 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p } /* + * Interrupt processing. + * + * This function is meant to be called from an NMI handler. It cannot + * use any of the locking primitives supplied by the OS. + */ + +int +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, + int inuserspace) +{ + struct thread *td; + + td = curthread; + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && + td && td->td_proc && + (td->td_proc->p_flag & P_KPROC) == 0 && + !inuserspace) { + atomic_add_int(&curthread->td_pmcpend, 1); + return (pmc_add_sample(cpu, PMC_UR, pm, tf, 0)); + } + return (pmc_add_sample(cpu, ring, pm, tf, inuserspace)); +} + +/* * Capture a user call chain. This function will be called from ast() * before control returns to userland and before the process gets * rescheduled. @@ -4648,6 +4737,7 @@ pmc_capture_user_callchain(int cpu, int ring, struct t struct thread *td; struct pmc_sample *ps, *ps_end; struct pmc_samplebuffer *psb; + int nsamples, nrecords, pass; #ifdef INVARIANTS int ncallchains; int nfree; @@ -4664,6 +4754,11 @@ pmc_capture_user_callchain(int cpu, int ring, struct t ncallchains = 0; nfree = 0; #endif + nrecords = INT_MAX; + pass = 0; + restart: + if (ring == PMC_UR) + nrecords = atomic_readandclear_32(&td->td_pmcpend); /* * Iterate through all deferred callchain requests. @@ -4675,6 +4770,11 @@ pmc_capture_user_callchain(int cpu, int ring, struct t ps_end = psb->ps_write; do { #ifdef INVARIANTS + if (ps->ps_nsamples == PMC_SAMPLE_FREE) { + nfree++; + goto next; + } + if ((ps->ps_pmc == NULL) || (ps->ps_pmc->pm_state != PMC_STATE_RUNNING)) nfree++; @@ -4697,37 +4797,91 @@ pmc_capture_user_callchain(int cpu, int ring, struct t KASSERT(counter_u64_fetch(pm->pm_runcount) > 0, ("[pmc,%d] runcount %ld", __LINE__, (unsigned long)counter_u64_fetch(pm->pm_runcount))); + if (ring == PMC_UR) { + nsamples = ps->ps_nsamples_actual; + counter_u64_add(pmc_stats.pm_merges, 1); + } else + nsamples = 0; + /* * Retrieve the callchain and mark the sample buffer * as 'processable' by the timer tick sweep code. */ - ps->ps_nsamples = pmc_save_user_callchain(ps->ps_pc, - pmc_callchaindepth, tf); -#ifdef INVARIANTS +#ifdef INVARIANTS ncallchains++; #endif + if (__predict_true(nsamples < pmc_callchaindepth - 1)) + nsamples += pmc_save_user_callchain(ps->ps_pc + nsamples, + pmc_callchaindepth - nsamples - 1, tf); + wmb(); + ps->ps_nsamples = nsamples; + if (nrecords-- == 1) + break; next: /* increment the pointer, modulo sample ring size */ if (++ps == psb->ps_fence) ps = psb->ps_samples; } while (ps != ps_end); + if (__predict_false(ring == PMC_UR && td->td_pmcpend)) { + if (pass == 0) { + pass = 1; + goto restart; + } + /* only collect samples for this part once */ + td->td_pmcpend = 0; + } -#ifdef INVARIANTS - KASSERT(ncallchains > 0 || nfree > 0, - ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, - cpu)); +#ifdef INVARIANTS + if (ring == PMC_HR) + KASSERT(ncallchains > 0 || nfree > 0, + ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, + cpu)); #endif - KASSERT(td->td_pinned == 1, - ("[pmc,%d] invalid td_pinned value", __LINE__)); - sched_unpin(); /* Can migrate safely now. */ - /* mark CPU as needing processing */ DPCPU_SET(pmc_sampled, 1); } + +static void +pmc_flush_ring(int cpu, int ring) +{ + struct pmc *pm; + struct pmc_sample *ps; + struct pmc_samplebuffer *psb; + int n; + + psb = pmc_pcpu[cpu]->pc_sb[ring]; + + for (n = 0; n < pmc_nsamples; n++) { /* bound on #iterations */ + + ps = psb->ps_read; + if (ps->ps_nsamples == PMC_SAMPLE_FREE) + goto next; + pm = ps->ps_pmc; + counter_u64_add(pm->pm_runcount, -1); + ps->ps_nsamples = PMC_SAMPLE_FREE; + /* increment read pointer, modulo sample size */ + next: + if (++ps == psb->ps_fence) + psb->ps_read = psb->ps_samples; + else + psb->ps_read = ps; + } +} + +void +pmc_flush_samples(int cpu) +{ + int n; + + for (n = 0; n < PMC_NUM_SR; n++) + pmc_flush_ring(cpu, n); +} + + /* * Process saved PC samples. */ @@ -4788,23 +4942,20 @@ pmc_process_samples(int cpu, int ring) * its owner, and if the PC is in user mode, update * profiling statistics like timer-based profiling * would have done. + * + * Otherwise, this is either a sampling-mode PMC that + * is attached to a different process than its owner, + * or a system-wide sampling PMC. Dispatch a log + * entry to the PMC's owner process. */ if (pm->pm_flags & PMC_F_ATTACHED_TO_OWNER) { if (ps->ps_flags & PMC_CC_F_USERSPACE) { td = FIRST_THREAD_IN_PROC(po->po_owner); addupc_intr(td, ps->ps_pc[0], 1); } - goto entrydone; - } + } else + pmclog_process_callchain(pm, ps); - /* - * Otherwise, this is either a sampling mode PMC that - * is attached to a different process than its owner, - * or a system-wide sampling PMC. Dispatch a log - * entry to the PMC's owner process. - */ - pmclog_process_callchain(pm, ps); - entrydone: ps->ps_nsamples = 0; /* mark entry as free */ counter_u64_add(pm->pm_runcount, -1); @@ -5282,6 +5433,8 @@ pmc_initialize(void) pmc_stats.pm_buffer_requests = counter_u64_alloc(M_WAITOK); pmc_stats.pm_buffer_requests_failed = counter_u64_alloc(M_WAITOK); pmc_stats.pm_log_sweeps = counter_u64_alloc(M_WAITOK); + pmc_stats.pm_merges = counter_u64_alloc(M_WAITOK); + pmc_stats.pm_overwrites = counter_u64_alloc(M_WAITOK); #ifdef HWPMC_DEBUG /* parse debug flags first */ @@ -5427,6 +5580,24 @@ pmc_initialize(void) (n * pmc_callchaindepth); pmc_pcpu[cpu]->pc_sb[PMC_SR] = sb; + + sb = malloc_domain(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, + M_WAITOK|M_ZERO); + sb->ps_read = sb->ps_write = sb->ps_samples; + sb->ps_fence = sb->ps_samples + pmc_nsamples; + + KASSERT(pmc_pcpu[cpu] != NULL, + ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); + + sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * + sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); + + for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) + ps->ps_pc = sb->ps_callchains + + (n * pmc_callchaindepth); + + pmc_pcpu[cpu]->pc_sb[PMC_UR] = sb; } /* allocate space for the row disposition array */ @@ -5637,10 +5808,15 @@ pmc_cleanup(void) KASSERT(pmc_pcpu[cpu]->pc_sb[PMC_SR] != NULL, ("[pmc,%d] Null sw cpu sample buffer cpu=%d", __LINE__, cpu)); + KASSERT(pmc_pcpu[cpu]->pc_sb[PMC_UR] != NULL, + ("[pmc,%d] Null userret cpu sample buffer cpu=%d", __LINE__, + cpu)); free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR]->ps_callchains, M_PMC); free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR], M_PMC); free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR]->ps_callchains, M_PMC); free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR], M_PMC); + free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR]->ps_callchains, M_PMC); + free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR], M_PMC); free_domain(pmc_pcpu[cpu], M_PMC); } @@ -5669,6 +5845,8 @@ pmc_cleanup(void) counter_u64_free(pmc_stats.pm_buffer_requests); counter_u64_free(pmc_stats.pm_buffer_requests_failed); counter_u64_free(pmc_stats.pm_log_sweeps); + counter_u64_free(pmc_stats.pm_merges); + counter_u64_free(pmc_stats.pm_overwrites); sx_xunlock(&pmc_sx); /* we are done */ } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/kern/subr_trap.c Mon Jun 4 01:10:23 2018 (r334595) @@ -145,6 +145,11 @@ userret(struct thread *td, struct trapframe *frame) */ if (p->p_flag & P_PROFIL) addupc_task(td, TRAPF_PC(frame), td->td_pticks * psratio); + +#ifdef HWPMC_HOOKS + if (PMC_THREAD_HAS_SAMPLES(td)) + PMC_CALL_HOOK(td, PMC_FN_THR_USERRET, NULL); +#endif /* * Let the scheduler adjust our priority etc. */ Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/sys/pmc.h Mon Jun 4 01:10:23 2018 (r334595) @@ -369,13 +369,14 @@ enum pmc_ops { #define PMC_F_KGMON 0x00000040 /*OP ALLOCATE kgmon(8) profiling */ /* V2 API */ #define PMC_F_CALLCHAIN 0x00000080 /*OP ALLOCATE capture callchains */ +#define PMC_F_USERCALLCHAIN 0x00000100 /*OP ALLOCATE use userspace stack */ /* internal flags */ #define PMC_F_ATTACHED_TO_OWNER 0x00010000 /*attached to owner*/ #define PMC_F_NEEDS_LOGFILE 0x00020000 /*needs log file */ #define PMC_F_ATTACH_DONE 0x00040000 /*attached at least once */ -#define PMC_CALLCHAIN_DEPTH_MAX 128 +#define PMC_CALLCHAIN_DEPTH_MAX 512 #define PMC_CC_F_USERSPACE 0x01 /*userspace callchain*/ @@ -568,6 +569,8 @@ struct pmc_driverstats { counter_u64_t pm_buffer_requests_failed; /* #failed buffer requests */ counter_u64_t pm_log_sweeps; /* #sample buffer processing passes */ + counter_u64_t pm_merges; /* merged k+u */ + counter_u64_t pm_overwrites; /* UR overwrites */ }; #endif @@ -643,11 +646,11 @@ struct pmc_op_getdyneventinfo { #define PMC_HASH_SIZE 1024 #define PMC_MTXPOOL_SIZE 2048 -#define PMC_LOG_BUFFER_SIZE 128 -#define PMC_NLOGBUFFERS_PCPU 8 -#define PMC_NSAMPLES 64 -#define PMC_CALLCHAIN_DEPTH 32 -#define PMC_THREADLIST_MAX 64 +#define PMC_LOG_BUFFER_SIZE 256 +#define PMC_NLOGBUFFERS_PCPU 32 +#define PMC_NSAMPLES 256 +#define PMC_CALLCHAIN_DEPTH 128 +#define PMC_THREADLIST_MAX 128 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." @@ -923,9 +926,9 @@ struct pmc_hw { struct pmc_sample { uint16_t ps_nsamples; /* callchain depth */ + uint16_t ps_nsamples_actual; uint16_t ps_cpu; /* cpu number */ uint16_t ps_flags; /* other flags */ - uint8_t ps_pad[2]; lwpid_t ps_tid; /* thread id */ pid_t ps_pid; /* process PID or -1 */ struct thread *ps_td; /* which thread */ @@ -954,7 +957,7 @@ struct pmc_samplebuffer { struct pmc_cpu { uint32_t pc_state; /* physical cpu number + flags */ - struct pmc_samplebuffer *pc_sb[2]; /* space for samples */ + struct pmc_samplebuffer *pc_sb[3]; /* space for samples */ struct pmc_hw *pc_hwpmcs[]; /* 'npmc' pointers */ }; @@ -1203,7 +1206,7 @@ MALLOC_DECLARE(M_PMC); struct pmc_mdep *pmc_md_initialize(void); /* MD init function */ void pmc_md_finalize(struct pmc_mdep *_md); /* MD fini function */ int pmc_getrowdisp(int _ri); -int pmc_process_interrupt(int _cpu, int _soft, struct pmc *_pm, +int pmc_process_interrupt(int _cpu, int _ring, struct pmc *_pm, struct trapframe *_tf, int _inuserspace); int pmc_save_kernel_callchain(uintptr_t *_cc, int _maxsamples, struct trapframe *_tf); @@ -1211,5 +1214,6 @@ int pmc_save_user_callchain(uintptr_t *_cc, int _maxsa struct trapframe *_tf); struct pmc_mdep *pmc_mdep_alloc(int nclasses); void pmc_mdep_free(struct pmc_mdep *md); +void pmc_flush_samples(int cpu); #endif /* _KERNEL */ #endif /* _SYS_PMC_H_ */ Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/sys/pmckern.h Mon Jun 4 01:10:23 2018 (r334595) @@ -62,9 +62,12 @@ #define PMC_FN_SOFT_SAMPLING 11 #define PMC_FN_THR_CREATE 12 #define PMC_FN_THR_EXIT 13 +#define PMC_FN_THR_USERRET 14 #define PMC_HR 0 /* Hardware ring buffer */ #define PMC_SR 1 /* Software ring buffer */ +#define PMC_UR 2 /* userret ring buffer */ +#define PMC_NUM_SR (PMC_UR+1) struct pmckern_procexec { int pm_credentialschanged; @@ -226,6 +229,9 @@ do { \ /* Check if a process is using HWPMCs.*/ #define PMC_PROC_IS_USING_PMCS(p) \ (__predict_false(p->p_flag & P_HWPMC)) + +#define PMC_THREAD_HAS_SAMPLES(td) \ + (__predict_false((td)->td_pmcpend)) /* Check if a thread have pending user capture. */ #define PMC_IS_PENDING_CALLCHAIN(p) \ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jun 3 23:49:02 2018 (r334594) +++ head/sys/sys/proc.h Mon Jun 4 01:10:23 2018 (r334595) @@ -375,6 +375,7 @@ struct thread { void *td_lkpi_task; /* LinuxKPI task struct pointer */ TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ epoch_section_t td_epoch_section; /* (t) epoch section object */ + int td_pmcpend; }; struct thread0_storage { Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_callgraph.c Sun Jun 3 23:49:02 2018 (r334594) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Mon Jun 4 01:10:23 2018 (r334595) @@ -345,7 +345,7 @@ pmcpl_cg_process(struct pmcstat_process *pp, struct pm pc = cc[0]; pmcid = pmcr->pr_pmcid; - parent = pmcstat_cgnode_hash_lookup_pc(pp, pmcid, pc, usermode); + child = parent = pmcstat_cgnode_hash_lookup_pc(pp, pmcid, pc, usermode); if (parent == NULL) { pmcstat_stats.ps_callchain_dubious_frames++; pmcr->pr_dubious_frames++; @@ -384,7 +384,7 @@ pmcpl_cg_process(struct pmcstat_process *pp, struct pm } } if (ppm == NULL) - return; + continue; image = ppm->ppm_image; loadaddress = ppm->ppm_lowpc + image->pi_vaddr - Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Sun Jun 3 23:49:02 2018 (r334594) +++ head/usr.sbin/pmcstat/pmcstat.8 Mon Jun 4 01:10:23 2018 (r334595) @@ -47,7 +47,7 @@ .Op Fl R Ar logfilename .Op Fl S Ar event-spec .Op Fl T -.Op Fl U Ar event-spec +.Op Fl U .Op Fl W .Op Fl a Ar pathname .Op Fl c Ar cpu-spec @@ -226,8 +226,10 @@ can be used: 'c+a' switch to accumulative mode, 'c+d' to delta mode, 'm' merge PMCs, 'n' change view, 'p' show next PMC, ' ' pause, 'q' quit. calltree only: 'f' cost under threshold is seen as a dot. -.It Fl U Ar event-spec -Provide long description of event. +.It Fl U +Toggle capturing user-space call traces while in kernel mode. +The default is for sampling PMCs to capture user-space callchain information +while in user-space mode, and kernel callchain information while in kernel mode. .It Fl W Toggle logging the incremental counts seen by the threads of a tracked process each time they are scheduled on a CPU. Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Sun Jun 3 23:49:02 2018 (r334594) +++ head/usr.sbin/pmcstat/pmcstat.c Mon Jun 4 01:10:23 2018 (r334595) @@ -374,7 +374,7 @@ pmcstat_show_usage(void) "\t -R file\t read events from \"file\"\n" "\t -S spec\t allocate a system-wide sampling PMC\n" "\t -T\t\t start in top mode\n" - "\t -U spec \t provide long description of counters matching spec\n" + "\t -U \t\n merged user kernel stack capture\n" "\t -W\t\t (toggle) show counts per context switch\n" "\t -a file\t print sampled PCs and callgraph to \"file\"\n" "\t -c cpu-list\t set cpus for subsequent system-wide PMCs\n" @@ -432,7 +432,8 @@ main(int argc, char **argv) int option, npmc; int c, check_driver_stats; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; - int do_print, do_read, do_listcounters, do_descr, do_long_descr; + int do_print, do_read, do_listcounters, do_descr; + int do_userspace; size_t len; int graphdepth; int pipefd[2], rfd; @@ -455,7 +456,7 @@ main(int argc, char **argv) do_callchain = 1; do_descr = 0; do_descendants = 0; - do_long_descr = 0; + do_userspace = 0; do_logproccsw = 0; do_logprocexit = 0; do_listcounters = 0; @@ -510,7 +511,7 @@ main(int argc, char **argv) CPU_COPY(&rootmask, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:ILM:NO:P:R:S:TU:WZa:c:def:gi:k:l:m:n:o:p:qr:s:t:u:vw:z:")) != -1) + "CD:EF:G:ILM:NO:P:R:S:TUWZa:c:def:gi:k:l:m:n:o:p:qr:s:t:u:vw:z:")) != -1) switch (option) { case 'a': /* Annotate + callgraph */ args.pa_flags |= FLAG_DO_ANNOTATE; @@ -677,8 +678,11 @@ main(int argc, char **argv) ev->ev_cpu = PMC_CPU_ANY; ev->ev_flags = 0; - if (do_callchain) + if (do_callchain) { ev->ev_flags |= PMC_F_CALLCHAIN; + if (do_userspace) + ev->ev_flags |= PMC_F_USERCALLCHAIN; + } if (do_descendants) ev->ev_flags |= PMC_F_DESCENDANTS; if (do_logprocexit) @@ -776,9 +780,9 @@ main(int argc, char **argv) do_descr = 1; event = optarg; break; - case 'U': - do_long_descr = 1; - event = optarg; + case 'U': /* toggle user-space callchain capture */ + do_userspace = !do_userspace; + args.pa_required |= FLAG_HAS_SAMPLING_PMCS; break; case 'v': /* verbose */ args.pa_verbosity++; @@ -816,17 +820,15 @@ main(int argc, char **argv) break; } - if ((do_listcounters | do_descr | do_long_descr) && + if ((do_listcounters | do_descr) && pmc_pmu_enabled() == 0) errx(EX_USAGE, "pmu features not supported on host or hwpmc not loaded"); if (do_listcounters) { pmc_pmu_print_counters(NULL); } else if (do_descr) { pmc_pmu_print_counter_desc(event); - } else if (do_long_descr) { - pmc_pmu_print_counter_desc_long(event); } - if (do_listcounters | do_descr | do_long_descr) + if (do_listcounters | do_descr) exit(0); args.pa_argc = (argc -= optind); From owner-svn-src-head@freebsd.org Mon Jun 4 02:05:51 2018 Return-Path: Delivered-To: svn-src-head@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 2779DFDCF9C; Mon, 4 Jun 2018 02:05:51 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7D0D6A0F0; Mon, 4 Jun 2018 02:05:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A89A026DFD; Mon, 4 Jun 2018 02:05:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5425owX074530; Mon, 4 Jun 2018 02:05:50 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5425m1P074519; Mon, 4 Jun 2018 02:05:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040205.w5425m1P074519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 02:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334596 - in head: lib/libpmc sys/amd64/include sys/dev/hwpmc sys/i386/include sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmc sys/amd64/include sys/dev/hwpmc sys/i386/include sys/sys X-SVN-Commit-Revision: 334596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 02:05:51 -0000 Author: mmacy Date: Mon Jun 4 02:05:48 2018 New Revision: 334596 URL: https://svnweb.freebsd.org/changeset/base/334596 Log: hwpmc: ABI fixes - increase pmc cpuid field from 8 to 12 bits - add cpuid version string to initialize entry in the log so that filter can identify which counter index an event name maps to - GC unused config flags - make fixed counter assignment more robust as well as the changes needed to be properly identified for filter Modified: head/lib/libpmc/libpmc_pmu_util.c (contents, props changed) head/lib/libpmc/pmclog.c head/lib/libpmc/pmclog.h head/sys/amd64/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/hwpmc_logging.c head/sys/i386/include/pmc_mdep.h head/sys/sys/pmc.h head/sys/sys/pmclog.h Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 01:10:23 2018 (r334595) +++ head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 02:05:48 2018 (r334596) @@ -69,13 +69,14 @@ static struct pmu_alias pmu_alias_table[] = { {NULL, NULL}, }; -static const char *fixed_mode_cntrs[] = { - "inst_retired.any", - "cpu_clk_unhalted.thread", - "cpu_clk_unhalted.thread_any", - "cpu_clk_unhalted.ref_tsc", - NULL -}; +/* + * The Intel fixed mode counters are: + * "inst_retired.any", + * "cpu_clk_unhalted.thread", + * "cpu_clk_unhalted.thread_any", + * "cpu_clk_unhalted.ref_tsc", + * + */ static const char * pmu_alias_get(const char *name) @@ -95,7 +96,7 @@ struct pmu_event_desc { uint32_t ped_frontend; uint32_t ped_ldlat; uint32_t ped_config1; - uint8_t ped_umask; + int16_t ped_umask; uint8_t ped_cmask; uint8_t ped_any; uint8_t ped_inv; @@ -168,6 +169,7 @@ pmu_parse_event(struct pmu_event_desc *ped, const char return (ENOMEM); r = event; bzero(ped, sizeof(*ped)); + ped->ped_umask = -1; while ((kvp = strsep(&event, ",")) != NULL) { key = strsep(&kvp, "="); if (key == NULL) @@ -341,7 +343,6 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc const struct pmu_event *pe; struct pmu_event_desc ped; struct pmc_md_iap_op_pmcallocate *iap; - struct pmc_md_iaf_op_pmcallocate *iaf; int idx, isfixed; iap = &pm->pm_md.pm_iap; @@ -358,35 +359,22 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc if (pmu_parse_event(&ped, pe->event)) return (ENOENT); - for (idx = 0; fixed_mode_cntrs[idx] != NULL; idx++) - if (strcmp(fixed_mode_cntrs[idx], event_name) == 0) - isfixed = 1; - if (isfixed) { - iaf = &pm->pm_md.pm_iaf; - pm->pm_class = PMC_CLASS_IAF; - if (strcasestr(pe->desc, "retired") != NULL) - pm->pm_ev = PMC_EV_IAF_INSTR_RETIRED_ANY; - else if (strcasestr(pe->desc, "core") != NULL || - strcasestr(pe->desc, "unhalted")) - pm->pm_ev = PMC_EV_IAF_CPU_CLK_UNHALTED_CORE; - else if (strcasestr(pe->desc, "ref") != NULL) - pm->pm_ev = PMC_EV_IAF_CPU_CLK_UNHALTED_REF; - iaf->pm_iaf_flags |= (IAF_USR | IAF_OS); - if (ped.ped_any) - iaf->pm_iaf_flags |= IAF_ANY; - if (pm->pm_caps & PMC_CAP_INTERRUPT) - iaf->pm_iaf_flags |= IAF_PMI; - return (0); - } else if (strcasestr(event_name, "UNC_") == event_name || - strcasestr(event_name, "uncore") != NULL) { + + if (strcasestr(event_name, "UNC_") == event_name || + strcasestr(event_name, "uncore") != NULL) { pm->pm_class = PMC_CLASS_UCP; - } else { pm->pm_caps |= PMC_CAP_QUALIFIER; + } else if ((ped.ped_umask == -1) || + (ped.ped_event == 0x0 && ped.ped_umask == 0x3)) { + pm->pm_class = PMC_CLASS_IAF; + } else { pm->pm_class = PMC_CLASS_IAP; + pm->pm_caps |= PMC_CAP_QUALIFIER; } pm->pm_ev = idx; iap->pm_iap_config |= IAP_EVSEL(ped.ped_event); - iap->pm_iap_config |= IAP_UMASK(ped.ped_umask); + if (ped.ped_umask > 0) + iap->pm_iap_config |= IAP_UMASK(ped.ped_umask); iap->pm_iap_config |= IAP_CMASK(ped.ped_cmask); iap->pm_iap_rsp = ped.ped_offcore_rsp; Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Mon Jun 4 01:10:23 2018 (r334595) +++ head/lib/libpmc/pmclog.c Mon Jun 4 02:05:48 2018 (r334596) @@ -348,6 +348,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_INITIALIZE: PMCLOG_READ32(le,ev->pl_u.pl_i.pl_version); PMCLOG_READ32(le,ev->pl_u.pl_i.pl_arch); + PMCLOG_READ32(le, noop); + PMCLOG_READSTRING(le, ev->pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); ps->ps_version = ev->pl_u.pl_i.pl_version; ps->ps_arch = ev->pl_u.pl_i.pl_arch; ps->ps_initialized = 1; Modified: head/lib/libpmc/pmclog.h ============================================================================== --- head/lib/libpmc/pmclog.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/lib/libpmc/pmclog.h Mon Jun 4 02:05:48 2018 (r334596) @@ -64,6 +64,7 @@ struct pmclog_ev_closelog { struct pmclog_ev_initialize { uint32_t pl_version; uint32_t pl_arch; + char pl_cpuid[PATH_MAX]; }; struct pmclog_ev_map_in { Modified: head/sys/amd64/include/pmc_mdep.h ============================================================================== --- head/sys/amd64/include/pmc_mdep.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/amd64/include/pmc_mdep.h Mon Jun 4 02:05:48 2018 (r334596) @@ -73,7 +73,6 @@ struct pmc_mdep; union pmc_md_op_pmcallocate { struct pmc_md_amd_op_pmcallocate pm_amd; - struct pmc_md_iaf_op_pmcallocate pm_iaf; struct pmc_md_iap_op_pmcallocate pm_iap; struct pmc_md_ucf_op_pmcallocate pm_ucf; struct pmc_md_ucp_op_pmcallocate pm_ucp; Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/dev/hwpmc/hwpmc_core.c Mon Jun 4 02:05:48 2018 (r334596) @@ -224,8 +224,9 @@ static int iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - enum pmc_event ev; - uint32_t caps, flags, validflags; + uint8_t ev, umask; + uint32_t caps, flags, config; + const struct pmc_md_iap_op_pmcallocate *iap; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal CPU %d", __LINE__, cpu)); @@ -241,19 +242,32 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, (caps & IAF_PMC_CAPS) != caps) return (EINVAL); - ev = pm->pm_event; + iap = &a->pm_md.pm_iap; + config = iap->pm_iap_config; + ev = IAP_EVSEL_GET(config); + umask = IAP_UMASK_GET(config); - - if (ev == PMC_EV_IAF_INSTR_RETIRED_ANY && ri != 0) + /* INST_RETIRED.ANY */ + if (ev == 0xC0 && ri != 0) return (EINVAL); - if (ev == PMC_EV_IAF_CPU_CLK_UNHALTED_CORE && ri != 1) + /* CPU_CLK_UNHALTED.THREAD */ + else if (ev == 0x3C && ri != 1) return (EINVAL); - if (ev == PMC_EV_IAF_CPU_CLK_UNHALTED_REF && ri != 2) + /* CPU_CLK_UNHALTED.REF */ + else if (ev == 0x0 && umask == 0x3 && ri != 2) return (EINVAL); + else + return (EINVAL); - flags = a->pm_md.pm_iaf.pm_iaf_flags; - - validflags = IAF_MASK; + flags = 0; + if (config & IAP_OS) + flags |= IAF_OS; + if (config & IAP_USR) + flags |= IAF_USR; + if (config & IAP_ANY) + flags |= IAF_ANY; + if (config & IAP_INT) + flags |= IAF_PMI; if (caps & PMC_CAP_INTERRUPT) flags |= IAF_PMI; Modified: head/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/dev/hwpmc/hwpmc_core.h Mon Jun 4 02:05:48 2018 (r334596) @@ -39,13 +39,6 @@ #define PERFCAP_SMM_FREEZE 0x1000 #define PERFCAP_FW_WRITE 0x2000 /* full width write aliases */ -/* - * Fixed-function PMCs. - */ -struct pmc_md_iaf_op_pmcallocate { - uint16_t pm_iaf_flags; /* additional flags */ -}; - #define IAF_OS 0x1 #define IAF_USR 0x2 #define IAF_ANY 0x4 Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon Jun 4 02:05:48 2018 (r334596) @@ -726,6 +726,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o sizeof(struct pmclog_initialize)); PMCLOG_EMIT32(PMC_VERSION); PMCLOG_EMIT32(md->pmd_cputype); + PMCLOG_EMITSTRING(pmc_cpuid, PMC_CPUID_LEN); PMCLOG_DESPATCH_SYNC(po); return (0); Modified: head/sys/i386/include/pmc_mdep.h ============================================================================== --- head/sys/i386/include/pmc_mdep.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/i386/include/pmc_mdep.h Mon Jun 4 02:05:48 2018 (r334596) @@ -79,7 +79,6 @@ struct pmc_mdep; union pmc_md_op_pmcallocate { struct pmc_md_amd_op_pmcallocate pm_amd; - struct pmc_md_iaf_op_pmcallocate pm_iaf; struct pmc_md_iap_op_pmcallocate pm_iap; struct pmc_md_ucf_op_pmcallocate pm_ucf; struct pmc_md_ucp_op_pmcallocate pm_ucp; Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/sys/pmc.h Mon Jun 4 02:05:48 2018 (r334596) @@ -61,13 +61,17 @@ * * The patch version is incremented for every bug fix. */ -#define PMC_VERSION_MAJOR 0x05 +#define PMC_VERSION_MAJOR 0x06 #define PMC_VERSION_MINOR 0x01 #define PMC_VERSION_PATCH 0x0000 #define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \ PMC_VERSION_MINOR << 16 | PMC_VERSION_PATCH) +#define PMC_CPUID_LEN 64 +/* cpu model name for pmu lookup */ +extern char pmc_cpuid[PMC_CPUID_LEN]; + /* * Kinds of CPUs known. * @@ -360,13 +364,13 @@ enum pmc_ops { * Flags used in operations on PMCs. */ -#define PMC_F_FORCE 0x00000001 /*OP ADMIN force operation */ +#define PMC_F_UNUSED1 0x00000001 /* unused */ #define PMC_F_DESCENDANTS 0x00000002 /*OP ALLOCATE track descendants */ #define PMC_F_LOG_PROCCSW 0x00000004 /*OP ALLOCATE track ctx switches */ #define PMC_F_LOG_PROCEXIT 0x00000008 /*OP ALLOCATE log proc exits */ #define PMC_F_NEWVALUE 0x00000010 /*OP RW write new value */ #define PMC_F_OLDVALUE 0x00000020 /*OP RW get old value */ -#define PMC_F_KGMON 0x00000040 /*OP ALLOCATE kgmon(8) profiling */ + /* V2 API */ #define PMC_F_CALLCHAIN 0x00000080 /*OP ALLOCATE capture callchains */ #define PMC_F_USERCALLCHAIN 0x00000100 /*OP ALLOCATE use userspace stack */ @@ -392,15 +396,15 @@ typedef uint64_t pmc_value_t; /* * PMC IDs have the following format: * - * +--------+----------+-----------+-----------+ - * | CPU | PMC MODE | PMC CLASS | ROW INDEX | - * +--------+----------+-----------+-----------+ + * +-----------------------+-------+-----------+ + * | CPU | PMC MODE | CLASS | ROW INDEX | + * +-----------------------+-------+-----------+ * - * where each field is 8 bits wide. Field 'CPU' is set to the - * requested CPU for system-wide PMCs or PMC_CPU_ANY for process-mode - * PMCs. Field 'PMC MODE' is the allocated PMC mode. Field 'PMC - * CLASS' is the class of the PMC. Field 'ROW INDEX' is the row index - * for the PMC. + * where CPU is 12 bits, MODE 8, CLASS 4, and ROW INDEX 8 Field 'CPU' + * is set to the requested CPU for system-wide PMCs or PMC_CPU_ANY for + * process-mode PMCs. Field 'PMC MODE' is the allocated PMC mode. + * Field 'PMC CLASS' is the class of the PMC. Field 'ROW INDEX' is the + * row index for the PMC. * * The 'ROW INDEX' ranges over 0..NWPMCS where NHWPMCS is the total * number of hardware PMCs on this cpu. @@ -408,12 +412,12 @@ typedef uint64_t pmc_value_t; #define PMC_ID_TO_ROWINDEX(ID) ((ID) & 0xFF) -#define PMC_ID_TO_CLASS(ID) (((ID) & 0xFF00) >> 8) -#define PMC_ID_TO_MODE(ID) (((ID) & 0xFF0000) >> 16) -#define PMC_ID_TO_CPU(ID) (((ID) & 0xFF000000) >> 24) +#define PMC_ID_TO_CLASS(ID) (((ID) & 0xF00) >> 8) +#define PMC_ID_TO_MODE(ID) (((ID) & 0xFF000) >> 12) +#define PMC_ID_TO_CPU(ID) (((ID) & 0xFFF00000) >> 20) #define PMC_ID_MAKE_ID(CPU,MODE,CLASS,ROWINDEX) \ - ((((CPU) & 0xFF) << 24) | (((MODE) & 0xFF) << 16) | \ - (((CLASS) & 0xFF) << 8) | ((ROWINDEX) & 0xFF)) + ((((CPU) & 0xFFF) << 20) | (((MODE) & 0xFF) << 12) | \ + (((CLASS) & 0xF) << 8) | ((ROWINDEX) & 0xFF)) /* * Data structures for system calls supported by the pmc driver. @@ -1064,9 +1068,6 @@ extern struct pmc_cpu **pmc_pcpu; /* driver statistics */ extern struct pmc_driverstats pmc_stats; - -/* cpu model name for pmu lookup */ -extern char pmc_cpuid[64]; #if defined(HWPMC_DEBUG) #include Modified: head/sys/sys/pmclog.h ============================================================================== --- head/sys/sys/pmclog.h Mon Jun 4 01:10:23 2018 (r334595) +++ head/sys/sys/pmclog.h Mon Jun 4 02:05:48 2018 (r334596) @@ -134,6 +134,7 @@ struct pmclog_initialize { uint32_t pl_version; /* driver version */ uint32_t pl_cpu; /* enum pmc_cputype */ uint32_t pl_pad; + char pl_cpuid[PMC_CPUID_LEN]; } __packed; struct pmclog_map_in { From owner-svn-src-head@freebsd.org Mon Jun 4 03:16:25 2018 Return-Path: Delivered-To: svn-src-head@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 20EAAFE5371; Mon, 4 Jun 2018 03:16:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C25F26D11B; Mon, 4 Jun 2018 03:16:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EFAE279EC; Mon, 4 Jun 2018 03:16:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w543GOoL010338; Mon, 4 Jun 2018 03:16:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w543GO4Y010337; Mon, 4 Jun 2018 03:16:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806040316.w543GO4Y010337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 4 Jun 2018 03:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334597 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 03:16:25 -0000 Author: eadler Date: Mon Jun 4 03:16:24 2018 New Revision: 334597 URL: https://svnweb.freebsd.org/changeset/base/334597 Log: top(1): Use strsep instead of homegrown alternative This replaces some complex, and not quite correct logic, with a more common strsep pattern. Reviewed by: mmacy (older version) Modified: head/usr.bin/top/utils.c head/usr.bin/top/utils.h Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Mon Jun 4 02:05:48 2018 (r334596) +++ head/usr.bin/top/utils.c Mon Jun 4 03:16:24 2018 (r334597) @@ -166,76 +166,23 @@ string_index(const char *string, const char * const *a */ const char * const * -argparse(const char *line, int *cntp) +argparse(char *line, int *cntp) { - const char *from; - char *to; - int cnt; - int ch; - int length; - int lastch; - char **argv; - const char * const *argarray; - char *args; + const char **ap; + static const char *argv[1024] = {0}; - /* unfortunately, the only real way to do this is to go thru the - input string twice. */ - - /* step thru the string counting the white space sections */ - from = line; - lastch = cnt = length = 0; - while ((ch = *from++) != '\0') - { - length++; - if (ch == ' ' && lastch != ' ') - { - cnt++; - } - lastch = ch; + *cntp = 1; + ap = &argv[1]; + while ((*ap = strsep(&line, " ")) != NULL) { + if (**ap != '\0') { + (*cntp)++; + if (*cntp >= (int)nitems(argv)) { + break; + } + ap++; + } } - - /* add three to the count: one for the initial "dummy" argument, - one for the last argument and one for NULL */ - cnt += 3; - - /* allocate a char * array to hold the pointers */ - argarray = calloc(cnt, sizeof(char *)); - - /* allocate another array to hold the strings themselves */ - args = calloc(length+2, 1); - - /* initialization for main loop */ - from = line; - to = args; - argv = argarray; - lastch = '\0'; - - /* create a dummy argument to keep getopt happy */ - *argv++ = to; - *to++ = '\0'; - cnt = 2; - - /* now build argv while copying characters */ - *argv++ = to; - while ((ch = *from++) != '\0') - { - if (ch != ' ') - { - if (lastch == ' ') - { - *to++ = '\0'; - *argv++ = to; - cnt++; - } - *to++ = ch; - } - lastch = ch; - } - *to++ = '\0'; - - /* set cntp and return the allocated array */ - *cntp = cnt; - return(argarray); + return argv; } /* Modified: head/usr.bin/top/utils.h ============================================================================== --- head/usr.bin/top/utils.h Mon Jun 4 02:05:48 2018 (r334596) +++ head/usr.bin/top/utils.h Mon Jun 4 03:16:24 2018 (r334597) @@ -16,7 +16,7 @@ int atoiwi(const char *); char *itoa(unsigned int); char *itoa7(int); int digits(int); -const char * const *argparse(const char *, int *); +const char * const *argparse(char *, int *); long percentages(int, int *, long *, long *, long *); char *format_time(long); char *format_k(int); From owner-svn-src-head@freebsd.org Mon Jun 4 04:49:07 2018 Return-Path: Delivered-To: svn-src-head@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 27336FEF1EB; Mon, 4 Jun 2018 04:49:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB6F070716; Mon, 4 Jun 2018 04:49:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD57F8D7; Mon, 4 Jun 2018 04:49:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w544n6WD054853; Mon, 4 Jun 2018 04:49:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w544n6Kc054852; Mon, 4 Jun 2018 04:49:06 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040449.w544n6Kc054852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 04:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334598 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 04:49:07 -0000 Author: mmacy Date: Mon Jun 4 04:49:06 2018 New Revision: 334598 URL: https://svnweb.freebsd.org/changeset/base/334598 Log: hwpmc: fix fixed counters checks Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Mon Jun 4 03:16:24 2018 (r334597) +++ head/sys/dev/hwpmc/hwpmc_core.c Mon Jun 4 04:49:06 2018 (r334598) @@ -251,13 +251,12 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if (ev == 0xC0 && ri != 0) return (EINVAL); /* CPU_CLK_UNHALTED.THREAD */ - else if (ev == 0x3C && ri != 1) + if (ev == 0x3C && ri != 1) return (EINVAL); /* CPU_CLK_UNHALTED.REF */ - else if (ev == 0x0 && umask == 0x3 && ri != 2) + if (ev == 0x0 && umask == 0x3 && ri != 2) return (EINVAL); - else - return (EINVAL); + flags = 0; if (config & IAP_OS) From owner-svn-src-head@freebsd.org Mon Jun 4 04:56:02 2018 Return-Path: Delivered-To: svn-src-head@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 228FFFEFDD8; Mon, 4 Jun 2018 04:56:02 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2E970D2A; Mon, 4 Jun 2018 04:56:01 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w544trUW030384 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Jun 2018 06:55:54 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: rgrimes@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w544tiAm075530 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 4 Jun 2018 11:55:44 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334543 - head/usr.bin/top To: rgrimes@freebsd.org, Warner Losh References: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B14C64B.2070602@grosbein.net> Date: Mon, 4 Jun 2018 11:55:39 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 04:56:02 -0000 04.06.2018 4:33, Rodney W. Grimes wrote: >>>> Bad side effect of doing that is it is not hard to get a "core" >>>> from top when run as a user, as it is going to try to write >>>> to /, and it probably does not have permission for that. We already have global sysctl kern.corefile that can be changed to /var/tmp/%N.core Perhaps, a kernel could take a look to process environment to something like KERN_COREFILE variable for an override of that sysctl? From owner-svn-src-head@freebsd.org Mon Jun 4 04:59:26 2018 Return-Path: Delivered-To: svn-src-head@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 E42B9FF0336; Mon, 4 Jun 2018 04:59:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9346470F58; Mon, 4 Jun 2018 04:59:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68EF5A6C; Mon, 4 Jun 2018 04:59:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w544xPRU059995; Mon, 4 Jun 2018 04:59:25 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w544xPVa059994; Mon, 4 Jun 2018 04:59:25 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806040459.w544xPVa059994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 4 Jun 2018 04:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334599 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 04:59:26 -0000 Author: eadler Date: Mon Jun 4 04:59:24 2018 New Revision: 334599 URL: https://svnweb.freebsd.org/changeset/base/334599 Log: top(1): Prefer memcpy over bcopy Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jun 4 04:49:06 2018 (r334598) +++ head/usr.bin/top/machine.c Mon Jun 4 04:59:24 2018 (r334599) @@ -790,7 +790,7 @@ get_process_info(struct system_info *si, struct proces if (nproc) { for (i = 0; i < nproc; i++) previous_pref[i] = &previous_procs[i]; - bcopy(pbase, previous_procs, nproc * sizeof(*previous_procs)); + memcpy(previous_procs, pbase, nproc * sizeof(*previous_procs)); qsort(previous_pref, nproc, sizeof(*previous_pref), ps.thread ? compare_tid : compare_pid); } From owner-svn-src-head@freebsd.org Mon Jun 4 04:59:34 2018 Return-Path: Delivered-To: svn-src-head@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 7DA8EFF038F; Mon, 4 Jun 2018 04:59:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 335FE71048; Mon, 4 Jun 2018 04:59:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14FB6A6D; Mon, 4 Jun 2018 04:59:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w544xXM0060049; Mon, 4 Jun 2018 04:59:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w544xWgB060042; Mon, 4 Jun 2018 04:59:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806040459.w544xWgB060042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 4 Jun 2018 04:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334600 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 04:59:34 -0000 Author: eadler Date: Mon Jun 4 04:59:32 2018 New Revision: 334600 URL: https://svnweb.freebsd.org/changeset/base/334600 Log: top(1): include what you use - Change headers to more closely match what we use - use more standard functions instead of bzero, bcmp, bcopy - Add myself to authors. Tested with: base clang (amd64), gcc 9 (amd64), base clang (i386), base gcc (mips) Modified: head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/username.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/commands.c Mon Jun 4 04:59:32 2018 (r334600) @@ -18,6 +18,7 @@ */ #include +#include #include #include Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/display.c Mon Jun 4 04:59:32 2018 (r334600) @@ -28,17 +28,17 @@ * *_process, u_endscreen. */ +#include #include #include #include -#include #include #include #include #include +#include #include -#include #include #include #include @@ -823,7 +823,7 @@ i_process(int line, char *thisline) p = stpcpy(base, thisline); /* zero fill the rest of it */ - bzero(p, display_width - (p - base)); + memset(p, 0, display_width - (p - base)); } void @@ -862,7 +862,7 @@ u_process(int line, char *newline) optr = stpcpy(bufferline, newline); /* zero fill the rest of it */ - bzero(optr, display_width - (optr - bufferline)); + memset(optr, 0, display_width - (optr - bufferline)); } else { @@ -1236,7 +1236,7 @@ line_update(char *old, char *new, int start, int line) diff = display_width - newcol; if (diff > 0) { - bzero(old, diff); + memset(old, 0, diff); } /* remember where the current line is */ Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/display.h Mon Jun 4 04:59:32 2018 (r334600) @@ -4,7 +4,8 @@ #define MT_standout 1 #define MT_delayed 2 -#include "machine.h" +#include +struct statics; int display_updatecpus(struct statics *statics); void clear_message(void); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/machine.c Mon Jun 4 04:59:32 2018 (r334600) @@ -8,37 +8,35 @@ * by Monte Mitzelfelt (for latest top see http://www.groupsys.com/topinfo/) * * AUTHOR: Christos Zoulas - * Steven Wallace + * Steven Wallace * Wolfram Schneider * Thomas Moestl + * Eitan Adler * * $FreeBSD$ */ #include -#include +#include #include +#include #include #include -#include -#include #include #include #include -#include #include #include #include #include -#include #include -#include #include #include +#include #include #include -#include +#include #include #include @@ -86,8 +84,6 @@ struct handle { #define PCTCPU(pp) (pcpu[pp - pbase]) -/* definitions for indices in the nlist array */ - /* * These definitions control the format of the per-process area */ @@ -647,7 +643,7 @@ get_old_proc(struct kinfo_proc *pp) return (NULL); } oldp = *oldpp; - if (bcmp(&oldp->ki_start, &pp->ki_start, sizeof(pp->ki_start)) != 0) { + if (memcmp(&oldp->ki_start, &pp->ki_start, sizeof(pp->ki_start)) != 0) { pp->ki_udata = NOPROC; return (NULL); } @@ -669,7 +665,7 @@ get_io_stats(const struct kinfo_proc *pp, long *inp, l oldp = get_old_proc(pp); if (oldp == NULL) { - bzero(&dummy, sizeof(dummy)); + memset(&dummy, 0, sizeof(dummy)); oldp = &dummy; } *inp = RU(pp)->ru_inblock - RU(oldp)->ru_inblock; Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/machine.h Mon Jun 4 04:59:32 2018 (r334600) @@ -10,6 +10,9 @@ #ifndef MACHINE_H #define MACHINE_H +#include +#include + #define NUM_AVERAGES 3 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/top.c Mon Jun 4 04:59:32 2018 (r334600) @@ -13,15 +13,17 @@ */ #include -#include -#include #include +#include +#include +#include +#include +#include -#include -#include #include #include -#include +#include +#include #include #include #include Modified: head/usr.bin/top/username.c ============================================================================== --- head/usr.bin/top/username.c Mon Jun 4 04:59:24 2018 (r334599) +++ head/usr.bin/top/username.c Mon Jun 4 04:59:32 2018 (r334600) @@ -30,7 +30,6 @@ */ #include -#include #include #include From owner-svn-src-head@freebsd.org Mon Jun 4 04:59:51 2018 Return-Path: Delivered-To: svn-src-head@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 DBF2DFF042D; Mon, 4 Jun 2018 04:59:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89ECE71172; Mon, 4 Jun 2018 04:59:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AF0AA6E; Mon, 4 Jun 2018 04:59:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w544xofE060109; Mon, 4 Jun 2018 04:59:50 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w544xmui060101; Mon, 4 Jun 2018 04:59:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040459.w544xmui060101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 04:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334601 - in head: lib/libpmc usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmc usr.sbin/pmc X-SVN-Commit-Revision: 334601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 04:59:51 -0000 Author: mmacy Date: Mon Jun 4 04:59:48 2018 New Revision: 334601 URL: https://svnweb.freebsd.org/changeset/base/334601 Log: pmc: add filter command pmc filter allows the user to select event types, threads, and processes from a sample. % pmcstat -S unhalted_core_cycles -S llc-misses -S -S resource_stalls.any -O pmc.log % pmc filter -e llc-misses pmc.log pmc-llc-misses.log % pmc filter -e unhalted_core_cycles -t 100339 pmc.log pmc-core-cycles.log etc... % pmcstat -R pmc-core-cycles.log -G pmc-core-cycles.stacks Added: head/usr.sbin/pmc/cmd_pmc_filter.c (contents, props changed) Modified: head/lib/libpmc/libpmc_pmu_util.c (contents, props changed) head/lib/libpmc/pmc.h head/lib/libpmc/pmclog.c head/lib/libpmc/pmclog.h head/usr.sbin/pmc/Makefile (contents, props changed) head/usr.sbin/pmc/cmd_pmc.h (contents, props changed) head/usr.sbin/pmc/pmc.c (contents, props changed) Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 04:59:32 2018 (r334600) +++ head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 04:59:48 2018 (r334601) @@ -62,8 +62,8 @@ static struct pmu_alias pmu_alias_table[] = { {"BRANCH-MISSES-RETIRED", "BR_MISP_RETIRED.ALL_BRANCHES"}, {"cycles", "tsc-tsc"}, {"instructions", "inst-retired.any_p"}, - {"branch-mispredicts", "br_misp_retired.all_branches" }, - {"branches", "br_inst_retired.all_branches" }, + {"branch-mispredicts", "br_misp_retired.all_branches"}, + {"branches", "br_inst_retired.all_branches"}, {"interrupts", "hw_interrupts.received"}, {"ic-misses", "frontend_retired.l1i_miss"}, {NULL, NULL}, @@ -106,18 +106,22 @@ struct pmu_event_desc { }; static const struct pmu_events_map * -pmu_events_map_get(void) +pmu_events_map_get(const char *cpuid) { size_t s; char buf[64]; const struct pmu_events_map *pme; - if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, - (void *)NULL, 0) == -1) - return (NULL); - if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, - (void *)NULL, 0) == -1) - return (NULL); + if (cpuid != NULL) { + memcpy(buf, cpuid, 64); + } else { + if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, + (void *)NULL, 0) == -1) + return (NULL); + if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, + (void *)NULL, 0) == -1) + return (NULL); + } for (pme = pmu_events_map; pme->cpuid != NULL; pme++) if (strcmp(buf, pme->cpuid) == 0) return (pme); @@ -125,13 +129,13 @@ pmu_events_map_get(void) } static const struct pmu_event * -pmu_event_get(const char *event_name, int *idx) +pmu_event_get(const char *cpuid, const char *event_name, int *idx) { const struct pmu_events_map *pme; const struct pmu_event *pe; int i; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(cpuid)) == NULL) return (NULL); for (i = 0, pe = pme->table; pe->name || pe->desc || pe->event; pe++, i++) { if (pe->name == NULL) @@ -145,6 +149,18 @@ pmu_event_get(const char *event_name, int *idx) return (NULL); } +int +pmc_pmu_idx_get_by_event(const char *cpuid, const char *event) +{ + int idx; + const char *realname; + + realname = pmu_alias_get(event); + if (pmu_event_get(cpuid, realname, &idx) == NULL) + return (-1); + return (idx); +} + const char * pmc_pmu_event_get_by_idx(int idx) { @@ -152,7 +168,7 @@ pmc_pmu_event_get_by_idx(int idx) const struct pmu_event *pe; int i; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(NULL)) == NULL) return (NULL); for (i = 0, pe = pme->table; (pe->name || pe->desc || pe->event) && i < idx; pe++, i++); return (pe->name); @@ -218,9 +234,9 @@ pmc_pmu_sample_rate_get(const char *event_name) struct pmu_event_desc ped; event_name = pmu_alias_get(event_name); - if ((pe = pmu_event_get(event_name, NULL)) == NULL) + if ((pe = pmu_event_get(NULL, event_name, NULL)) == NULL) return (DEFAULT_SAMPLE_COUNT); - if (pe->alias && (pe = pmu_event_get(pe->alias, NULL)) == NULL) + if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, NULL)) == NULL) return (DEFAULT_SAMPLE_COUNT); if (pe->event == NULL) return (DEFAULT_SAMPLE_COUNT); @@ -233,7 +249,7 @@ int pmc_pmu_enabled(void) { - return (pmu_events_map_get() != NULL); + return (pmu_events_map_get(NULL) != NULL); } void @@ -250,7 +266,7 @@ pmc_pmu_print_counters(const char *event_name) if (debug != NULL && strcmp(debug, "true") == 0) do_debug = 1; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(NULL)) == NULL) return; for (pe = pme->table; pe->name || pe->desc || pe->event; pe++) { if (pe->name == NULL) @@ -269,7 +285,7 @@ pmc_pmu_print_counter_desc(const char *ev) const struct pmu_events_map *pme; const struct pmu_event *pe; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(NULL)) == NULL) return; for (pe = pme->table; pe->name || pe->desc || pe->event; pe++) { if (pe->name == NULL) @@ -286,7 +302,7 @@ pmc_pmu_print_counter_desc_long(const char *ev) const struct pmu_events_map *pme; const struct pmu_event *pe; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(NULL)) == NULL) return; for (pe = pme->table; pe->name || pe->desc || pe->event; pe++) { if (pe->name == NULL) @@ -306,7 +322,7 @@ pmc_pmu_print_counter_full(const char *ev) const struct pmu_events_map *pme; const struct pmu_event *pe; - if ((pme = pmu_events_map_get()) == NULL) + if ((pme = pmu_events_map_get(NULL)) == NULL) return; for (pe = pme->table; pe->name || pe->desc || pe->event; pe++) { if (pe->name == NULL) @@ -350,9 +366,9 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc bzero(iap, sizeof(*iap)); event_name = pmu_alias_get(event_name); pm->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); - if ((pe = pmu_event_get(event_name, &idx)) == NULL) + if ((pe = pmu_event_get(NULL, event_name, &idx)) == NULL) return (ENOENT); - if (pe->alias && (pe = pmu_event_get(pe->alias, &idx)) == NULL) + if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, &idx)) == NULL) return (ENOENT); if (pe->event == NULL) return (ENOENT); @@ -361,11 +377,11 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc if (strcasestr(event_name, "UNC_") == event_name || - strcasestr(event_name, "uncore") != NULL) { + strcasestr(event_name, "uncore") != NULL) { pm->pm_class = PMC_CLASS_UCP; pm->pm_caps |= PMC_CAP_QUALIFIER; } else if ((ped.ped_umask == -1) || - (ped.ped_event == 0x0 && ped.ped_umask == 0x3)) { + (ped.ped_event == 0x0 && ped.ped_umask == 0x3)) { pm->pm_class = PMC_CLASS_IAF; } else { pm->pm_class = PMC_CLASS_IAP; @@ -458,10 +474,17 @@ pmc_pmu_event_get_by_idx(int idx __unused) { return (NULL); } + int pmc_pmu_stat_mode(const char ***a __unused) { return (EOPNOTSUPP); +} + +int +pmc_pmu_idx_get_by_event(const char *e __unused) +{ + return (-1); } #endif Modified: head/lib/libpmc/pmc.h ============================================================================== --- head/lib/libpmc/pmc.h Mon Jun 4 04:59:32 2018 (r334600) +++ head/lib/libpmc/pmc.h Mon Jun 4 04:59:48 2018 (r334601) @@ -121,6 +121,7 @@ void pmc_pmu_print_counter_full(const char *); uint64_t pmc_pmu_sample_rate_get(const char *); int pmc_pmu_pmcallocate(const char *, struct pmc_op_pmcallocate *); const char *pmc_pmu_event_get_by_idx(int idx); +int pmc_pmu_idx_get_by_event(const char*, const char *); int pmc_pmu_stat_mode(const char ***); __END_DECLS Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Mon Jun 4 04:59:32 2018 (r334600) +++ head/lib/libpmc/pmclog.c Mon Jun 4 04:59:48 2018 (r334601) @@ -78,28 +78,6 @@ __FBSDID("$FreeBSD$"); * performance critical paths. */ -enum pmclog_parser_state { - PL_STATE_NEW_RECORD, /* in-between records */ - PL_STATE_EXPECTING_HEADER, /* header being read */ - PL_STATE_PARTIAL_RECORD, /* header present but not the record */ - PL_STATE_ERROR /* parsing error encountered */ -}; - -struct pmclog_parse_state { - enum pmclog_parser_state ps_state; - enum pmc_cputype ps_arch; /* log file architecture */ - uint32_t ps_version; /* hwpmc version */ - int ps_initialized; /* whether initialized */ - int ps_count; /* count of records processed */ - off_t ps_offset; /* stream byte offset */ - union pmclog_entry ps_saved; /* saved partial log entry */ - int ps_svcount; /* #bytes saved */ - int ps_fd; /* active fd or -1 */ - char *ps_buffer; /* scratch buffer if fd != -1 */ - char *ps_data; /* current parse pointer */ - size_t ps_len; /* length of buffered data */ -}; - #define PMCLOG_HEADER_FROM_SAVED_STATE(PS) \ (* ((uint32_t *) &(PS)->ps_saved)) @@ -299,7 +277,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l } PMCLOG_INITIALIZE_READER(le, ps->ps_saved); - + ev->pl_data = le; PMCLOG_READ32(le,h); if (!PMCLOG_HEADER_CHECK_MAGIC(h)) { @@ -348,8 +326,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_INITIALIZE: PMCLOG_READ32(le,ev->pl_u.pl_i.pl_version); PMCLOG_READ32(le,ev->pl_u.pl_i.pl_arch); - PMCLOG_READ32(le, noop); PMCLOG_READSTRING(le, ev->pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); + memcpy(ev->pl_u.pl_i.pl_cpuid, le, PMC_CPUID_LEN); ps->ps_version = ev->pl_u.pl_i.pl_version; ps->ps_arch = ev->pl_u.pl_i.pl_arch; ps->ps_initialized = 1; @@ -434,6 +412,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l ev->pl_offset = (ps->ps_offset += evlen); ev->pl_count = (ps->ps_count += 1); + ev->pl_len = evlen; ev->pl_state = PMCLOG_OK; return 0; Modified: head/lib/libpmc/pmclog.h ============================================================================== --- head/lib/libpmc/pmclog.h Mon Jun 4 04:59:32 2018 (r334600) +++ head/lib/libpmc/pmclog.h Mon Jun 4 04:59:48 2018 (r334601) @@ -152,6 +152,8 @@ struct pmclog_ev { size_t pl_count; /* count of records so far */ struct timespec pl_ts; /* log entry timestamp */ enum pmclog_type pl_type; /* type of log entry */ + void *pl_data; + int pl_len; union { /* log entry data */ struct pmclog_ev_callchain pl_cc; struct pmclog_ev_closelog pl_cl; @@ -170,6 +172,28 @@ struct pmclog_ev { struct pmclog_ev_sysexit pl_se; struct pmclog_ev_userdata pl_u; } pl_u; +}; + +enum pmclog_parser_state { + PL_STATE_NEW_RECORD, /* in-between records */ + PL_STATE_EXPECTING_HEADER, /* header being read */ + PL_STATE_PARTIAL_RECORD, /* header present but not the record */ + PL_STATE_ERROR /* parsing error encountered */ +}; + +struct pmclog_parse_state { + enum pmclog_parser_state ps_state; + enum pmc_cputype ps_arch; /* log file architecture */ + uint32_t ps_version; /* hwpmc version */ + int ps_initialized; /* whether initialized */ + int ps_count; /* count of records processed */ + off_t ps_offset; /* stream byte offset */ + union pmclog_entry ps_saved; /* saved partial log entry */ + int ps_svcount; /* #bytes saved */ + int ps_fd; /* active fd or -1 */ + char *ps_buffer; /* scratch buffer if fd != -1 */ + char *ps_data; /* current parse pointer */ + size_t ps_len; /* length of buffered data */ }; #define PMCLOG_FD_NONE (-1) Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Mon Jun 4 04:59:32 2018 (r334600) +++ head/usr.sbin/pmc/Makefile Mon Jun 4 04:59:48 2018 (r334601) @@ -8,6 +8,6 @@ MAN= LIBADD= kvm pmc m ncursesw pmcstat elf SRCS= pmc.c pmc_util.c cmd_pmc_stat.c \ - cmd_pmc_list.c + cmd_pmc_list.c cmd_pmc_filter.c .include Modified: head/usr.sbin/pmc/cmd_pmc.h ============================================================================== --- head/usr.sbin/pmc/cmd_pmc.h Mon Jun 4 04:59:32 2018 (r334600) +++ head/usr.sbin/pmc/cmd_pmc.h Mon Jun 4 04:59:48 2018 (r334601) @@ -41,6 +41,7 @@ extern struct pmcstat_args pmc_args; typedef int (*cmd_disp_t)(int, char **); int cmd_pmc_stat(int, char **); +int cmd_pmc_filter(int, char **); int cmd_pmc_stat_system(int, char **); int cmd_pmc_list_events(int, char **); Added: head/usr.sbin/pmc/cmd_pmc_filter.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 04:59:48 2018 (r334601) @@ -0,0 +1,269 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "cmd_pmc.h" + +#define LIST_MAX 64 +static struct option longopts[] = { + {"threads", no_argument, NULL, 't'}, + {"pids", no_argument, NULL, 'p'}, + {"events", no_argument, NULL, 'e'}, + {NULL, 0, NULL, 0} +}; + +static void +usage(void) +{ + errx(EX_USAGE, + "\t filter log file\n" + "\t -t , --threads -- comma-delimited list of lwps to filter on\n" + "\t -p , --pids -- comma-delimited list of pids to filter on\n" + "\t -e , --events -- comma-delimited list of events to filter on\n" + ); +} + + +static void +parse_intlist(char *strlist, int *intlist, int *pcount, int (*fn) (const char *)) +{ + char *token; + int count, tokenval; + + count = 0; + while ((token = strsep(&strlist, ",")) != NULL && + count < LIST_MAX) { + if ((tokenval = fn(token)) < 0) + errx(EX_USAGE, "ERROR: %s not usable value", token); + intlist[count++] = tokenval; + } + *pcount = count; +} + +static void +parse_events(char *strlist, int *intlist, int *pcount, char *cpuid) +{ + char *token; + int count, tokenval; + + count = 0; + while ((token = strsep(&strlist, ",")) != NULL && + count < LIST_MAX) { + if ((tokenval = pmc_pmu_idx_get_by_event(cpuid, token)) < 0) + errx(EX_USAGE, "ERROR: %s not usable value", token); + intlist[count++] = tokenval; + } + *pcount = count; +} + +struct pmcid_ent { + uint32_t pe_pmcid; + uint32_t pe_idx; +}; +#define _PMCLOG_TO_HEADER(T,L) \ + ((PMCLOG_HEADER_MAGIC << 24) | \ + (PMCLOG_TYPE_ ## T << 16) | \ + ((L) & 0xFFFF)) + +static void +pmc_filter_handler(uint32_t *lwplist, int lwpcount, uint32_t *pidlist, int pidcount, + char *events, int infd, int outfd) +{ + struct pmclog_ev ev; + struct pmclog_parse_state *ps; + struct pmcid_ent *pe; + uint32_t eventlist[LIST_MAX]; + char cpuid[PMC_CPUID_LEN]; + int i, pmccount, copies, eventcount; + uint32_t idx, h; + off_t dstoff; + + if ((ps = pmclog_open(infd)) == NULL) + errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); + + pmccount = 0; + while (pmclog_read(ps, &ev) == 0) { + if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) + memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); + if (ev.pl_type == PMCLOG_TYPE_PMCALLOCATE) + pmccount++; + } + if (events) + parse_events(events, eventlist, &eventcount, cpuid); + + lseek(infd, 0, SEEK_SET); + pmclog_close(ps); + if ((ps = pmclog_open(infd)) == NULL) + errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); + if ((pe = malloc(sizeof(*pe) * pmccount)) == NULL) + errx(EX_OSERR, "ERROR: failed to allocate pmcid map"); + i = 0; + while (pmclog_read(ps, &ev) == 0 && i < pmccount) { + if (ev.pl_type == PMCLOG_TYPE_PMCALLOCATE) { + pe[i].pe_pmcid = ev.pl_u.pl_a.pl_pmcid; + pe[i].pe_idx = ev.pl_u.pl_a.pl_event; + i++; + } + } + lseek(infd, 0, SEEK_SET); + pmclog_close(ps); + if ((ps = pmclog_open(infd)) == NULL) + errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); + dstoff = copies = 0; + while (pmclog_read(ps, &ev) == 0) { + dstoff += ev.pl_len; + h = *(uint32_t *)ev.pl_data; + if (ev.pl_type != PMCLOG_TYPE_CALLCHAIN) { + if (write(outfd, ev.pl_data, ev.pl_len) != (ssize_t)ev.pl_len) + errx(EX_OSERR, "ERROR: failed output write"); + continue; + } + if (pidcount) { + for (i = 0; i < pidcount; i++) + if (pidlist[i] == ev.pl_u.pl_cc.pl_pid) + break; + if (i == pidcount) + continue; + } + if (lwpcount) { + for (i = 0; i < lwpcount; i++) + if (lwplist[i] == ev.pl_u.pl_cc.pl_tid) + break; + if (i == lwpcount) + continue; + } + if (eventcount) { + for (i = 0; i < pmccount; i++) { + if (pe[i].pe_pmcid == ev.pl_u.pl_cc.pl_pmcid) + break; + } + if (i == pmccount) + errx(EX_USAGE, "ERROR: unallocated pmcid: %d\n", + ev.pl_u.pl_cc.pl_pmcid); + + idx = pe[i].pe_idx; + for (i = 0; i < eventcount; i++) { + if (idx == eventlist[i]) + break; + } + if (i == eventcount) + continue; + } + if (write(outfd, ev.pl_data, ev.pl_len) != (ssize_t)ev.pl_len) + errx(EX_OSERR, "ERROR: failed output write"); + } +} + +int +cmd_pmc_filter(int argc, char **argv) +{ + char *lwps, *pids, *events; + uint32_t lwplist[LIST_MAX]; + uint32_t pidlist[LIST_MAX]; + int option, lwpcount, pidcount; + int prelogfd, postlogfd; + + lwps = pids = events = NULL; + lwpcount = pidcount = 0; + while ((option = getopt_long(argc, argv, "t:p:e:", longopts, NULL)) != -1) { + switch (option) { + case 't': + lwps = strdup(optarg); + break; + case 'p': + pids = strdup(optarg); + break; + case 'e': + events = strdup(optarg); + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (argc != 2) + usage(); + + if (lwps) + parse_intlist(lwps, lwplist, &lwpcount, atoi); + if (pids) + parse_intlist(pids, pidlist, &pidcount, atoi); + if ((prelogfd = open(argv[0], O_RDONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) + errx(EX_OSERR, "ERROR: Cannot open \"%s\" for reading: %s.", argv[0], + strerror(errno)); + if ((postlogfd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) + errx(EX_OSERR, "ERROR: Cannot open \"%s\" for writing: %s.", argv[1], + strerror(errno)); + + pmc_filter_handler(lwplist, lwpcount, pidlist, pidcount, events, + prelogfd, postlogfd); + return (0); +} Modified: head/usr.sbin/pmc/pmc.c ============================================================================== --- head/usr.sbin/pmc/pmc.c Mon Jun 4 04:59:32 2018 (r334600) +++ head/usr.sbin/pmc/pmc.c Mon Jun 4 04:59:48 2018 (r334601) @@ -65,6 +65,7 @@ static struct cmd_handler disp_table[] = { {"stat", cmd_pmc_stat}, {"stat-system", cmd_pmc_stat_system}, {"list-events", cmd_pmc_list_events}, + {"filter", cmd_pmc_filter}, {NULL, NULL} }; @@ -76,6 +77,7 @@ usage(void) "\t stat run program and print stats\n" "\t stat-system run program and print system wide stats for duration of execution\n" "\t list-events list PMC events available on host\n" + "\t filter filter records by lwp, pid, or event\n" ); } From owner-svn-src-head@freebsd.org Mon Jun 4 05:03:09 2018 Return-Path: Delivered-To: svn-src-head@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 B621BFF0BAB; Mon, 4 Jun 2018 05:03:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mx2.catspoiler.org (mx2.catspoiler.org [IPv6:2607:f740:16::d18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "amnesiac", Issuer "amnesiac" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC7671733; Mon, 4 Jun 2018 05:03:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org ([76.212.85.177]) by mx2.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w5454tFi002933 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Jun 2018 05:04:56 GMT (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTPS id w54530Me094290 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Jun 2018 22:03:01 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Date: Sun, 3 Jun 2018 22:02:55 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r334543 - head/usr.bin/top To: rgrimes@freebsd.org cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201806022356.w52NuiFK088665@pdx.rh.CN85.dnsmgr.net> Message-ID: References: <201806022206.w52M6S98020830@repo.freebsd.org> <201806022356.w52NuiFK088665@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:03:09 -0000 On 2 Jun, Rodney W. Grimes wrote: >> Author: eadler >> Date: Sat Jun 2 22:06:27 2018 >> New Revision: 334543 >> URL: https://svnweb.freebsd.org/changeset/base/334543 >> >> Log: >> top(1): chdir to / as init; remove unneeded comment >> >> - chdir to / to allow unmounting of wd >> - remove warning about running top(1) as setuid. If this is a concern we >> should just drop privs instead. >> >> Modified: >> head/usr.bin/top/machine.c >> head/usr.bin/top/top.c >> >> Modified: head/usr.bin/top/machine.c >> ============================================================================== >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 (r334542) >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 (r334543) >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) >> /* >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 if >> * the process does not exist. >> - * It is EXTREMELY IMPORTANT that this function work correctly. >> - * If top runs setuid root (as in SVR4), then this function >> - * is the only thing that stands in the way of a serious >> - * security problem. It validates requests for the "kill" >> - * and "renice" commands. >> */ >> >> int >> >> Modified: head/usr.bin/top/top.c >> ============================================================================== >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) >> #define CMD_order 26 >> #define CMD_pid 27 >> >> + /* >> + * Since top(1) is often long running and >> + * doesn't typically care about where its running from >> + * chdir to the root to allow unmounting of its >> + * originall wd. Failure is alright as this is >> + * just a courtesy for users. >> + */ >> + chdir("/"); >> + > > Bad side effect of doing that is it is not hard to get a "core" > from top when run as a user, as it is going to try to write > to /, and it probably does not have permission for that. > > Better might be a cd to /tmp, or /var/tmp, which are usually > hard to unmount for these reasons anyway. Unless you start top using the exec shell builtin, the shell that you use to launch top will also be long running and will also prevent its $cwd from being unmounted. If you do use exec, then you will get logged out when you kill top ... From owner-svn-src-head@freebsd.org Mon Jun 4 05:04:41 2018 Return-Path: Delivered-To: svn-src-head@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 61846FF0E39; Mon, 4 Jun 2018 05:04:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17951718E1; Mon, 4 Jun 2018 05:04:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8886C14; Mon, 4 Jun 2018 05:04:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5454eSL065282; Mon, 4 Jun 2018 05:04:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5454eXM065281; Mon, 4 Jun 2018 05:04:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040504.w5454eXM065281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 05:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334602 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 334602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:04:41 -0000 Author: mmacy Date: Mon Jun 4 05:04:40 2018 New Revision: 334602 URL: https://svnweb.freebsd.org/changeset/base/334602 Log: update pmc_pmu_idx_get_by_event signature for !x86 Modified: head/lib/libpmc/libpmc_pmu_util.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 04:59:48 2018 (r334601) +++ head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 05:04:40 2018 (r334602) @@ -482,7 +482,7 @@ pmc_pmu_stat_mode(const char ***a __unused) } int -pmc_pmu_idx_get_by_event(const char *e __unused) +pmc_pmu_idx_get_by_event(const char *c __unused, const char *e __unused) { return (-1); } From owner-svn-src-head@freebsd.org Mon Jun 4 05:08:06 2018 Return-Path: Delivered-To: svn-src-head@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 3643DFF1425; Mon, 4 Jun 2018 05:08:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3653071B31; Mon, 4 Jun 2018 05:08:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id PhijfPEJSvB5RPhikfXdWG; Sun, 03 Jun 2018 23:07:58 -0600 X-Authority-Analysis: v=2.3 cv=PvS9kTE3 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=H0GPC0OhAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=lpi2_8yQhKmOCeYvemIA:9 a=CjuIK1q_8ugA:10 a=KczGKrPSgCPlefTG41c3:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 29F8D3310; Sun, 3 Jun 2018 22:07:53 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w5457qcR007221; Sun, 3 Jun 2018 22:07:52 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w5457q5v007218; Sun, 3 Jun 2018 22:07:52 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806040507.w5457q5v007218@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Eugene Grosbein cc: rgrimes@freebsd.org, Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334543 - head/usr.bin/top In-Reply-To: Message from Eugene Grosbein of "Mon, 04 Jun 2018 11:55:39 +0700." <5B14C64B.2070602@grosbein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Jun 2018 22:07:52 -0700 X-CMAE-Envelope: MS4wfLRlzWmFAbag00YS92YYNxQOZ9H3w+2Mso/mRjsIIjBgazIdKF450mEaF83p5L/j8fo15+nox29TcKhKvppkP18mk9CzRaWuvpTffSQjxj1yO2GoXBVS pXhfVm1xy6O3QXPMaXGd2xNQpd5PbRzC3I6Hps1zTIK9SOsLb5U+CQ97Ds8QuekP7PeFlvMidMwLfX/5cwXT/Utu12m6BR9uEdSiZlj9Pi2AOkyxxaTzvTbR cPbSmmgyyL0YlAi9rWsD/MaDpHZvoXPOdCud1aF11mvIGHrseEOB8ioWoQwMij+730sJPI97q3PyoGGwEUBBbdS9bYYHtYdTWZT7rXP2ji36bUjDJZ9toY5q xtI/2AUx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:08:06 -0000 In message <5B14C64B.2070602@grosbein.net>, Eugene Grosbein writes: > 04.06.2018 4:33, Rodney W. Grimes wrote: > > >>>> Bad side effect of doing that is it is not hard to get a "core" > >>>> from top when run as a user, as it is going to try to write > >>>> to /, and it probably does not have permission for that. > > We already have global sysctl kern.corefile that can be changed to /var/tmp/% > N.core > > Perhaps, a kernel could take a look to process environment to something like > KERN_COREFILE variable for an override of that sysctl? > Only if the file doesn't exist and the lowest level directory is writable by UID. Even then if any directory within the path is not searchable by UID it should be disallowed. Otherwise it would be a CVE. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Jun 4 05:26:35 2018 Return-Path: Delivered-To: svn-src-head@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 DCC0BFF33A1 for ; Mon, 4 Jun 2018 05:26:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6195272A82 for ; Mon, 4 Jun 2018 05:26:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w545QNOf030649 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Jun 2018 07:26:23 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: Cy.Schubert@cschubert.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w545QCC5075791 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 4 Jun 2018 12:26:12 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334543 - head/usr.bin/top To: Cy Schubert References: <201806040507.w5457q5v007218@slippy.cwsent.com> Cc: rgrimes@freebsd.org, Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B14CD6E.9020003@grosbein.net> Date: Mon, 4 Jun 2018 12:26:06 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201806040507.w5457q5v007218@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:26:35 -0000 04.06.2018 12:07, Cy Schubert wrote: > In message <5B14C64B.2070602@grosbein.net>, Eugene Grosbein writes: >>>>>> Bad side effect of doing that is it is not hard to get a "core" >>>>>> from top when run as a user, as it is going to try to write >>>>>> to /, and it probably does not have permission for that. >> >> We already have global sysctl kern.corefile that can be changed to /var/tmp/% >> N.core >> >> Perhaps, a kernel could take a look to process environment to something like >> KERN_COREFILE variable for an override of that sysctl? > > Only if the file doesn't exist and the lowest level directory is > writable by UID. Even then if any directory within the path is not > searchable by UID it should be disallowed. Otherwise it would be a CVE. AFAIK all security checks are in place already for sysctl kern.corefile having default value relative to current working directory of the process (user). From owner-svn-src-head@freebsd.org Mon Jun 4 05:27:02 2018 Return-Path: Delivered-To: svn-src-head@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 1716AFF3487; Mon, 4 Jun 2018 05:27:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A95DA72BB3; Mon, 4 Jun 2018 05:27:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A9D5F4D; Mon, 4 Jun 2018 05:27:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w545R1hk075422; Mon, 4 Jun 2018 05:27:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w545R1UA075420; Mon, 4 Jun 2018 05:27:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806040527.w545R1UA075420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 4 Jun 2018 05:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334604 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:27:02 -0000 Author: eadler Date: Mon Jun 4 05:27:00 2018 New Revision: 334604 URL: https://svnweb.freebsd.org/changeset/base/334604 Log: top(1): some nitpicks - prefer fully spelled names to "u_long" - fix speeling Modified: head/usr.bin/top/commands.c head/usr.bin/top/machine.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Mon Jun 4 05:23:06 2018 (r334603) +++ head/usr.bin/top/commands.c Mon Jun 4 05:27:00 2018 (r334604) @@ -64,7 +64,7 @@ These single-character commands are available:\n\ q - quit\n\ h or ? - help; show this text\n", stdout); - /* not all commands are availalbe with overstrike terminals */ + /* not all commands are available with overstrike terminals */ if (overstrike) { fputs("\n\ Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jun 4 05:23:06 2018 (r334603) +++ head/usr.bin/top/machine.c Mon Jun 4 05:27:00 2018 (r334604) @@ -235,7 +235,7 @@ static const char *ordernames[] = { static int maxcpu; static int maxid; static int ncpus; -static u_long cpumask; +static unsigned long cpumask; static long *times; static long *pcpu_cp_time; static long *pcpu_cp_old; @@ -1616,7 +1616,7 @@ swapmode(int *retavail, int *retfree) int n; struct kvm_swap swapary[1]; static int pagesize = 0; - static u_long swap_maxpages = 0; + static unsigned long swap_maxpages = 0; *retavail = 0; *retfree = 0; From owner-svn-src-head@freebsd.org Mon Jun 4 05:42:43 2018 Return-Path: Delivered-To: svn-src-head@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 18F4BFF4FD6; Mon, 4 Jun 2018 05:42:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF8F97381C; Mon, 4 Jun 2018 05:42:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 88E6B113E8; Mon, 4 Jun 2018 05:42:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id E50E346D28; Mon, 4 Jun 2018 07:42:40 +0200 (CEST) Date: Mon, 4 Jun 2018 07:42:40 +0200 From: Baptiste Daroussin To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334557 - head/usr.bin/top Message-ID: <20180604054240.bgzlzftyw2zaxwa4@ivaldir.net> References: <201806031341.w53DfOAD000819@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="47aaiunxce7kltcf" Content-Disposition: inline In-Reply-To: <201806031341.w53DfOAD000819@repo.freebsd.org> User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:42:43 -0000 --47aaiunxce7kltcf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 03, 2018 at 01:41:24PM +0000, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 3 13:41:23 2018 > New Revision: 334557 > URL: https://svnweb.freebsd.org/changeset/base/334557 >=20 > Log: > top(1): restore size for kern.cp_times > =20 > Restore last minute change that broke top(1). >=20 > Modified: > head/usr.bin/top/machine.c >=20 > Modified: head/usr.bin/top/machine.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/machine.c Sun Jun 3 13:40:58 2018 (r334556) > +++ head/usr.bin/top/machine.c Sun Jun 3 13:41:23 2018 (r334557) > @@ -384,6 +384,7 @@ machine_init(struct statics *statics) > times =3D calloc(maxcpu * CPUSTATES, sizeof(long)); > if (times =3D=3D NULL) > err(1, "calloc %zu bytes", size); > + size =3D sizeof(long) * maxcpu * CPUSTATES; The error message just above might also be unhappy about the size variable = :) Bapt --47aaiunxce7kltcf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlsU0U4ACgkQY4mL3PG3 Plpq6xAAtIRPO2DilEFq4krvWJE7QNdZv97h3l7c4v5M8KhVSXD07JMRHnXC4NKv wKRhrRpTCIYF111a+1Fy4l6HGove+APmColQGC29eSnreusElHSWvhFXgNP58x9M T7a07/a2w2VJ91uhvQUa4ekfbLUl3maqqovozcms7zNa1eGDvutDPdIvgbSS6z1F vS8XQfa+OD1fL7BBTIG+HnusmDnYRgT3jU9RuKWkI4HMGiFuzqRgpB38PfhNGwsQ qK8bxm5Rkf+kr3FuLwZ0SBR/epN4Y73HLEtebKRtdq33bxQ62UEHGqanV9gJtk7q C5mR29i5fshlCAK+Ie79oo5V3EwsORX/bVFOVp8Invi7V2RPq7tqnN2uEVs7VUP2 xm/zDM41ESO33D73Ncp58lRmKJGJcuLgw8dvpwd2X+JnKfS1yButcre2g9QBdeui dZ2vUsLWXrIv/ydgVoGCh3lt2Bi6mz3e52E6Gh77aBfjjQVwlD2hpiC31Kid/Z7o CcCStBOmPraxna64H++8oYxitRCHz9uiVKpEOpZ5zYf5/OG4t5AXeH8ehPUxFwvY tJYLILQbpyt58PRzhSZmbrEMXl7e9h+ytb+ALPwIbbSsbI6M1iu5uGJZdcfrn+dC gSdFyf8hVfNCx5F2p+QUQphy2XRoPuHnWueWaNpghlfWa91Mli0= =+vS+ -----END PGP SIGNATURE----- --47aaiunxce7kltcf-- From owner-svn-src-head@freebsd.org Mon Jun 4 05:45:01 2018 Return-Path: Delivered-To: svn-src-head@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 BA45FFF53B0; Mon, 4 Jun 2018 05:45:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6918073A1B; Mon, 4 Jun 2018 05:45:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 32191113E9; Mon, 4 Jun 2018 05:45:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 6ED0246D2F; Mon, 4 Jun 2018 07:45:00 +0200 (CEST) Date: Mon, 4 Jun 2018 07:45:00 +0200 From: Baptiste Daroussin To: Florian Smeets Cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334474 - head/usr.bin/top Message-ID: <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> References: <201806010551.w515pfoB090926@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="joi4svscitjrb5vi" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:45:01 -0000 --joi4svscitjrb5vi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 03, 2018 at 07:19:47PM +0200, Florian Smeets via svn-src-all wr= ote: > On 01.06.18 07:51, Eitan Adler wrote: > > Author: eadler > > Date: Fri Jun 1 05:51:40 2018 > > New Revision: 334474 > > URL: https://svnweb.freebsd.org/changeset/base/334474 > >=20 > > Log: > > top(1): Display of TID when using 'H' flag > > =20 > > Some users prefer seeing the TID when viewing individual threads. This > > makes sense as the PID will be the same for multiple entries. An atte= mpt > > was made to include both, but there is insufficient room. As such, us= ing > > the TID. > > =20 > > While here, rename the header variables to be more understandable. > > =20 > > Discussed with: mmacy > > Reported on: 2009-10-07 > >=20 >=20 > Hi, >=20 > I think this is a mistake. The 'H' flag should keep the PID, AFAIK you > cannot use the TID anywhere in top in contrast to the PID. I usually > start top with the 'S' and 'H' flags. Now I cannot use 'k' to kill a > process in that view, as I don't see the PID. IMHO showing TIDs should > be a separate flag, 'h' maybe, as this commit changes current/expected > behavior (POLA?). >=20 > Also, this is not documented in the man page. >=20 > Florian >=20 I fully agrees here! Bapt --joi4svscitjrb5vi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlsU0dwACgkQY4mL3PG3 Plonfg/+MZeWDrPqcdqdQham5uVBZdGJXqcpPMb4fpxn+RdgNAL+S42+Cq0g0N7K 8/0CT+ewxsiKGoE1pCkFPvmcA2H9hKpFzj+DGAC8TOn12zxvRFU2MC1lsw8OC62O fbsfhysePBpbS4T5y9+9PmnZ7uI/ERPwuzOXmEJ6CKHZkKbTo7NnavocSxT7h0D0 JEtDSW6abMN4XQOm+7584aarPZUdhUqkumA/jf7qpoVlKe2eefSDMuiFUc1CDIBt vF+uX96GIOco+uJ9QGTqoA65akI+ZUE5MDMTRxtRzRth+tYdHKfUSpg+LIrb5M9h XoEDJnKn/ZIvzr3bDscWOm64lNQepJ3dU55K4+cTkEwC76yptPtWV6kM/r29+qWO liOw5qZFPfFX51y2gmZK1M6vQL0oA0qXc1MyrlChoYSeTMBBlFN3g0x8dV84ls/d GYmqHAwh38iqZy21MeZW0PDlUP2r+K8dVNfq9Zws2J2sDY4IRclYbDSWtru/yZW5 FbIv9zZ0+ypm4mLCG0g2gEpxQUpzfAvisl5DxEnFvlFrkI32TM7C+9hrdJC7Q1+Z t0HIbnGSg0mwnHsIsujBbcai/4dyrJxaDaez9T3Naw9e00g36PBEEJ1/h/0zt5Ve IUv7V7V8WqwerF9eUTuL0nH9HDRfMZc7BaZnAeS3+wvjMY8tZeg= =AhVh -----END PGP SIGNATURE----- --joi4svscitjrb5vi-- From owner-svn-src-head@freebsd.org Mon Jun 4 06:01:30 2018 Return-Path: Delivered-To: svn-src-head@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 5D089FF6F3E; Mon, 4 Jun 2018 06:01:30 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (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 B283A746ED; Mon, 4 Jun 2018 06:01:29 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id y20-v6so23249342lfy.0; Sun, 03 Jun 2018 23:01:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=JUrwfv9atOn7XS+wukDHD2eF56bBTPrMlWN//K1PjpI=; b=Ijvdsab+RUEsIsPhZksJvCo+JVCysxV4IgtCct5/sDMWrDDwsP7FV3+1TNSO3gMSeh csWaqMiep3EF4tmbYbLlccR6W58CAjOgehkoGOv9zVrUZSP0JFpHEI8+n0NikHQbQ7ZU xJv/IBQS4pKbcZOP57pHkkNVHWK2VTsyBBir60fOxo3pAfSWXPZjIGx25RcKQD5QvQdW Lnjo811/65MVpvBSrLnNXzDHOHynX+D1ArHoTTYZTotvI/uNDoYT6AEcohcSe/mv3v0B AxKAaL9078GBiMl9zQcq4MvJ6I4YELRGp7vbd4SuwSr+Z+FvntLo9xGwwYONINtc2NVl UG7Q== X-Gm-Message-State: APt69E2mCXMtcnDhZYAWWA8lalllrBQzOSnHul4YzdZcRTM3FIO30F8P xPYhcRz+6E62XKppux97QMq9/BlT X-Google-Smtp-Source: ADUXVKIJrIBmwidHCtMo7RPHiyZv8A25MqF7/zvYg1rLn4MIo8JmOvWaZYwZPvI8Of4SERQ7T32T1Q== X-Received: by 2002:a2e:7c02:: with SMTP id x2-v6mr4857418ljc.71.1528092081454; Sun, 03 Jun 2018 23:01:21 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id t19-v6sm9672862ljj.46.2018.06.03.23.01.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 23:01:20 -0700 (PDT) Subject: Re: svn commit: r334543 - head/usr.bin/top To: rgrimes@freebsd.org, Warner Losh Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <56dca964-0023-0484-2f89-320dcf6dab05@FreeBSD.org> Date: Mon, 4 Jun 2018 09:01:19 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 06:01:30 -0000 On 04/06/2018 00:33, Rodney W. Grimes wrote: > lsof is your friend here. That is the tool of choice for finding > cwd of processes that are in directories you can not unmount. s/lsof/fstat -f [-m]/ :-) -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jun 4 06:30:36 2018 Return-Path: Delivered-To: svn-src-head@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 A1ACAFD3116; Mon, 4 Jun 2018 06:30:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54A13757B8; Mon, 4 Jun 2018 06:30:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 361061906; Mon, 4 Jun 2018 06:30:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w546UaSE005646; Mon, 4 Jun 2018 06:30:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w546UaRJ005645; Mon, 4 Jun 2018 06:30:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806040630.w546UaRJ005645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 06:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334609 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 334609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 06:30:36 -0000 Author: mmacy Date: Mon Jun 4 06:30:35 2018 New Revision: 334609 URL: https://svnweb.freebsd.org/changeset/base/334609 Log: pmc filter: avoid spurious gcc uninitialized warning Modified: head/usr.sbin/pmc/cmd_pmc_filter.c Modified: head/usr.sbin/pmc/cmd_pmc_filter.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 05:55:40 2018 (r334608) +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 06:30:35 2018 (r334609) @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui if ((ps = pmclog_open(infd)) == NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - pmccount = 0; + eventcount = pmccount = 0; while (pmclog_read(ps, &ev) == 0) { if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); From owner-svn-src-head@freebsd.org Mon Jun 4 10:27:05 2018 Return-Path: Delivered-To: svn-src-head@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 0AADCFF16C8; Mon, 4 Jun 2018 10:27:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB297ED05; Mon, 4 Jun 2018 10:27:04 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A67857814; Mon, 4 Jun 2018 10:27:04 +0000 (UTC) Date: Mon, 4 Jun 2018 10:27:04 +0000 From: Alexey Dokuchaev To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334552 - head/usr.bin/top Message-ID: <20180604102704.GB43725@FreeBSD.org> References: <201806030507.w5357kMm036583@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806030507.w5357kMm036583@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 10:27:05 -0000 On Sun, Jun 03, 2018 at 05:07:46AM +0000, Eitan Adler wrote: > New Revision: 334552 > URL: https://svnweb.freebsd.org/changeset/base/334552 > > Log: > top(1): remove chdir to / > > While this came out of a conversation in IRC, it turn out that some > people don't like it. Since this was a courtesy feature, just remove it. Thank you. I was also quite surprized by this change (chdir to /). ./danfe From owner-svn-src-head@freebsd.org Mon Jun 4 10:43:11 2018 Return-Path: Delivered-To: svn-src-head@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 C93C9FF2F50 for ; Mon, 4 Jun 2018 10:43:11 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7705B7F7BF for ; Mon, 4 Jun 2018 10:43:11 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f177.google.com (mail-yb0-f177.google.com [209.85.213.177]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 3C93B13228 for ; Mon, 4 Jun 2018 10:43:11 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f177.google.com with SMTP id o14-v6so10893684ybq.3 for ; Mon, 04 Jun 2018 03:43:11 -0700 (PDT) X-Gm-Message-State: ALKqPwcHQMNR2IzEURtNrQC0YtS2Ojpx5KUMYU7NZ4UcsDRkneenXlxs 1ozMOUaNGyfEkXQVqyaFCd+UOleFNXrhODduzbYyfQ== X-Google-Smtp-Source: ADUXVKLQaYIL5VeYZtq5th+3G2E2Qce+318I52s6ZaIwGrLlzIohfT/J8i7AO1U15anCIBdPyyyRkP7s0fJL2T294mM= X-Received: by 2002:a25:786:: with SMTP id 128-v6mr11332104ybh.338.1528108990741; Mon, 04 Jun 2018 03:43:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 03:42:40 -0700 (PDT) In-Reply-To: <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> References: <201806010551.w515pfoB090926@repo.freebsd.org> <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> From: Eitan Adler Date: Mon, 4 Jun 2018 03:42:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334474 - head/usr.bin/top To: Baptiste Daroussin Cc: Florian Smeets , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 10:43:12 -0000 On 3 June 2018 at 22:45, Baptiste Daroussin wrote: >> Hi, >> > IMHO showing TIDs should >> be a separate flag, 'h' maybe, as this commit changes current/expected >> behavior (POLA?). Its a reasonable idea to split this out into a separate flag. I'll do that. >> Also, this is not documented in the man page. It is: see the commit. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Mon Jun 4 11:29:21 2018 Return-Path: Delivered-To: svn-src-head@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 2F728FF7A59; Mon, 4 Jun 2018 11:29:21 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [5.9.17.157]) (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 7F3CC8166F; Mon, 4 Jun 2018 11:29:20 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail6 [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id 8B3D3299A4; Mon, 4 Jun 2018 13:29:19 +0200 (CEST) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 4C4E19CC72; Mon, 4 Jun 2018 13:29:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id 3Sy69OAkEDPf; Mon, 4 Jun 2018 13:29:19 +0200 (CEST) Received: by mail.smeets.xyz (Postfix, from userid 1001) id 2658C9CC6C; Mon, 4 Jun 2018 13:29:19 +0200 (CEST) Date: Mon, 4 Jun 2018 13:29:19 +0200 From: Florian Smeets To: Eitan Adler Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334474 - head/usr.bin/top Message-ID: <20180604112919.GA8618@mail.smeets.xyz> References: <201806010551.w515pfoB090926@repo.freebsd.org> <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 11:29:21 -0000 On Mon, Jun 04, 2018 at 03:42:40AM -0700, Eitan Adler wrote: > On 3 June 2018 at 22:45, Baptiste Daroussin wrote: > >> Hi, > >> > > IMHO showing TIDs should > >> be a separate flag, 'h' maybe, as this commit changes current/expected > >> behavior (POLA?). > > Its a reasonable idea to split this out into a separate flag. I'll do that. > Ok, thanks. > >> Also, this is not documented in the man page. > > It is: see the commit. > Yeah, I should have been more specific, sorry. It is not documented in the OPTIONS section for -H, only in the INTERACTIVE MODE section. Florian From owner-svn-src-head@freebsd.org Mon Jun 4 11:35:05 2018 Return-Path: Delivered-To: svn-src-head@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 F0C1CFF8348; Mon, 4 Jun 2018 11:35:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A64C681C93; Mon, 4 Jun 2018 11:35:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83B5C4F2E; Mon, 4 Jun 2018 11:35:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54BZ4mD060388; Mon, 4 Jun 2018 11:35:04 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54BZ4Q2060387; Mon, 4 Jun 2018 11:35:04 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806041135.w54BZ4Q2060387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 4 Jun 2018 11:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334610 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 334610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 11:35:05 -0000 Author: rmacklem Date: Mon Jun 4 11:35:04 2018 New Revision: 334610 URL: https://svnweb.freebsd.org/changeset/base/334610 Log: Revert r334586 since I now think __unused is the better way to handle this. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jun 4 06:30:35 2018 (r334609) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jun 4 11:35:04 2018 (r334610) @@ -1574,10 +1574,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, struct nfsvattr at; int nlen, error = 0, getret = 1; int siz, cnt, fullsiz, eofflag, ncookies; - u_int64_t off, toff; -#if 0 - u_int64_t verf; -#endif + u_int64_t off, toff, verf; u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; @@ -1594,9 +1591,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram, NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); off = fxdr_hyper(tl); tl += 2; -#if 0 verf = fxdr_hyper(tl); -#endif tl += 2; } toff = off; From owner-svn-src-head@freebsd.org Mon Jun 4 12:08:27 2018 Return-Path: Delivered-To: svn-src-head@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 C931DFD46F3; Mon, 4 Jun 2018 12:08:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 43032838CB; Mon, 4 Jun 2018 12:08:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w54C8FLR066256; Mon, 4 Jun 2018 15:08:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w54C8FLR066256 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w54C8FH3066254; Mon, 4 Jun 2018 15:08:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Jun 2018 15:08:15 +0300 From: Konstantin Belousov To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat Message-ID: <20180604120815.GB2450@kib.kiev.ua> References: <201806040110.w541ANZr044727@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806040110.w541ANZr044727@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 12:08:28 -0000 On Mon, Jun 04, 2018 at 01:10:23AM +0000, Matt Macy wrote: > @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void > > pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR, > (struct trapframe *) arg); > + > + KASSERT(td->td_pinned == 1, > + ("[pmc,%d] invalid td_pinned value", __LINE__)); > + sched_unpin(); /* Can migrate safely now. */ sched_pin() is called from pmc_post_callchain_callback(), which is called from userret(). userret() is executed with interrupts and preemption enabled, so there is a non-trivial chance that the thread already migrated. In fact, I do not see a need to disable migration for the thread if user callchain is planned to be gathered. You only need to remember the cpu where the interrupt occured, to match it against the request. Or are per-cpu PMC registers still accessed during callchain collection ? > +int > +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, > + int inuserspace) > +{ > + struct thread *td; > + > + td = curthread; > + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && > + td && td->td_proc && > + (td->td_proc->p_flag & P_KPROC) == 0 && > + !inuserspace) { I am curious why a lot of the pmc code checks for curthread != NULL and, like this fragment, for curproc != NULL. I am sure that at least on x86, we never let curthread point to the garbage, even during the context switches. NMI handler has the same cargo-cult check, BTW. Also, please fix the indentation of the conditions block. > + atomic_add_int(&curthread->td_pmcpend, 1); You can use atomic_store_int() there, I believe, Then there would be no locked op executed at all, on x86. > @@ -375,6 +375,7 @@ struct thread { > void *td_lkpi_task; /* LinuxKPI task struct pointer */ > TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ > epoch_section_t td_epoch_section; /* (t) epoch section object */ > + int td_pmcpend; Why this member was not put into the zeroed region ? Wouldn't a garbage there cause uneccessary ASTs ? From owner-svn-src-head@freebsd.org Mon Jun 4 12:20:47 2018 Return-Path: Delivered-To: svn-src-head@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 B4666FD598D; Mon, 4 Jun 2018 12:20:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 3CFDE8401A; Mon, 4 Jun 2018 12:20:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w54CKa0H079157; Mon, 4 Jun 2018 15:20:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w54CKa0H079157 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w54CKaPV079153; Mon, 4 Jun 2018 15:20:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Jun 2018 15:20:36 +0300 From: Konstantin Belousov To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat Message-ID: <20180604122036.GC2450@kib.kiev.ua> References: <201806040110.w541ANZr044727@repo.freebsd.org> <20180604120815.GB2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180604120815.GB2450@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 12:20:47 -0000 On Mon, Jun 04, 2018 at 03:08:15PM +0300, Konstantin Belousov wrote: > On Mon, Jun 04, 2018 at 01:10:23AM +0000, Matt Macy wrote: > > @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void > > > > pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR, > > (struct trapframe *) arg); > > + > > + KASSERT(td->td_pinned == 1, > > + ("[pmc,%d] invalid td_pinned value", __LINE__)); > > + sched_unpin(); /* Can migrate safely now. */ > sched_pin() is called from pmc_post_callchain_callback(), which is > called from userret(). userret() is executed with interrupts and > preemption enabled, so there is a non-trivial chance that the thread > already migrated. > > In fact, I do not see a need to disable migration for the thread if user > callchain is planned to be gathered. You only need to remember the cpu > where the interrupt occured, to match it against the request. Or are > per-cpu PMC registers still accessed during callchain collection ? And more, it is safe to access userspace from userret() so you can walk usermode stack in the pmc callback directly, without scheduling an ast. > > > +int > > +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, > > + int inuserspace) > > +{ > > + struct thread *td; > > + > > + td = curthread; > > + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && > > + td && td->td_proc && > > + (td->td_proc->p_flag & P_KPROC) == 0 && > > + !inuserspace) { > I am curious why a lot of the pmc code checks for curthread != NULL and, > like this fragment, for curproc != NULL. I am sure that at least on x86, > we never let curthread point to the garbage, even during the context > switches. NMI handler has the same cargo-cult check, BTW. > > Also, please fix the indentation of the conditions block. > > > + atomic_add_int(&curthread->td_pmcpend, 1); > You can use atomic_store_int() there, I believe, Then there would be > no locked op executed at all, on x86. > > > @@ -375,6 +375,7 @@ struct thread { > > void *td_lkpi_task; /* LinuxKPI task struct pointer */ > > TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ > > epoch_section_t td_epoch_section; /* (t) epoch section object */ > > + int td_pmcpend; > Why this member was not put into the zeroed region ? Wouldn't a garbage > there cause uneccessary ASTs ? > From owner-svn-src-head@freebsd.org Mon Jun 4 12:46:27 2018 Return-Path: Delivered-To: svn-src-head@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 7046FFDD741 for ; Mon, 4 Jun 2018 12:46:27 +0000 (UTC) (envelope-from geena.davis@data-analytics.info) Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) (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 EA98A852C3 for ; Mon, 4 Jun 2018 12:46:26 +0000 (UTC) (envelope-from geena.davis@data-analytics.info) Received: by mail-pl0-x244.google.com with SMTP id n10-v6so19657782plp.0 for ; Mon, 04 Jun 2018 05:46: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:return-receipt-to:from:to:subject:date :message-id:mime-version:thread-index:content-language :disposition-notification-to; bh=0D8Ox+oyhIPt7sgZCCAb7nAt9j/odP2J2vFF9OLQ4b4=; b=bYdlir0m5kIZFkyIHE3ZBBTW4vK6upXE5bCm/kI/4m1dqJMsSIG4pJ+s8JaHvfmlCu 2fq1er59UqyK6el3fAv36SlDKz0jzoH3nSdHst8JwpVWf/aDAV1gDdHGjD9FWpWeZ8c/ PGs0mOwAm7dTYyINqCAg/RXc2yPIMgr/Imhn0NNeaTqS3zHFU4OJPCauhIBNlu8sTkBu GKmCygZNzVJQSKDrWLj9i/hrDUxW5isfUKUl9XHnlYBSKeUc4JyZ9ojQX6qZaPSGuUGV fiR+9WW8+oO9LDhscwqMI1WVVLTaHM5g1TQpNkPhNEGFeY3cDLV0OnuwWDOXOyd5a3lj ZPww== X-Gm-Message-State: ALKqPwf403PHibdOhnd9dsSPCTyvb9GVYfsRNjRC+VhfGGIPpSCngBu+ xTinpQsMFxJPyKrZ4VBAANjcuFwG X-Google-Smtp-Source: ADUXVKIA4hyGl5DUeDvpPk7CN+d9qGvcHxZ0RoDI9JbfKMwrobihkUCtEXO66aGN7PLKU2aa2ZrFmA== X-Received: by 2002:a17:902:7442:: with SMTP id e2-v6mr21232816plt.28.1528116385769; Mon, 04 Jun 2018 05:46:25 -0700 (PDT) Received: from AjmalPC ([183.82.18.159]) by smtp.gmail.com with ESMTPSA id v15-v6sm6503347pfk.12.2018.06.04.05.46.23 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Jun 2018 05:46:24 -0700 (PDT) From: "Geena Davis" To: Subject: Attendees List Date: Mon, 4 Jun 2018 18:13:56 +0530 Message-ID: <2d2501d3fc02$0b17f550$2147dff0$@data-analytics.info> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdP8AZVNNsLfSH3VQFm4sq45b3sj0A== Content-Language: en-us Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 12:46:27 -0000 Hi, Believe my email finds you well I found your companies listed as Sponsors and Exhibitors at New York Shoe Expo and thought you would be interested in receiving attendees list of the upcoming show. Titles: CEOs, CFOs, COOs, CIOs, CTOs, SVPs, VPs, Head, Directors, Managers Etc. Information Fields: Name, Company's Name, Phone Number, Fax Number, Job Title, Email address, Complete Mailing Address, Company Revenue Size, Employee Size, Web address etc. Geography We Cover: North America, Latin America, EMEA, and APAC. Please review and let me know your thoughts and I will get back to you with more information regarding counts and pricing for the same. Await your response! Regards, Geena Davis To Opt Out, please answer with "Exclude" in the Subject Line. From owner-svn-src-head@freebsd.org Mon Jun 4 14:42:14 2018 Return-Path: Delivered-To: svn-src-head@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 F33DEFE89EA; Mon, 4 Jun 2018 14:42:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDBB6A34A; Mon, 4 Jun 2018 14:42:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EBE16D95; Mon, 4 Jun 2018 14:42:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54EgDHI055268; Mon, 4 Jun 2018 14:42:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54EgDWr055267; Mon, 4 Jun 2018 14:42:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806041442.w54EgDWr055267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jun 2018 14:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334615 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 334615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:42:14 -0000 Author: jhibbits Date: Mon Jun 4 14:42:13 2018 New Revision: 334615 URL: https://svnweb.freebsd.org/changeset/base/334615 Log: Set kernelname in bootconfig to the kernel file Summary: The kernel reads 'kernelname' to set the kern.bootfile sysctl. By setting this, 'make installkernel' will backup the running kernel as appropriate. Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15660 Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Jun 4 14:23:04 2018 (r334614) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Jun 4 14:42:13 2018 (r334615) @@ -31,7 +31,7 @@ if [ `uname -m` == powerpc ]; then if [ "$platform" == ps3 -o "$platform" == powernv ]; then rootpart=$(awk '{ if($2 == "/") printf("%s:%s\n", $3, $1); }' $PATH_FSTAB) mkdir -p $BSDINSTALL_CHROOT/boot/etc/ - echo FreeBSD=\'/kernel/kernel vfs.root.mountfrom=${rootpart}\' > $BSDINSTALL_CHROOT/boot/etc/kboot.conf + echo FreeBSD=\'/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=${rootpart}\' > $BSDINSTALL_CHROOT/boot/etc/kboot.conf fi fi From owner-svn-src-head@freebsd.org Mon Jun 4 14:56:03 2018 Return-Path: Delivered-To: svn-src-head@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 B6CF1FE9EF0; Mon, 4 Jun 2018 14:56:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64EF46B032; Mon, 4 Jun 2018 14:56:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 472626F57; Mon, 4 Jun 2018 14:56:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54Eu3E0062083; Mon, 4 Jun 2018 14:56:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54Eu3hB062082; Mon, 4 Jun 2018 14:56:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041456.w54Eu3hB062082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 14:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334616 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 334616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:56:03 -0000 Author: markj Date: Mon Jun 4 14:56:02 2018 New Revision: 334616 URL: https://svnweb.freebsd.org/changeset/base/334616 Log: Fix the NUMA build for non-x86 platforms. acpi_map_pxm_to_vm_domainid() is currently implemented only on x86. MFC after: 1 week Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Jun 4 14:42:13 2018 (r334615) +++ head/sys/dev/acpica/acpi.c Mon Jun 4 14:56:02 2018 (r334616) @@ -1090,6 +1090,7 @@ static int acpi_parse_pxm(device_t dev) { #ifdef NUMA +#if defined(__i386__) || defined(__amd64__) ACPI_HANDLE handle; ACPI_STATUS status; int pxm; @@ -1102,6 +1103,7 @@ acpi_parse_pxm(device_t dev) return (acpi_map_pxm_to_vm_domainid(pxm)); if (status == AE_NOT_FOUND) return (-2); +#endif #endif return (-1); } From owner-svn-src-head@freebsd.org Mon Jun 4 15:13:42 2018 Return-Path: Delivered-To: svn-src-head@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 70F41FEBB73; Mon, 4 Jun 2018 15:13:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B272A6BFCB; Mon, 4 Jun 2018 15:13:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54FDMZZ096289; Mon, 4 Jun 2018 08:13:22 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FDMZn096288; Mon, 4 Jun 2018 08:13:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041513.w54FDMZn096288@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334543 - head/usr.bin/top In-Reply-To: To: Don Lewis Date: Mon, 4 Jun 2018 08:13:22 -0700 (PDT) CC: rgrimes@FreeBSD.org, Eitan Adler , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:13:42 -0000 > On 2 Jun, Rodney W. Grimes wrote: > >> Author: eadler > >> Date: Sat Jun 2 22:06:27 2018 > >> New Revision: 334543 > >> URL: https://svnweb.freebsd.org/changeset/base/334543 > >> > >> Log: > >> top(1): chdir to / as init; remove unneeded comment > >> > >> - chdir to / to allow unmounting of wd > >> - remove warning about running top(1) as setuid. If this is a concern we > >> should just drop privs instead. > >> > >> Modified: > >> head/usr.bin/top/machine.c > >> head/usr.bin/top/top.c > >> > >> Modified: head/usr.bin/top/machine.c > >> ============================================================================== > >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 (r334542) > >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 (r334543) > >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) > >> /* > >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 if > >> * the process does not exist. > >> - * It is EXTREMELY IMPORTANT that this function work correctly. > >> - * If top runs setuid root (as in SVR4), then this function > >> - * is the only thing that stands in the way of a serious > >> - * security problem. It validates requests for the "kill" > >> - * and "renice" commands. > >> */ > >> > >> int > >> > >> Modified: head/usr.bin/top/top.c > >> ============================================================================== > >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) > >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) > >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) > >> #define CMD_order 26 > >> #define CMD_pid 27 > >> > >> + /* > >> + * Since top(1) is often long running and > >> + * doesn't typically care about where its running from > >> + * chdir to the root to allow unmounting of its > >> + * originall wd. Failure is alright as this is > >> + * just a courtesy for users. > >> + */ > >> + chdir("/"); > >> + > > > > Bad side effect of doing that is it is not hard to get a "core" > > from top when run as a user, as it is going to try to write > > to /, and it probably does not have permission for that. > > > > Better might be a cd to /tmp, or /var/tmp, which are usually > > hard to unmount for these reasons anyway. > > Unless you start top using the exec shell builtin, the shell that you > use to launch top will also be long running and will also prevent its > $cwd from being unmounted. Thats a good point, so that makes the chdir worthless. > If you do use exec, then you will get logged out when you kill top ... :-(. The long standing (30 years) solution is to use lsof and find the processes that have cwd's in what ever it is you want to unmount. Special casing top(1) is just a none solution to the can not unmount foo problem. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:17:26 2018 Return-Path: Delivered-To: svn-src-head@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 0F928FEC334; Mon, 4 Jun 2018 15:17:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3D486C421; Mon, 4 Jun 2018 15:17:25 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80913728B; Mon, 4 Jun 2018 15:17:25 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54FHPAs072480; Mon, 4 Jun 2018 15:17:25 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54FHPn0072477; Mon, 4 Jun 2018 15:17:25 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201806041517.w54FHPn0072477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 4 Jun 2018 15:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334617 - in head: . etc X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: . etc X-SVN-Commit-Revision: 334617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:17:26 -0000 Author: brd Date: Mon Jun 4 15:17:24 2018 New Revision: 334617 URL: https://svnweb.freebsd.org/changeset/base/334617 Log: Move /sys symlink creating out of etc/Makefile. This is prep for etc/Makefile going away. Approved by: bapt (mentor) Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jun 4 14:56:02 2018 (r334616) +++ head/Makefile.inc1 Mon Jun 4 15:17:24 2018 (r334617) @@ -1239,6 +1239,7 @@ distributeworld installworld stageworld: _installcheck METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs + ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys .endif ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ ${IMAKEENV} rm -rf ${INSTALLTMP} Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Jun 4 14:56:02 2018 (r334616) +++ head/etc/Makefile Mon Jun 4 15:17:24 2018 (r334617) @@ -386,7 +386,6 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY ${METALOG.add} ; \ done; true .endif - ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys .if ${MK_NLS} != "no" set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ From owner-svn-src-head@freebsd.org Mon Jun 4 15:17:31 2018 Return-Path: Delivered-To: svn-src-head@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 6EEF8FEC361; Mon, 4 Jun 2018 15:17:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C16B66C472; Mon, 4 Jun 2018 15:17:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54FHRVK096319; Mon, 4 Jun 2018 08:17:27 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FHRiZ096318; Mon, 4 Jun 2018 08:17:27 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041517.w54FHRiZ096318@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334543 - head/usr.bin/top In-Reply-To: <56dca964-0023-0484-2f89-320dcf6dab05@FreeBSD.org> To: Andriy Gapon Date: Mon, 4 Jun 2018 08:17:27 -0700 (PDT) CC: rgrimes@freebsd.org, Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:17:31 -0000 [ Charset UTF-8 unsupported, converting... ] > On 04/06/2018 00:33, Rodney W. Grimes wrote: > > lsof is your friend here. That is the tool of choice for finding > > cwd of processes that are in directories you can not unmount. > > s/lsof/fstat -f [-m]/ > :-) I forget we have that tool!! Old finger memory spells it lsof no matter what my brain says. I even forget when I dont have lsof installed that I can get what I want from fstat! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:18:37 2018 Return-Path: Delivered-To: svn-src-head@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 AF082FEC548; Mon, 4 Jun 2018 15:18:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 234756C7A4; Mon, 4 Jun 2018 15:18:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54FIYfJ096338; Mon, 4 Jun 2018 08:18:34 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FIYRZ096337; Mon, 4 Jun 2018 08:18:34 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041518.w54FIYRZ096337@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334609 - head/usr.sbin/pmc In-Reply-To: <201806040630.w546UaRJ005645@repo.freebsd.org> To: Matt Macy Date: Mon, 4 Jun 2018 08:18:34 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:18:37 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mmacy > Date: Mon Jun 4 06:30:35 2018 > New Revision: 334609 > URL: https://svnweb.freebsd.org/changeset/base/334609 > > Log: > pmc filter: avoid spurious gcc uninitialized warning Is it truely uninitialzized, or are you silencing a bogus warning, this commit and the code does not make that clear, and that should be made clear. Thanks, Rod > > Modified: > head/usr.sbin/pmc/cmd_pmc_filter.c > > Modified: head/usr.sbin/pmc/cmd_pmc_filter.c > ============================================================================== > --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 05:55:40 2018 (r334608) > +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 06:30:35 2018 (r334609) > @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui > if ((ps = pmclog_open(infd)) == NULL) > errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); > > - pmccount = 0; > + eventcount = pmccount = 0; > while (pmclog_read(ps, &ev) == 0) { > if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) > memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:23:09 2018 Return-Path: Delivered-To: svn-src-head@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 84DCEFECE53; Mon, 4 Jun 2018 15:23:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30FCD6CFAC; Mon, 4 Jun 2018 15:23:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C5C2514E1D; Mon, 4 Jun 2018 15:23:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f48.google.com with SMTP id y20-v6so25870069lfy.0; Mon, 04 Jun 2018 08:23:08 -0700 (PDT) X-Gm-Message-State: ALKqPwdH46+NOp9PAreUbE9AsDKUypq4q4UPrvawWnFeuf8/GM1W/A1x Wx0y/v1mOCnPsPpGcJ37Tfh0Zpf2FvoCc/2uXwE= X-Google-Smtp-Source: ADUXVKJuCwAUHJABZ7RAYkT/aZ4rTIYfkncyUnvcVS7FZQwEq3VLse08pHJxHz62ZdBZCFhcS8cCHokgaG3K4oc+tJ4= X-Received: by 2002:a2e:804c:: with SMTP id p12-v6mr12241756ljg.22.1528125787325; Mon, 04 Jun 2018 08:23:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3112:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 08:22:46 -0700 (PDT) In-Reply-To: <201806041517.w54FHPn0072477@repo.freebsd.org> References: <201806041517.w54FHPn0072477@repo.freebsd.org> From: Kyle Evans Date: Mon, 4 Jun 2018 10:22:46 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334617 - in head: . etc To: Brad Davis Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:23:09 -0000 On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > Author: brd > Date: Mon Jun 4 15:17:24 2018 > New Revision: 334617 > URL: https://svnweb.freebsd.org/changeset/base/334617 > > Log: > Move /sys symlink creating out of etc/Makefile. > > This is prep for etc/Makefile going away. > > Approved by: bapt (mentor) > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile is? Some of the NO_ROOT stuff there seems to be terribly broken and needs to be fixed; this was on my 'some day to fix' list. From owner-svn-src-head@freebsd.org Mon Jun 4 15:25:38 2018 Return-Path: Delivered-To: svn-src-head@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 D52AAFED1AC; Mon, 4 Jun 2018 15:25:37 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 51F496D1B0; Mon, 4 Jun 2018 15:25:37 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id m129-v6so14689428wmb.3; Mon, 04 Jun 2018 08:25:37 -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=SxrKi6BNWbZbUApzfIfgQKjT83lU+Oy7GlJlpB7NZno=; b=UloU/hT1LvjsuVjEYKAyTff0QLTS3uOJOZO3HuinwqmC0l5xSjfE1OeJOt9fz5uFhP 6pMD9CZHEi5Ug9fa7l6HYiqcKq788ECdnK0rV3K5Evh3toI/SoG8qnPYoUl2fmeQlqL2 GGoUZsrI5Rxtd0iez/vLn3qLTgG+HFMN0+EsrRK0OamlV/Yh7cGO2+59QC4sUqjTzP6K jGtD1jMiVmGr82HFcN/mzT3qUcR716Jcz4bbSQTkdrd8WbupbGVErmFY46s6JkdaDnp2 F7uANAaHfpdWBlah+2VbtJ0SgQ25hKtJX+bq7vWbeJnuT2IQhE0T+ijgNkWGGh6EMnW1 pYEQ== 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=SxrKi6BNWbZbUApzfIfgQKjT83lU+Oy7GlJlpB7NZno=; b=g3YhidAnuDFpHZJ/0SZShi05kYRTGpLdxx6AShMaQnuBycqletLSE/rRfSqlW7ZLGI dHyvB8MBDSvskdrPpOD/EBotrY93CqughjQqayyol2/hcNh8PXDDgGx90kdUw2jYRU1D VSqQSMa0yohhVE+WPyUkHY7BTv9x7w0CVWZsceET4u40pmEu7bcVVvZ2+L6i6Cai35hv hDvTVQPei6xuL5BUIRvzvaeqXV/8rMoKc9aTb3v8gmhnLsivJgeYdoRlvFE5X4wcejZY qEZNbU4bZCzG205VBODoRp0QsHOqNF54XTmXaii3OC7wJnJK85kE02y5saYx472selCE MyrA== X-Gm-Message-State: APt69E04KbVIbTfzowNLXcPXMOMQ/vgWKQTUXRbgRcixXhrHp6eaclEt jV7ZRR5xPxf1Zfd6z9yZbg8cdf2TWFt8DITw6D0FTQ== X-Google-Smtp-Source: ADUXVKJbs/khn1Lk+bVd8qbcKQDvWMf+wZnDXqaucbUjPAs6cODjxQk7r8Od0JrJ5GNxY5XtW7ccB08YTx2WhNyq7LM= X-Received: by 2002:a1c:6241:: with SMTP id w62-v6mr9289493wmb.115.1528125935979; Mon, 04 Jun 2018 08:25:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:b35c:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 08:25:35 -0700 (PDT) In-Reply-To: <201806041518.w54FIYRZ096337@pdx.rh.CN85.dnsmgr.net> References: <201806040630.w546UaRJ005645@repo.freebsd.org> <201806041518.w54FIYRZ096337@pdx.rh.CN85.dnsmgr.net> From: Matt Joras Date: Mon, 4 Jun 2018 08:25:35 -0700 Message-ID: Subject: Re: svn commit: r334609 - head/usr.sbin/pmc To: rgrimes@freebsd.org Cc: Matt Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:25:38 -0000 On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: mmacy >> Date: Mon Jun 4 06:30:35 2018 >> New Revision: 334609 >> URL: https://svnweb.freebsd.org/changeset/base/334609 >> >> Log: >> pmc filter: avoid spurious gcc uninitialized warning > > Is it truely uninitialzized, or are you silencing a bogus warning, > this commit and the code does not make that clear, and that should > be made clear. I didn't check the code, but given he said "spurious", I don't think there's much ambiguity. Matt > > Thanks, > Rod >> >> Modified: >> head/usr.sbin/pmc/cmd_pmc_filter.c >> >> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c >> ============================================================================== >> --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 05:55:40 2018 (r334608) >> +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 06:30:35 2018 (r334609) >> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui >> if ((ps = pmclog_open(infd)) == NULL) >> errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); >> >> - pmccount = 0; >> + eventcount = pmccount = 0; >> while (pmclog_read(ps, &ev) == 0) { >> if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) >> memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); >> >> > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Jun 4 15:29:24 2018 Return-Path: Delivered-To: svn-src-head@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 F0885FED752; Mon, 4 Jun 2018 15:29:23 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6BA6D427; Mon, 4 Jun 2018 15:29:23 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54FTLZF096387; Mon, 4 Jun 2018 08:29:21 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FTLGY096386; Mon, 4 Jun 2018 08:29:21 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041529.w54FTLGY096386@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: To: Kyle Evans Date: Mon, 4 Jun 2018 08:29:21 -0700 (PDT) CC: Brad Davis , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:29:24 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > Author: brd > > Date: Mon Jun 4 15:17:24 2018 > > New Revision: 334617 > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > Log: > > Move /sys symlink creating out of etc/Makefile. > > > > This is prep for etc/Makefile going away. > > > > Approved by: bapt (mentor) > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > is? Some of the NO_ROOT stuff there seems to be terribly broken and > needs to be fixed; this was on my 'some day to fix' list. Yes please, much more information here. I use some of the targets in src/etc/Makefile such as distribution: I believe there are also other external consumers of this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:32:03 2018 Return-Path: Delivered-To: svn-src-head@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 E2C9AFEDC2C; Mon, 4 Jun 2018 15:32:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7AF6D92F; Mon, 4 Jun 2018 15:32:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54FW0Ts096404; Mon, 4 Jun 2018 08:32:00 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FW0hl096403; Mon, 4 Jun 2018 08:32:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041532.w54FW0hl096403@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334609 - head/usr.sbin/pmc In-Reply-To: To: Matt Joras Date: Mon, 4 Jun 2018 08:32:00 -0700 (PDT) CC: rgrimes@freebsd.org, Matt Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:32:03 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: mmacy > >> Date: Mon Jun 4 06:30:35 2018 > >> New Revision: 334609 > >> URL: https://svnweb.freebsd.org/changeset/base/334609 > >> > >> Log: > >> pmc filter: avoid spurious gcc uninitialized warning > > > > Is it truely uninitialzized, or are you silencing a bogus warning, > > this commit and the code does not make that clear, and that should > > be made clear. > I didn't check the code, but given he said "spurious", I don't think > there's much ambiguity. So your silencing a compiler warning without even figuring out if it is true or not. Please do not do that. That is not helpful to the code base. If it is a bogus warning, the code needs marked as such. If it is a valid warning, then what you did is the proper solution. > Matt > > > > > Thanks, > > Rod > >> > >> Modified: > >> head/usr.sbin/pmc/cmd_pmc_filter.c > >> > >> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c > >> ============================================================================== > >> --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 05:55:40 2018 (r334608) > >> +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 06:30:35 2018 (r334609) > >> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui > >> if ((ps = pmclog_open(infd)) == NULL) > >> errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); > >> > >> - pmccount = 0; > >> + eventcount = pmccount = 0; > >> while (pmclog_read(ps, &ev) == 0) { > >> if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) > >> memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); > >> > >> > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:44:18 2018 Return-Path: Delivered-To: svn-src-head@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 36BB4FEEF30; Mon, 4 Jun 2018 15:44:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD026E39E; Mon, 4 Jun 2018 15:44:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFE2A775D; Mon, 4 Jun 2018 15:44:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54FiHPK087690; Mon, 4 Jun 2018 15:44:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54FiHUY087689; Mon, 4 Jun 2018 15:44:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806041544.w54FiHUY087689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jun 2018 15:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334618 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:44:18 -0000 Author: jhibbits Date: Mon Jun 4 15:44:17 2018 New Revision: 334618 URL: https://svnweb.freebsd.org/changeset/base/334618 Log: Align UMA data to 128 byte cacheline size Suggested by: mjg Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Mon Jun 4 15:17:24 2018 (r334617) +++ head/sys/vm/uma_int.h Mon Jun 4 15:44:17 2018 (r334618) @@ -176,7 +176,7 @@ struct uma_hash { /* * align field or structure to cache line */ -#if defined(__amd64__) +#if defined(__amd64__) || defined(__powerpc64__) #define UMA_ALIGN __aligned(128) #else #define UMA_ALIGN From owner-svn-src-head@freebsd.org Mon Jun 4 15:47:49 2018 Return-Path: Delivered-To: svn-src-head@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 8FA97FEF56D; Mon, 4 Jun 2018 15:47:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA7336E6AD; Mon, 4 Jun 2018 15:47:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54Flk98096474; Mon, 4 Jun 2018 08:47:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54FlkhW096473; Mon, 4 Jun 2018 08:47:46 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041547.w54FlkhW096473@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334609 - head/usr.sbin/pmc In-Reply-To: <201806041532.w54FW0hl096403@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Mon, 4 Jun 2018 08:47:46 -0700 (PDT) CC: Matt Joras , Matt Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:47:49 -0000 > > On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes > > wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> Author: mmacy > > >> Date: Mon Jun 4 06:30:35 2018 > > >> New Revision: 334609 > > >> URL: https://svnweb.freebsd.org/changeset/base/334609 > > >> > > >> Log: > > >> pmc filter: avoid spurious gcc uninitialized warning > > > > > > Is it truely uninitialzized, or are you silencing a bogus warning, > > > this commit and the code does not make that clear, and that should > > > be made clear. > > I didn't check the code, but given he said "spurious", I don't think > > there's much ambiguity. > > So your silencing a compiler warning without even figuring out if ^Mmacy > it is true or not. Please do not do that. That is not helpful to > the code base. > > If it is a bogus warning, the code needs marked as such. > If it is a valid warning, then what you did is the proper solution. ^Mmacy > > > Matt Sorry, didnt realize this was a different Matt replying. > > > > > > > > Thanks, > > > Rod > > >> > > >> Modified: > > >> head/usr.sbin/pmc/cmd_pmc_filter.c > > >> > > >> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c > > >> ============================================================================== > > >> --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 05:55:40 2018 (r334608) > > >> +++ head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 06:30:35 2018 (r334609) > > >> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui > > >> if ((ps = pmclog_open(infd)) == NULL) > > >> errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); > > >> > > >> - pmccount = 0; > > >> + eventcount = pmccount = 0; > > >> while (pmclog_read(ps, &ev) == 0) { > > >> if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) > > >> memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); > > >> > > >> > > > > > > -- > > > Rod Grimes rgrimes@freebsd.org > > > > > > > > > -- > Rod Grimes rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 15:55:54 2018 Return-Path: Delivered-To: svn-src-head@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 792AAFF0442 for ; Mon, 4 Jun 2018 15:55:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 0AEEB6EE56 for ; Mon, 4 Jun 2018 15:55:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id y127-v6so10758395itd.1 for ; Mon, 04 Jun 2018 08:55:53 -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=/5Rrgd/Zi3CfDLz3fP6JwoHyjbcn2oK0teXSL47TGJQ=; b=ET8Dqi9JN64VP6oDVGUWbS8exxWxRYmFSPzX9XCf8OqZS2YqEI5qMUJ6PKALsN1psy 3VhKGCt0+kmBvWsYBphxuXz05xvnmVq8OGrQasp0WpKXZkzFrbVixbWCQ1f4QIOKqtZP jE6/e3fRL70puKPdkd8uwMyhYOcf3rICTRCLLjNO2Y1JWTp0lcEJOeIuHwGwbRd86sJf 4uvNA/Oe2bztqaxSU0q/kq1CbMoKi+pk0mduaMemeR0w+I55mniIOSdZmqy5wyAM7zP1 DdBmPwQDeaVJ64GS1049JMWTbFZekHQfcpXUU2FOF18+slwICNMl+eVejB0OwMVzMdUF O2Iw== 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=/5Rrgd/Zi3CfDLz3fP6JwoHyjbcn2oK0teXSL47TGJQ=; b=ceu96S7cZC0AtlKU1FxH4MrNGVVsg6tPCOQdtPBhcr+T5jgwCm+/b30rezZaXpFxMt Rd18lmLtuURdB3RcRIXpvKM1foTiL1wa+QKVDupfra7VyWr8VjOaMsIOmPDD0sFLBSzT BZS9Ta1FNnffxDGYY+3f25JrcRT8uEQDltDMDwKGczh9aekjRLklxqg7nN+tceNZ/SM+ AKXEqhFAX41qIafYFJikrMdxruoXMGS1x54T1VN5y7h/THfHHkHB60Eh/VEOUCvfc89T xcbv0mky+w6nL3NofScbiJHqNs9Jk/4jUOstgcRQnmIFT0ZJ5thC8aiNHVjIugzPLW0D WDUA== X-Gm-Message-State: APt69E33xw3PcfSw8cjbMwn/cpHCMBrMK0pXthxEbXCgNp/2sxlJj4Ey a2OIksmQQDWKHUFJYFUrT9TsrnvLWEd1xjkiw9NDRw== X-Google-Smtp-Source: ADUXVKIPyrajYP4MQLIP/KFdfFZfTq80omKz2PhO9/LCn0UNcURjkVT2EoxeJZ1GrQFik/oZw0lJIF2288Tf2KSTP/A= X-Received: by 2002:a24:8201:: with SMTP id t1-v6mr15429463itd.51.1528127753207; Mon, 04 Jun 2018 08:55:53 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 08:55:52 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180604102704.GB43725@FreeBSD.org> References: <201806030507.w5357kMm036583@repo.freebsd.org> <20180604102704.GB43725@FreeBSD.org> From: Warner Losh Date: Mon, 4 Jun 2018 09:55:52 -0600 X-Google-Sender-Auth: qBMtx01h3zwilCVdTJwQ5zBHpK0 Message-ID: Subject: Re: svn commit: r334552 - head/usr.bin/top To: Alexey Dokuchaev Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:55:54 -0000 On Sun, Jun 03, 2018 at 05:07:46AM +0000, Eitan Adler wrote: > > New Revision: 334552 > > URL: https://svnweb.freebsd.org/changeset/base/334552 > > > > Log: > > top(1): remove chdir to / > > > > While this came out of a conversation in IRC, it turn out that some > > people don't like it. Since this was a courtesy feature, just remove > it. > At first I thought you were nuts to remove it, since I thought this was a wise change. However, I've changed my mind. I've done some research behind this practice. A long time ago, it used to be critical to the operation of the system: long running processes could prevent a reboot. The 7th Edithion and earlier didn't even have a reboot system call[*]. In System III and original System V based systems, you even had to cd / before doing a shutdown. Otherwise the umounts of all the filesystems except / would fail. There were no forcing provisions in the code at that time. Long running processes would cd to / to avoid problems with people needing to unmount a filesystem and secondarily to ensure that the umounts would work if there were issues with the process dying at reboot time. Somewhere around SysV r3 or so, these restrictions were lessoned and by the time Solaris forked from SysV r4, they were mostly gone. BSD kernels appear to have had similar issues, but they were fixed (or became moot) very early on (maybe between 2.8 and 2.9, google isn't as helpful as I'd had hoped here, and I didn't want to sink a ton of time reading code on TUHS). Fast forward to today, and they are unneeded. There's no issue with reboot. There can be minor issues with umounting filesystems. fstat(1) can be used, though it's a bit cumbersome, to find stray references. Warner [*] OK, a system call number was reserved for reboot, but it wasn't implemented. From owner-svn-src-head@freebsd.org Mon Jun 4 15:56:08 2018 Return-Path: Delivered-To: svn-src-head@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 79209FF04FD for ; Mon, 4 Jun 2018 15:56:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 3326E6EFFA for ; Mon, 4 Jun 2018 15:56:05 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: a08b84c8-680f-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id a08b84c8-680f-11e8-b829-b3adae557cda; Mon, 04 Jun 2018 15:54:56 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w54Fst1W034725; Mon, 4 Jun 2018 09:54:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528127695.32688.215.camel@freebsd.org> Subject: Re: svn commit: r334543 - head/usr.bin/top From: Ian Lepore To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 04 Jun 2018 09:54:55 -0600 In-Reply-To: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> References: <201806032133.w53LXvVY092879@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 15:56:08 -0000 On Sun, 2018-06-03 at 14:33 -0700, Rodney W. Grimes wrote: > > > > On Sat, Jun 2, 2018 at 11:08 PM, Eitan Adler wrote: > > > > > > > > On 2 June 2018 at 16:56, Rodney W. Grimes > > > wrote: > > > > > > > > > > > > > > Author: eadler > > > > > Date: Sat Jun  2 22:06:27 2018 > > > > > New Revision: 334543 > > > > > URL: https://svnweb.freebsd.org/changeset/base/334543 > > > > > > > > > > Log: > > > > >   top(1): chdir to / as init; remove unneeded comment > > > > > > > > > >   - chdir to / to allow unmounting of wd > > > > >   - remove warning about running top(1) as setuid. If this is a concern > > > we > > > > > > > > > > > > > >   should just drop privs instead. > > > > > > > > > > Modified: > > > > >   head/usr.bin/top/machine.c > > > > >   head/usr.bin/top/top.c > > > > > > > > > > Modified: head/usr.bin/top/machine.c > > > > > ============================================================ > > > ================== > > > > > > > > > > > > > > --- head/usr.bin/top/machine.c        Sat Jun  2 21:50:00 2018 > > > (r334542) > > > > > > > > > > > > > > +++ head/usr.bin/top/machine.c        Sat Jun  2 22:06:27 2018 > > > (r334543) > > > > > > > > > > > > > > @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2) > > > > >  /* > > > > >   * proc_owner(pid) - returns the uid that owns process "pid", or -1 if > > > > >   *           the process does not exist. > > > > > - *           It is EXTREMELY IMPORTANT that this function work > > > correctly. > > > > > > > > > > > > > > - *           If top runs setuid root (as in SVR4), then this function > > > > > - *           is the only thing that stands in the way of a serious > > > > > - *           security problem.  It validates requests for the "kill" > > > > > - *           and "renice" commands. > > > > >   */ > > > > > > > > > >  int > > > > > > > > > > Modified: head/usr.bin/top/top.c > > > > > ============================================================ > > > ================== > > > > > > > > > > > > > > --- head/usr.bin/top/top.c    Sat Jun  2 21:50:00 2018        (r334542) > > > > > +++ head/usr.bin/top/top.c    Sat Jun  2 22:06:27 2018        (r334543) > > > > > @@ -260,6 +260,15 @@ main(int argc, char *argv[]) > > > > >  #define CMD_order    26 > > > > >  #define CMD_pid              27 > > > > > > > > > > +    /* > > > > > +     * Since top(1) is often long running and > > > > > +     * doesn't typically care about where its running from > > > > > +     * chdir to the root to allow unmounting of its > > > > > +     * originall wd. Failure is alright as this is > > > > > +     * just a courtesy for users. > > > > > +     */ > > > > > +    chdir("/"); > > > > > + > > > > Bad side effect of doing that is it is not hard to get a "core" > > > > from top when run as a user, as it is going to try to write > > > > to /, and it probably does not have permission for that. > > > Another person made the point that other similar applications don't do > > > this, so I just reverted it. > > > > > Actually,  it was a good change. > > > > I've had issues on other systems where I couldn't unmount a filesystem for > > reasons unknown. > lsof is your friend here.  That is the tool of choice for finding > cwd of processes that are in directories you can not unmount. > Actually, rather than lsof (which I never even bother to install anymore), I think the newer version of this advice is to use procstat(1) from base. For example, to see why you can't umount /foo:   procstat -af | grep /foo -- Ian From owner-svn-src-head@freebsd.org Mon Jun 4 16:01:46 2018 Return-Path: Delivered-To: svn-src-head@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 98EDDFF0E2B for ; Mon, 4 Jun 2018 16:01:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 24B2B6F59A for ; Mon, 4 Jun 2018 16:01:46 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 692fd205-6810-11e8-afd2-4ddcc8249dd4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 692fd205-6810-11e8-afd2-4ddcc8249dd4; Mon, 04 Jun 2018 16:00:34 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w54G0W0i034762; Mon, 4 Jun 2018 10:00:32 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528128032.32688.218.camel@freebsd.org> Subject: Re: svn commit: r334604 - head/usr.bin/top From: Ian Lepore To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 04 Jun 2018 10:00:32 -0600 In-Reply-To: <201806040527.w545R1UA075420@repo.freebsd.org> References: <201806040527.w545R1UA075420@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:01:46 -0000 On Mon, 2018-06-04 at 05:27 +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Jun  4 05:27:00 2018 > New Revision: 334604 > URL: https://svnweb.freebsd.org/changeset/base/334604 > > Log: >   top(1): some nitpicks >    >   - prefer fully spelled names to "u_long" Why? I though we preferred the u_char, u_int, u_long spellings in BSD code? (I certainly prefer them, and I thought style(9) did too, but I seem to be remembering that wrong). -- Ian From owner-svn-src-head@freebsd.org Mon Jun 4 16:13:29 2018 Return-Path: Delivered-To: svn-src-head@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 5D2FFFF1FEF; Mon, 4 Jun 2018 16:13:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 0825870077; Mon, 4 Jun 2018 16:13:28 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7430621C9E; Mon, 4 Jun 2018 12:13:28 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Mon, 04 Jun 2018 12:13:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=V5HSJS 3N1Bce2icPITWPBjO582Ab4WlDUy0qChTM4Zk=; b=nWpCLge6V2KnT9ZV3RQ/0h mj6RONcDU7p1DNCzMz636AefjSV5RhIiYe4M0LZeZuTeIGMnKTXGJBgQgUzUE2O1 l6U/JHTR8slej9+Cu49R89gEo+m67pmKMpo3fOit6kvcGJBT/4TgK5YaSWV0uqIw c8/wU9LUte3c+FwzmltFFm8eevGwkMRCi4jTz8qFKf5oU22Cih7Wivnb0u/rDUP5 687lOhP9igXV3FcSojbt87sHzuGg1bEeenYG5My3rORvzFUOIDzGLcCWW54tOEFQ tsaSHdVZjKQkGwKTexUOLIqW8IrU43e53HW7CPYhSWUf1NnBzO8Ch2YJdu3CfOmg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 48E5E9E440; Mon, 4 Jun 2018 12:13:28 -0400 (EDT) Message-Id: <1528128808.975545.1395906040.76213CAC@webmail.messagingengine.com> From: Brad Davis To: Kyle Evans Cc: "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Date: Mon, 04 Jun 2018 10:13:28 -0600 Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: References: <201806041517.w54FHPn0072477@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:13:29 -0000 On Mon, Jun 4, 2018, at 9:22 AM, Kyle Evans wrote: > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > Author: brd > > Date: Mon Jun 4 15:17:24 2018 > > New Revision: 334617 > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > Log: > > Move /sys symlink creating out of etc/Makefile. > > > > This is prep for etc/Makefile going away. > > > > Approved by: bapt (mentor) > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > is? Some of the NO_ROOT stuff there seems to be terribly broken and > needs to be fixed; this was on my 'some day to fix' list. It goes away in favor of using CONFS= and push the config files back to where the src lives for the particular config file. So I would guess that this will fix the NO_ROOT stuff you are referring to, or at least move it to a central location (share/mk/) Regards, Brad Davis From owner-svn-src-head@freebsd.org Mon Jun 4 16:14:46 2018 Return-Path: Delivered-To: svn-src-head@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 66AFEFF21EB; Mon, 4 Jun 2018 16:14:46 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 0E5ED70245; Mon, 4 Jun 2018 16:14:46 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B81A921DA6; Mon, 4 Jun 2018 12:14:45 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Mon, 04 Jun 2018 12:14:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=gxN51m H4y1DcOqotGursH5PtBb1IvJazGp2ckAULYgM=; b=Vcig0JDkm3QXOi/zRzfGEb J3GeEYvVTucF5RNRR/ZLETcrxnXtMKiYWo/iY4crRFWet/iS8Cjj2SL4bxKgLjx7 DA8N/Vgx4QXwBqOrMIGgJeOEydPLY1HMvF3P6sXJUBWpBD3o0YZhbjsDIOewa76L 6Sz95QfiB/oI+tQ+h9+8P4JxLCBWzwOFTN2GvsMsne+xXY7MBe7+toHe/jgHelIw fyVKf1woL148MOulak9pqSVwTz0CU4PZdbYUTN8jfLbVkoVZ/SNy415vGzG6unSK Z0hR4S4bDMY9XGXQ5f57v/WB8oOw5NdSSua00OHq0AU+HupUbHn9UIu0IhCqPGVA == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 6BB759E36D; Mon, 4 Jun 2018 12:14:45 -0400 (EDT) Message-Id: <1528128885.975962.1395907848.00DF7CCB@webmail.messagingengine.com> From: Brad Davis To: rgrimes@freebsd.org, Kyle Evans Cc: "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <201806041529.w54FTLGY096386@pdx.rh.CN85.dnsmgr.net> References: <201806041529.w54FTLGY096386@pdx.rh.CN85.dnsmgr.net> Date: Mon, 04 Jun 2018 10:14:45 -0600 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:14:46 -0000 On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > > Author: brd > > > Date: Mon Jun 4 15:17:24 2018 > > > New Revision: 334617 > > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > > > Log: > > > Move /sys symlink creating out of etc/Makefile. > > > > > > This is prep for etc/Makefile going away. > > > > > > Approved by: bapt (mentor) > > > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > > is? Some of the NO_ROOT stuff there seems to be terribly broken and > > needs to be fixed; this was on my 'some day to fix' list. > > Yes please, much more information here. I use some of the targets > in src/etc/Makefile such as distribution: All the config files need to be pushed back next to the source they belong to. What do you use these targets for? > I believe there are also other external consumers of this. Such as? Regards, Brad Davis From owner-svn-src-head@freebsd.org Mon Jun 4 16:16:18 2018 Return-Path: Delivered-To: svn-src-head@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 8FAC9FF247B for ; Mon, 4 Jun 2018 16:16:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 0466470463 for ; Mon, 4 Jun 2018 16:16:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id d185-v6so10742185ioe.0 for ; Mon, 04 Jun 2018 09:16:18 -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=00x3KuTUqxHFI/Ym8/PsiiNnKPDzpFDFonWI4EIaNnI=; b=buw7xdydwl7v7T8mbYv2ztBUO0yL3Udn26jFTTnPRUCJ2Pc/gOzvqm2bjvjZQ7yj3T Qs7PDtq42fksOIB6biMKZEmnPgF6nXEjIX1r978jiyuTdfWuiE9D2rXlPJtqtyUKely4 rdLgxMhvAo76j8jbodwzhiosDxLN0gdkhn6T3LAwq6q5t900+I17ahdaxA7A8WfWrA9f KQfKW+4u4u+oaQoWIfLkYF3MfWUGj7BqXpG7hmsb7qOrZk7Tg2xNrq3+EDqhw4RVxMuh 6uayw6Nbnrlyb6UkI+1K1gr2Kb/4F/1+Ym0cGwVIDjmM3mkIWU9dN9kEjqPTfTOVjn8x 9wRw== 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=00x3KuTUqxHFI/Ym8/PsiiNnKPDzpFDFonWI4EIaNnI=; b=t4D73U59Q4J4tzgY/UvDuwcYm3N9Y8W3cMUlA6PRIbCS5g3LiXjx4Obp8sgIkYQEae GUiOnhZ++7LiksGSogsyj/I9gF1iRtFiy/POVUdvjSjQXtcfJQd5n2zfNWf7D2uWnGtM v82PpSXyyzKBMWU+isB89DGmXqnY/j6RWJQxHEF1Cav2Uv2Mu8fVelWfI1/lNsgthjLz fPtpbEJ0h3A9x+QEGbggcZsEuEYBcitysVpSPuzHd1qY8a9ToukkLsAQLs+Ss8DJP8Nk 09X0Iks1VmTt4oPEzPnbNSffByhX8pnAjkUeiz1ouLg5zk3zzfYCTzPqY8l70ddTUdHH +KwQ== X-Gm-Message-State: ALKqPwdm+sQ72z+s2MeDgrEyId9Q6CZraM+fqg1hjDXFsG2uJyE6d2vN JAM1rNDcF8bk+/UF1nWxt6qzK7RqeXqGElNFGDzUnw== X-Google-Smtp-Source: ADUXVKKH830U7ELNcLae9/aD/hj+SfNu6S98fS9l+5UsTOy3OVkSMmyTScdnV76ctgIQOaaoEtmZdYHtt6GBz78useE= X-Received: by 2002:a6b:284b:: with SMTP id o72-v6mr21742691ioo.168.1528128977331; Mon, 04 Jun 2018 09:16:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 09:16:16 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201806041513.w54FDMZn096288@pdx.rh.CN85.dnsmgr.net> References: <201806041513.w54FDMZn096288@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 4 Jun 2018 10:16:16 -0600 X-Google-Sender-Auth: S_NxI-uWIvE8qRQC8LewrqAULRQ Message-ID: Subject: Re: svn commit: r334543 - head/usr.bin/top To: "Rodney W. Grimes" Cc: Don Lewis , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:16:18 -0000 On Mon, Jun 4, 2018 at 9:13 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On 2 Jun, Rodney W. Grimes wrote: > > >> Author: eadler > > >> Date: Sat Jun 2 22:06:27 2018 > > >> New Revision: 334543 > > >> URL: https://svnweb.freebsd.org/changeset/base/334543 > > >> > > >> Log: > > >> top(1): chdir to / as init; remove unneeded comment > > >> > > >> - chdir to / to allow unmounting of wd > > >> - remove warning about running top(1) as setuid. If this is a > concern we > > >> should just drop privs instead. > > >> > > >> Modified: > > >> head/usr.bin/top/machine.c > > >> head/usr.bin/top/top.c > > >> > > >> Modified: head/usr.bin/top/machine.c > > >> ============================================================ > ================== > > >> --- head/usr.bin/top/machine.c Sat Jun 2 21:50:00 2018 > (r334542) > > >> +++ head/usr.bin/top/machine.c Sat Jun 2 22:06:27 2018 > (r334543) > > >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void > *arg2) > > >> /* > > >> * proc_owner(pid) - returns the uid that owns process "pid", or -1 > if > > >> * the process does not exist. > > >> - * It is EXTREMELY IMPORTANT that this function work > correctly. > > >> - * If top runs setuid root (as in SVR4), then this > function > > >> - * is the only thing that stands in the way of a > serious > > >> - * security problem. It validates requests for the > "kill" > > >> - * and "renice" commands. > > >> */ > > >> > > >> int > > >> > > >> Modified: head/usr.bin/top/top.c > > >> ============================================================ > ================== > > >> --- head/usr.bin/top/top.c Sat Jun 2 21:50:00 2018 (r334542) > > >> +++ head/usr.bin/top/top.c Sat Jun 2 22:06:27 2018 (r334543) > > >> @@ -260,6 +260,15 @@ main(int argc, char *argv[]) > > >> #define CMD_order 26 > > >> #define CMD_pid 27 > > >> > > >> + /* > > >> + * Since top(1) is often long running and > > >> + * doesn't typically care about where its running from > > >> + * chdir to the root to allow unmounting of its > > >> + * originall wd. Failure is alright as this is > > >> + * just a courtesy for users. > > >> + */ > > >> + chdir("/"); > > >> + > > > > > > Bad side effect of doing that is it is not hard to get a "core" > > > from top when run as a user, as it is going to try to write > > > to /, and it probably does not have permission for that. > > > > > > Better might be a cd to /tmp, or /var/tmp, which are usually > > > hard to unmount for these reasons anyway. > > > > Unless you start top using the exec shell builtin, the shell that you > > use to launch top will also be long running and will also prevent its > > $cwd from being unmounted. > > Thats a good point, so that makes the chdir worthless. Turns out it wasn't completely useless, but the usefulness ended before FreeBSD 1.0 was released. > > If you do use exec, then you will get logged out when you kill top ... > > :-(. > > The long standing (30 years) solution is to use lsof and find > the processes that have cwd's in what ever it is you want to > unmount. > 30 years is a bit too long. lsof didn't exist until 1991. :) The issues that prompted top to cd to / didn't get fixed until SysVr4 / early BSD kernels in the early 90s, and didn't make it into some vendor code until the mid 90's. > Special casing top(1) is just a none solution to the > can not unmount foo problem. > True. It used to be critically important to do. Now, it's irrelevant. I posted a longer version why after doing some research. Basically, through the early System V releases, rebooting was weird and long running processes had to take actions to ensure they didn't accidentally hold references to non / filesystems. That did get fixed by the late 80's / early 90's, so it's pointless these days. I'd misremembered the details over the weekend, so forget I said it was a good change :) Warner From owner-svn-src-head@freebsd.org Mon Jun 4 16:20:23 2018 Return-Path: Delivered-To: svn-src-head@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 B74A4FF2AD2; Mon, 4 Jun 2018 16:20:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 693A270720; Mon, 4 Jun 2018 16:20:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45EEC7C15; Mon, 4 Jun 2018 16:20:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54GKNh2003349; Mon, 4 Jun 2018 16:20:23 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54GKNaG003348; Mon, 4 Jun 2018 16:20:23 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806041620.w54GKNaG003348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 4 Jun 2018 16:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334619 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 334619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:20:23 -0000 Author: br Date: Mon Jun 4 16:20:22 2018 New Revision: 334619 URL: https://svnweb.freebsd.org/changeset/base/334619 Log: Fix build: ignore a GCC 7.2.0 warning which says that third argument of memset(3) should contain the number of elements multiplied by the element size. Sponsored by: DARPA, AFRL Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Jun 4 15:44:17 2018 (r334618) +++ head/sys/conf/kern.mk Mon Jun 4 16:20:22 2018 (r334619) @@ -67,6 +67,9 @@ CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=shift-overflow \ -Wno-error=tautological-compare .endif +.if ${COMPILER_VERSION} >= 70200 +CWARNEXTRA+= -Wno-error=memset-elt-size +.endif .if ${COMPILER_VERSION} >= 80000 CWARNEXTRA+= -Wno-error=packed-not-aligned .endif From owner-svn-src-head@freebsd.org Mon Jun 4 16:21:19 2018 Return-Path: Delivered-To: svn-src-head@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 93362FF2D63; Mon, 4 Jun 2018 16:21:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F33170A2C; Mon, 4 Jun 2018 16:21:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E51927D4C; Mon, 4 Jun 2018 16:21:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54GLIWf004113; Mon, 4 Jun 2018 16:21:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54GLInF004112; Mon, 4 Jun 2018 16:21:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806041621.w54GLInF004112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 4 Jun 2018 16:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334620 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 334620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:21:19 -0000 Author: br Date: Mon Jun 4 16:21:18 2018 New Revision: 334620 URL: https://svnweb.freebsd.org/changeset/base/334620 Log: Sort GCC warning flags and remove duplicates. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Jun 4 16:20:22 2018 (r334619) +++ head/share/mk/bsd.sys.mk Mon Jun 4 16:21:18 2018 (r334620) @@ -141,19 +141,17 @@ CWARNFLAGS+= -Wno-error=misleading-indentation \ # GCC 7.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100 -CWARNFLAGS+= -Wno-error=deprecated \ - -Wno-error=pointer-compare \ +CWARNFLAGS+= -Wno-error=bool-operation \ + -Wno-error=deprecated \ + -Wno-error=expansion-to-defined \ + -Wno-error=format-overflow \ -Wno-error=format-truncation \ -Wno-error=implicit-fallthrough \ - -Wno-error=expansion-to-defined \ -Wno-error=int-in-bool-context \ - -Wno-error=bool-operation \ - -Wno-error=format-overflow \ - -Wno-error=stringop-overflow \ -Wno-error=memset-elt-size \ - -Wno-error=int-in-bool-context \ - -Wno-error=unused-const-variable \ - -Wno-error=nonnull + -Wno-error=nonnull \ + -Wno-error=pointer-compare \ + -Wno-error=stringop-overflow .endif # How to handle FreeBSD custom printf format specifiers. From owner-svn-src-head@freebsd.org Mon Jun 4 16:28:07 2018 Return-Path: Delivered-To: svn-src-head@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 6A628FF3898; Mon, 4 Jun 2018 16:28:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C55171620; Mon, 4 Jun 2018 16:28:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1A1F7DC2; Mon, 4 Jun 2018 16:28:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54GS6f8009366; Mon, 4 Jun 2018 16:28:06 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54GS6Nq009364; Mon, 4 Jun 2018 16:28:06 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201806041628.w54GS6Nq009364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 4 Jun 2018 16:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334621 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 334621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:28:07 -0000 Author: alc Date: Mon Jun 4 16:28:06 2018 New Revision: 334621 URL: https://svnweb.freebsd.org/changeset/base/334621 Log: Use a single, consistent approach to returning success versus failure in vm_map_madvise(). Previously, vm_map_madvise() used a traditional Unix- style "return (0);" to indicate success in the common case, but Mach- style return values in the edge cases. Since KERN_SUCCESS equals zero, the only problem with this inconsistency was stylistic. vm_map_madvise() has exactly two callers in the entire source tree, and only one of them cares about the return value. That caller, kern_madvise(), can be simplified if vm_map_madvise() consistently uses Unix-style return values. Since vm_map_madvise() uses the variable modify_map as a Boolean, make it one. Eliminate a redundant error check from kern_madvise(). Add a comment explaining where the check is performed. Explicitly note that exec_release_args_kva() doesn't care about vm_map_madvise()'s return value. Since MADV_FREE is passed as the behavior, the return value will always be zero. Reviewed by: kib, markj MFC after: 7 days Modified: head/sys/kern/kern_exec.c head/sys/vm/vm_map.c head/sys/vm/vm_mmap.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Jun 4 16:21:18 2018 (r334620) +++ head/sys/kern/kern_exec.c Mon Jun 4 16:28:06 2018 (r334621) @@ -1380,7 +1380,7 @@ exec_release_args_kva(struct exec_args_kva *argkva, u_ base = argkva->addr; if (argkva->gen != gen) { - vm_map_madvise(exec_map, base, base + exec_map_entry_size, + (void)vm_map_madvise(exec_map, base, base + exec_map_entry_size, MADV_FREE); argkva->gen = gen; } Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jun 4 16:21:18 2018 (r334620) +++ head/sys/vm/vm_map.c Mon Jun 4 16:28:06 2018 (r334621) @@ -2215,7 +2215,7 @@ vm_map_madvise( int behav) { vm_map_entry_t current, entry; - int modify_map = 0; + bool modify_map; /* * Some madvise calls directly modify the vm_map_entry, in which case @@ -2232,19 +2232,20 @@ vm_map_madvise( case MADV_NOCORE: case MADV_CORE: if (start == end) - return (KERN_SUCCESS); - modify_map = 1; + return (0); + modify_map = true; vm_map_lock(map); break; case MADV_WILLNEED: case MADV_DONTNEED: case MADV_FREE: if (start == end) - return (KERN_SUCCESS); + return (0); + modify_map = false; vm_map_lock_read(map); break; default: - return (KERN_INVALID_ARGUMENT); + return (EINVAL); } /* Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 4 16:21:18 2018 (r334620) +++ head/sys/vm/vm_mmap.c Mon Jun 4 16:28:06 2018 (r334621) @@ -683,11 +683,6 @@ kern_madvise(struct thread *td, uintptr_t addr0, size_ } /* - * Check for illegal behavior - */ - if (behav < 0 || behav > MADV_CORE) - return (EINVAL); - /* * Check for illegal addresses. Watch out for address wrap... Note * that VM_*_ADDRESS are not constants due to casts (argh). */ @@ -705,9 +700,10 @@ kern_madvise(struct thread *td, uintptr_t addr0, size_ start = trunc_page(addr); end = round_page(addr + len); - if (vm_map_madvise(map, start, end, behav)) - return (EINVAL); - return (0); + /* + * vm_map_madvise() checks for illegal values of behav. + */ + return (vm_map_madvise(map, start, end, behav)); } #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-head@freebsd.org Mon Jun 4 16:46:37 2018 Return-Path: Delivered-To: svn-src-head@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 95560FF520D; Mon, 4 Jun 2018 16:46:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 436B7722A1; Mon, 4 Jun 2018 16:46:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE9F100E7; Mon, 4 Jun 2018 16:46:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54Gka20019720; Mon, 4 Jun 2018 16:46:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54GkaaW019719; Mon, 4 Jun 2018 16:46:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041646.w54GkaaW019719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 16:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334622 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:46:37 -0000 Author: markj Date: Mon Jun 4 16:46:36 2018 New Revision: 334622 URL: https://svnweb.freebsd.org/changeset/base/334622 Log: Correct the description of vm_pageout_scan_inactive() after r334508. Reported by: alc Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Jun 4 16:28:06 2018 (r334621) +++ head/sys/vm/vm_pageout.c Mon Jun 4 16:46:36 2018 (r334622) @@ -1347,9 +1347,8 @@ vm_pageout_reinsert_inactive(struct scan_state *ss, st } /* - * Attempt to reclaim the requested number of pages. Returns true if pass was - * zero or enough pages were freed by the inactive queue scan to meet the - * target. + * Attempt to reclaim the requested number of pages from the inactive queue. + * Returns true if the shortage was addressed. */ static int vm_pageout_scan_inactive(struct vm_domain *vmd, int shortage, From owner-svn-src-head@freebsd.org Mon Jun 4 16:57:47 2018 Return-Path: Delivered-To: svn-src-head@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 DD283FF6246; Mon, 4 Jun 2018 16:57:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5705572AB1; Mon, 4 Jun 2018 16:57:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54Gvh7W096753; Mon, 4 Jun 2018 09:57:43 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54GvhCj096752; Mon, 4 Jun 2018 09:57:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041657.w54GvhCj096752@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <1528128885.975962.1395907848.00DF7CCB@webmail.messagingengine.com> To: Brad Davis Date: Mon, 4 Jun 2018 09:57:43 -0700 (PDT) CC: rgrimes@FreeBSD.org, Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 16:57:48 -0000 > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > > > Author: brd > > > > Date: Mon Jun 4 15:17:24 2018 > > > > New Revision: 334617 > > > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > > > > > Log: > > > > Move /sys symlink creating out of etc/Makefile. > > > > > > > > This is prep for etc/Makefile going away. > > > > > > > > Approved by: bapt (mentor) > > > > > > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and > > > needs to be fixed; this was on my 'some day to fix' list. > > > > Yes please, much more information here. I use some of the targets > > in src/etc/Makefile such as distribution: > > All the config files need to be pushed back next to the source they belong to. That is fine, but there is stuff other than config files, how do you plan to handle that? > What do you use these targets for? Building custom installation sets, building nfs shares. > > > I believe there are also other external consumers of this. > > Such as? Iirc some of the make release stuff calls into here, but that may of changed to use src/Makefile targets. distrib-dirs comes to mind. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 17:27:23 2018 Return-Path: Delivered-To: svn-src-head@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 93373FD0E5C; Mon, 4 Jun 2018 17:27:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3857273E60; Mon, 4 Jun 2018 17:27:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id EFBA215A0E; Mon, 4 Jun 2018 17:27:22 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f44.google.com with SMTP id a195-v6so11149442itd.3; Mon, 04 Jun 2018 10:27:22 -0700 (PDT) X-Gm-Message-State: APt69E3SPneTNzGFpf1z8od8yhkshRWHDzpPbIrHzHkUaSchbpV4PhNW KdDCI5hcKFXSt1zcyZiCvjXAqcmDDbg9qVabR/I= X-Google-Smtp-Source: ADUXVKLxRCist7z9YMBrnILYA8Bq5QLkevHcSz2L4e6jG0i+knWfqqk2MTEaabhGcF+x5zVYljOJJGoQONhq+x/B3To= X-Received: by 2002:a24:6c8a:: with SMTP id w132-v6mr11458507itb.4.1528133242320; Mon, 04 Jun 2018 10:27:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 10:27:21 -0700 (PDT) In-Reply-To: <20180604120815.GB2450@kib.kiev.ua> References: <201806040110.w541ANZr044727@repo.freebsd.org> <20180604120815.GB2450@kib.kiev.ua> From: Matthew Macy Date: Mon, 4 Jun 2018 10:27:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 17:27:23 -0000 On Mon, Jun 4, 2018 at 5:08 AM, Konstantin Belousov wrote: > On Mon, Jun 04, 2018 at 01:10:23AM +0000, Matt Macy wrote: >> @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void >> >> pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR, >> (struct trapframe *) arg); >> + >> + KASSERT(td->td_pinned == 1, >> + ("[pmc,%d] invalid td_pinned value", __LINE__)); >> + sched_unpin(); /* Can migrate safely now. */ > sched_pin() is called from pmc_post_callchain_callback(), which is > called from userret(). userret() is executed with interrupts and > preemption enabled, so there is a non-trivial chance that the thread > already migrated. > > In fact, I do not see a need to disable migration for the thread if user > callchain is planned to be gathered. You only need to remember the cpu > where the interrupt occured, to match it against the request. Or are > per-cpu PMC registers still accessed during callchain collection ? The buffers are pcpu. Although it would in principle be safe in this case since I don't modify the read/write indices. However, I'd have to add another field for the CPU and it doesn't handle the case of multiple migrations. > >> +int >> +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, >> + int inuserspace) >> +{ >> + struct thread *td; >> + >> + td = curthread; >> + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && >> + td && td->td_proc && >> + (td->td_proc->p_flag & P_KPROC) == 0 && >> + !inuserspace) { > I am curious why a lot of the pmc code checks for curthread != NULL and, > like this fragment, for curproc != NULL. I am sure that at least on x86, > we never let curthread point to the garbage, even during the context > switches. NMI handler has the same cargo-cult check, BTW. I didn't think they could be NULL, but have been cargo culting the existing code. > Also, please fix the indentation of the conditions block. > >> + atomic_add_int(&curthread->td_pmcpend, 1); > You can use atomic_store_int() there, I believe, Then there would be > no locked op executed at all, on x86. Storing a 1 would enable me to early terminate the loop. > >> @@ -375,6 +375,7 @@ struct thread { >> void *td_lkpi_task; /* LinuxKPI task struct pointer */ >> TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ >> epoch_section_t td_epoch_section; /* (t) epoch section object */ >> + int td_pmcpend; > Why this member was not put into the zeroed region ? Wouldn't a garbage > there cause uneccessary ASTs ? It would cause _1_ unnecessary check for callchains after initial creation. Putting it in the zero area would break the ABI. From owner-svn-src-head@freebsd.org Mon Jun 4 17:49:35 2018 Return-Path: Delivered-To: svn-src-head@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 705B4FD4430; Mon, 4 Jun 2018 17:49:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2255574E6D; Mon, 4 Jun 2018 17:49:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F310A10A7D; Mon, 4 Jun 2018 17:49:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54HnYLj050515; Mon, 4 Jun 2018 17:49:34 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54HnYcO050514; Mon, 4 Jun 2018 17:49:34 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806041749.w54HnYcO050514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 17:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334623 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 17:49:35 -0000 Author: mmacy Date: Mon Jun 4 17:49:34 2018 New Revision: 334623 URL: https://svnweb.freebsd.org/changeset/base/334623 Log: hwpmc: remove gratuitous curthread checks Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 4 16:46:36 2018 (r334622) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 4 17:49:34 2018 (r334623) @@ -4647,16 +4647,12 @@ pmc_add_sample(int cpu, int ring, struct pmc *pm, stru counter_u64_add(pm->pm_runcount, 1); /* hold onto PMC */ + td = curthread; ps->ps_pmc = pm; - ps->ps_pid = -1; - ps->ps_tid = -1; - if ((td = curthread) != NULL) { - ps->ps_tid = td->td_tid; - if (td->td_proc) - ps->ps_pid = td->td_proc->p_pid; - } - ps->ps_cpu = cpu; ps->ps_td = td; + ps->ps_pid = td->td_proc->p_pid; + ps->ps_tid = td->td_tid; + ps->ps_cpu = cpu; ps->ps_flags = inuserspace ? PMC_CC_F_USERSPACE : 0; callchaindepth = (pm->pm_flags & PMC_F_CALLCHAIN) ? @@ -4715,9 +4711,8 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p td = curthread; if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && - td && td->td_proc && - (td->td_proc->p_flag & P_KPROC) == 0 && - !inuserspace) { + (td->td_proc->p_flag & P_KPROC) == 0 && + !inuserspace) { atomic_add_int(&curthread->td_pmcpend, 1); return (pmc_add_sample(cpu, PMC_UR, pm, tf, 0)); } From owner-svn-src-head@freebsd.org Mon Jun 4 18:41:03 2018 Return-Path: Delivered-To: svn-src-head@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 2792CFE04F7; Mon, 4 Jun 2018 18:41:03 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 C8FCD7ECBF; Mon, 4 Jun 2018 18:41:02 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 65C7621E32; Mon, 4 Jun 2018 14:41:02 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Mon, 04 Jun 2018 14:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=cT9AnU Ih3LezOIqQB1gsdQ6usAzEHPNnb88xWvZU+To=; b=Y7gVjIwRdxItW1OlscHcEM JDS1kJMebJ6ZvS6RYcUVLBHx/T/WDF1wELJctX7Gvht6mRuSEwsYp9UE//bFd/QF WmBy5VBzUf5VZsUthC8Q4+EdLFdm6+o/xl/e7VfcmmtkB7Zw30+eWsnTC6J9o+ff WhKJ/nuuDCfw24EdxUV72CaEaaCn3Klujfwuyu6kqd+LtrWv0IKtjUraisf+nn47 LViHEigHzJt2dx140zL0Hh14DNUak75DOts/GAiUlS0J5SQGs+qwXUkZbuwPFMI+ rDwEdruPfPgw/LQJBdJe7qaWE3JpNqvEB6Q+EJweLtSVneGl89ixr87A+pqXlz6A == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 33BD79E36D; Mon, 4 Jun 2018 14:41:02 -0400 (EDT) Message-Id: <1528137662.1039856.1396087184.58D9A41E@webmail.messagingengine.com> From: Brad Davis To: rgrimes@FreeBSD.org Cc: Kyle Evans , "src-committers" , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea References: <201806041657.w54GvhCj096752@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <201806041657.w54GvhCj096752@pdx.rh.CN85.dnsmgr.net> Date: Mon, 04 Jun 2018 12:41:02 -0600 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 18:41:03 -0000 On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > > > > Author: brd > > > > > Date: Mon Jun 4 15:17:24 2018 > > > > > New Revision: 334617 > > > > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > > > > > > > Log: > > > > > Move /sys symlink creating out of etc/Makefile. > > > > > > > > > > This is prep for etc/Makefile going away. > > > > > > > > > > Approved by: bapt (mentor) > > > > > > > > > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and > > > > needs to be fixed; this was on my 'some day to fix' list. > > > > > > Yes please, much more information here. I use some of the targets > > > in src/etc/Makefile such as distribution: > > > > All the config files need to be pushed back next to the source they belong to. > > That is fine, but there is stuff other than config files, how do you plan > to handle that? Moving them as appropriate just like the above.. > > What do you use these targets for? > > Building custom installation sets, building nfs shares. OK, what commands specifically are you calling in etc/ directly and why? I would expect the targets in the root of the src tree would handle that stuff for you? > > > I believe there are also other external consumers of this. > > > > Such as? > > Iirc some of the make release stuff calls into here, but that > may of changed to use src/Makefile targets. distrib-dirs comes > to mind. Sure, but those can go away or be updated as needed.. Regards, Brad Davis From owner-svn-src-head@freebsd.org Mon Jun 4 18:47:15 2018 Return-Path: Delivered-To: svn-src-head@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 98BA2FE11DB; Mon, 4 Jun 2018 18:47:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2B77F32F; Mon, 4 Jun 2018 18:47:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29CE1114BE; Mon, 4 Jun 2018 18:47:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54IlFfR095422; Mon, 4 Jun 2018 18:47:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54IlEnb095421; Mon, 4 Jun 2018 18:47:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806041847.w54IlEnb095421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 4 Jun 2018 18:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334624 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 334624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 18:47:15 -0000 Author: cem Date: Mon Jun 4 18:47:14 2018 New Revision: 334624 URL: https://svnweb.freebsd.org/changeset/base/334624 Log: str(r)chr: Replace union abuse with __DECONST Writing one union member and reading another is technically illegal C, although we do it in many places in the tree. Use the __DECONST macro instead, which is (technically) a valid C construct. Trivial style(9) cleanups to touched lines while here. Sponsored by: Dell EMC Isilon Modified: head/sys/libkern/strchr.c head/sys/libkern/strrchr.c Modified: head/sys/libkern/strchr.c ============================================================================== --- head/sys/libkern/strchr.c Mon Jun 4 17:49:34 2018 (r334623) +++ head/sys/libkern/strchr.c Mon Jun 4 18:47:14 2018 (r334624) @@ -36,19 +36,16 @@ __FBSDID("$FreeBSD$"); #include char * -strchr(const char *p, int ch) +strchr(const char *cp, int ch) { - union { - const char *cp; - char *p; - } u; + char *p; - u.cp = p; - for (;; ++u.p) { - if (*u.p == ch) - return(u.p); - if (*u.p == '\0') - return(NULL); + p = __DECONST(char *, cp); + for (;; ++p) { + if (*p == ch) + return (p); + if (*p == '\0') + return (NULL); } /* NOTREACHED */ } Modified: head/sys/libkern/strrchr.c ============================================================================== --- head/sys/libkern/strrchr.c Mon Jun 4 17:49:34 2018 (r334623) +++ head/sys/libkern/strrchr.c Mon Jun 4 18:47:14 2018 (r334624) @@ -36,20 +36,16 @@ __FBSDID("$FreeBSD$"); #include char * -strrchr(const char *p, int ch) +strrchr(const char *cp, int ch) { - union { - const char *cp; - char *p; - } u; - char *save; + char *p, *save; - u.cp = p; - for (save = NULL;; ++u.p) { - if (*u.p == ch) - save = u.p; - if (*u.p == '\0') - return(save); + p = __DECONST(char *, cp); + for (save = NULL;; ++p) { + if (*p == ch) + save = p; + if (*p == '\0') + return (save); } /* NOTREACHED */ } From owner-svn-src-head@freebsd.org Mon Jun 4 18:47:16 2018 Return-Path: Delivered-To: svn-src-head@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 AB071FE11E2; Mon, 4 Jun 2018 18:47:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123747F330; Mon, 4 Jun 2018 18:47:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w54IlCdL097085; Mon, 4 Jun 2018 11:47:12 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w54IlCUu097084; Mon, 4 Jun 2018 11:47:12 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <1528137662.1039856.1396087184.58D9A41E@webmail.messagingengine.com> To: Brad Davis Date: Mon, 4 Jun 2018 11:47:12 -0700 (PDT) CC: rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 18:47:16 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > > > > > Author: brd > > > > > > Date: Mon Jun 4 15:17:24 2018 > > > > > > New Revision: 334617 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > > > > > > > > > Log: > > > > > > Move /sys symlink creating out of etc/Makefile. > > > > > > > > > > > > This is prep for etc/Makefile going away. > > > > > > > > > > > > Approved by: bapt (mentor) > > > > > > > > > > > > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > > > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and > > > > > needs to be fixed; this was on my 'some day to fix' list. > > > > > > > > Yes please, much more information here. I use some of the targets > > > > in src/etc/Makefile such as distribution: > > > > > > All the config files need to be pushed back next to the source they belong to. > > > > That is fine, but there is stuff other than config files, how do you plan > > to handle that? > > Moving them as appropriate just like the above.. So another words you have no plan yet? > > > What do you use these targets for? > > > > Building custom installation sets, building nfs shares. > > OK, what commands specifically are you calling in etc/ directly and why? I said in my first reply specifically distribution: > > I would expect the targets in the root of the src tree would handle that stuff for you? hierarchy: may > > > > I believe there are also other external consumers of this. > > > > > > Such as? > > > > Iirc some of the make release stuff calls into here, but that > > may of changed to use src/Makefile targets. distrib-dirs comes > > to mind. > > Sure, but those can go away or be updated as needed.. So again, no plan yet? > Regards, > Brad Davis -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jun 4 18:51:07 2018 Return-Path: Delivered-To: svn-src-head@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 8AA27FE1865; Mon, 4 Jun 2018 18:51:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 417787F776; Mon, 4 Jun 2018 18:51:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C4D115F2; Mon, 4 Jun 2018 18:51:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54Ip77V095616; Mon, 4 Jun 2018 18:51:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54Ip7Zn095615; Mon, 4 Jun 2018 18:51:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806041851.w54Ip7Zn095615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 4 Jun 2018 18:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334625 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 334625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 18:51:07 -0000 Author: cem Date: Mon Jun 4 18:51:06 2018 New Revision: 334625 URL: https://svnweb.freebsd.org/changeset/base/334625 Log: Correctly handle the padding for IPv6-AH, as specified by RFC4302 The RFC specifies that under IPv6 the complete AH header must be 64 bit aligned, and under IPv4, 32 bit aligned. Prior to this change, we (along with other BSDs and MacOS) had violated this requirement. This makes it possible to set up IPv6-AH between Linux and BSD, and also probably between Windows and BSD. PR: 222684 Reported and tested by: Jason Mader Obtained from: NetBSD xform_ah.c 1.105 (b939fe2483972eb43d71bf990cfb7f26dece7839 NetBSD/src on GH) by Maxime Villard MFC after: 35.2731 hours Relnotes: probably (breaks ipv6 compat with older FreeBSD/NetBSD/MacOS) Sponsored by: Dell EMC Isilon Modified: head/sys/netipsec/xform_ah.c Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Mon Jun 4 18:47:14 2018 (r334624) +++ head/sys/netipsec/xform_ah.c Mon Jun 4 18:51:06 2018 (r334625) @@ -147,11 +147,21 @@ ah_hdrsiz(struct secasvar *sav) size_t size; if (sav != NULL) { - int authsize; + int authsize, rplen, align; + IPSEC_ASSERT(sav->tdb_authalgxform != NULL, ("null xform")); /*XXX not right for null algorithm--does it matter??*/ + + /* RFC4302: use the correct alignment. */ + align = sizeof(uint32_t); +#ifdef INET6 + if (sav->sah->saidx.dst.sa.sa_family == AF_INET6) { + align = sizeof(uint64_t); + } +#endif + rplen = HDRSIZE(sav); authsize = AUTHSIZE(sav); - size = roundup(authsize, sizeof (u_int32_t)) + HDRSIZE(sav); + size = roundup(rplen + authsize, align); } else { /* default guess */ size = sizeof (struct ah) + sizeof (u_int32_t) + 16; @@ -535,7 +545,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski struct xform_data *xd; struct newah *ah; uint64_t cryptoid; - int hl, rplen, authsize, error; + int hl, rplen, authsize, ahsize, error; IPSEC_ASSERT(sav != NULL, ("null SA")); IPSEC_ASSERT(sav->key_auth != NULL, ("null authentication key")); @@ -569,23 +579,24 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski SECASVAR_UNLOCK(sav); /* Verify AH header length. */ - hl = ah->ah_len * sizeof (u_int32_t); + hl = sizeof(struct ah) + (ah->ah_len * sizeof (u_int32_t)); ahx = sav->tdb_authalgxform; authsize = AUTHSIZE(sav); - if (hl != authsize + rplen - sizeof (struct ah)) { + ahsize = ah_hdrsiz(sav); + if (hl != ahsize) { DPRINTF(("%s: bad authenticator length %u (expecting %lu)" " for packet in SA %s/%08lx\n", __func__, hl, - (u_long) (authsize + rplen - sizeof (struct ah)), + (u_long)ahsize, ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_badauthl); error = EACCES; goto bad; } - if (skip + authsize + rplen > m->m_pkthdr.len) { + if (skip + ahsize > m->m_pkthdr.len) { DPRINTF(("%s: bad mbuf length %u (expecting %lu)" " for packet in SA %s/%08lx\n", __func__, - m->m_pkthdr.len, (u_long) (skip + authsize + rplen), + m->m_pkthdr.len, (u_long)(skip + ahsize), ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_badauthl); @@ -689,7 +700,7 @@ ah_input_cb(struct cryptop *crp) struct secasindex *saidx; caddr_t ptr; uint64_t cryptoid; - int authsize, rplen, error, skip, protoff; + int authsize, rplen, ahsize, error, skip, protoff; uint8_t nxt; m = (struct mbuf *) crp->crp_buf; @@ -736,6 +747,7 @@ ah_input_cb(struct cryptop *crp) /* Figure out header size. */ rplen = HDRSIZE(sav); authsize = AUTHSIZE(sav); + ahsize = ah_hdrsiz(sav); /* Copy authenticator off the packet. */ m_copydata(m, skip + rplen, authsize, calc); @@ -784,7 +796,7 @@ ah_input_cb(struct cryptop *crp) /* * Remove the AH header and authenticator from the mbuf. */ - error = m_striphdr(m, skip, rplen + authsize); + error = m_striphdr(m, skip, ahsize); if (error) { DPRINTF(("%s: mangled mbuf chain for SA %s/%08lx\n", __func__, ipsec_address(&saidx->dst, buf, sizeof(buf)), @@ -839,7 +851,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct struct newah *ah; uint64_t cryptoid; uint16_t iplen; - int error, rplen, authsize, maxpacketsize, roff; + int error, rplen, authsize, ahsize, maxpacketsize, roff; uint8_t prot; IPSEC_ASSERT(sav != NULL, ("null SA")); @@ -850,6 +862,8 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct /* Figure out header size. */ rplen = HDRSIZE(sav); + authsize = AUTHSIZE(sav); + ahsize = ah_hdrsiz(sav); /* Check for maximum packet size violations. */ switch (sav->sah->saidx.dst.sa.sa_family) { @@ -873,13 +887,12 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct error = EPFNOSUPPORT; goto bad; } - authsize = AUTHSIZE(sav); - if (rplen + authsize + m->m_pkthdr.len > maxpacketsize) { + if (ahsize + m->m_pkthdr.len > maxpacketsize) { DPRINTF(("%s: packet in SA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi), - rplen + authsize + m->m_pkthdr.len, maxpacketsize)); + ahsize + m->m_pkthdr.len, maxpacketsize)); AHSTAT_INC(ahs_toobig); error = EMSGSIZE; goto bad; @@ -899,11 +912,10 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct } /* Inject AH header. */ - mi = m_makespace(m, skip, rplen + authsize, &roff); + mi = m_makespace(m, skip, ahsize, &roff); if (mi == NULL) { DPRINTF(("%s: failed to inject %u byte AH header for SA " - "%s/%08lx\n", __func__, - rplen + authsize, + "%s/%08lx\n", __func__, ahsize, ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)), (u_long) ntohl(sav->spi))); AHSTAT_INC(ahs_hdrops); /*XXX differs from openbsd */ @@ -919,13 +931,17 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct /* Initialize the AH header. */ m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &ah->ah_nxt); - ah->ah_len = (rplen + authsize - sizeof(struct ah)) / sizeof(u_int32_t); + ah->ah_len = (ahsize - sizeof(struct ah)) / sizeof(u_int32_t); ah->ah_reserve = 0; ah->ah_spi = sav->spi; /* Zeroize authenticator. */ m_copyback(m, skip + rplen, authsize, ipseczeroes); + /* Zeroize padding */ + m_copyback(m, skip + rplen + authsize, ahsize - (rplen + authsize), + ipseczeroes); + /* Insert packet replay counter, as requested. */ SECASVAR_LOCK(sav); if (sav->replay) { @@ -994,7 +1010,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct bcopy(((caddr_t)(xd + 1)) + offsetof(struct ip, ip_len), (caddr_t) &iplen, sizeof(u_int16_t)); - iplen = htons(ntohs(iplen) + rplen + authsize); + iplen = htons(ntohs(iplen) + ahsize); m_copyback(m, offsetof(struct ip, ip_len), sizeof(u_int16_t), (caddr_t) &iplen); break; @@ -1005,7 +1021,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct bcopy(((caddr_t)(xd + 1)) + offsetof(struct ip6_hdr, ip6_plen), (caddr_t) &iplen, sizeof(uint16_t)); - iplen = htons(ntohs(iplen) + rplen + authsize); + iplen = htons(ntohs(iplen) + ahsize); m_copyback(m, offsetof(struct ip6_hdr, ip6_plen), sizeof(uint16_t), (caddr_t) &iplen); break; From owner-svn-src-head@freebsd.org Mon Jun 4 18:55:52 2018 Return-Path: Delivered-To: svn-src-head@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 D2304FE22EB; Mon, 4 Jun 2018 18:55:51 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 6FFDE7FF13; Mon, 4 Jun 2018 18:55:51 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 111B621E33; Mon, 4 Jun 2018 14:55:51 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute5.internal (MEProxy); Mon, 04 Jun 2018 14:55:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=NbwjhJ To45ayxUxHnBZ8RZt3Bq6lq5C06wk4M3LDd8U=; b=HJGmjUxDFYT7zjPVunp46U x7qZLWGObnrhIbomeqtn7ID48HTRdr2Ah2wdtfyCyrvLxTuVAuUUbWvC5AS2rMiX 2mbcloAJ001ZVk+amicv3JFnFrjSrlSBuSobzb52yQv+zKcRqtogYvUeayWUVfO6 bC9y/+vCXqfCuxq0+WRhem9qxuo2q/nXhdSnjCxzVgRPqTSRoLwCWk+mvRgTGMQ5 YaERc/LYi3uBFYclM+WxtAxRZO0IwYrYuL2Vksb671Xo8vqWE+TPiPE6Uf5xirLH vdFpiMKRAi5RUc0LlfcEBsgsCqNwF54+EpzVbQoyvqruX8VvZLsWeHjqozzhGU9w == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id D040D9E0F0; Mon, 4 Jun 2018 14:55:50 -0400 (EDT) Message-Id: <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> From: Brad Davis To: rgrimes@freebsd.org Cc: Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea In-Reply-To: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> Date: Mon, 04 Jun 2018 12:55:50 -0600 References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 18:55:52 -0000 On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis wrote: > > > > > > > Author: brd > > > > > > > Date: Mon Jun 4 15:17:24 2018 > > > > > > > New Revision: 334617 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > > > > > > > > > > > Log: > > > > > > > Move /sys symlink creating out of etc/Makefile. > > > > > > > > > > > > > > This is prep for etc/Makefile going away. > > > > > > > > > > > > > > Approved by: bapt (mentor) > > > > > > > > > > > > > > > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile > > > > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and > > > > > > needs to be fixed; this was on my 'some day to fix' list. > > > > > > > > > > Yes please, much more information here. I use some of the targets > > > > > in src/etc/Makefile such as distribution: > > > > > > > > All the config files need to be pushed back next to the source they belong to. > > > > > > That is fine, but there is stuff other than config files, how do you plan > > > to handle that? > > > > Moving them as appropriate just like the above.. > > So another words you have no plan yet? It is largely done here: https://github.com/brd/freebsd/tree/etc-DIR/etc I am working on stragglers.. > > > > What do you use these targets for? > > > > > > Building custom installation sets, building nfs shares. > > > > OK, what commands specifically are you calling in etc/ directly and why? > > I said in my first reply specifically distribution: > > > > > I would expect the targets in the root of the src tree would handle that stuff for you? > > hierarchy: may But why do you run them yourself? > > > > > I believe there are also other external consumers of this. > > > > > > > > Such as? > > > > > > Iirc some of the make release stuff calls into here, but that > > > may of changed to use src/Makefile targets. distrib-dirs comes > > > to mind. > > > > Sure, but those can go away or be updated as needed.. > > So again, no plan yet? Most of them are gone, I am still in progress on some of it. See the github branch above. My testing is all done by building release VMs and comparing them against a VM built from the last merge from HEAD. So I will update the release stuff as I go. It is my responsibility to keep the release stuff working as I change these. Regards, Brad Davis From owner-svn-src-head@freebsd.org Mon Jun 4 19:35:21 2018 Return-Path: Delivered-To: svn-src-head@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 1F1ACFE5D3F; Mon, 4 Jun 2018 19:35:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5E75817E7; Mon, 4 Jun 2018 19:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3ECC11CC7; Mon, 4 Jun 2018 19:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54JZKQZ020764; Mon, 4 Jun 2018 19:35:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54JZFsF020741; Mon, 4 Jun 2018 19:35:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041935.w54JZFsF020741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 19:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys lib/libc/powerpc64 lib/li... X-SVN-Commit-Revision: 334626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 19:35:21 -0000 Author: markj Date: Mon Jun 4 19:35:15 2018 New Revision: 334626 URL: https://svnweb.freebsd.org/changeset/base/334626 Log: Reimplement brk() and sbrk() to avoid the use of _end. Previously, libc.so would initialize its notion of the break address using _end, a special symbol emitted by the static linker following the bss section. Compatibility issues between lld and ld.bfd could cause the wrong definition of _end (libc.so's definition rather than that of the executable) to be used, breaking the brk()/sbrk() interface. Avoid this problem and future interoperability issues by simply not relying on _end. Instead, modify the break() system call to return the kernel's view of the current break address, and have libc initialize its state using an extra syscall upon the first use of the interface. As a side effect, this appears to fix brk()/sbrk() usage in executables run with rtld direct exec, since the kernel and libc.so no longer maintain separate views of the process' break address. PR: 228574 Reviewed by: kib (previous version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D15663 Added: head/lib/libc/sys/brk.c (contents, props changed) head/lib/libc/tests/sys/brk_test.c (contents, props changed) Deleted: head/lib/libc/amd64/sys/brk.S head/lib/libc/amd64/sys/sbrk.S head/lib/libc/arm/sys/brk.S head/lib/libc/arm/sys/sbrk.S head/lib/libc/i386/sys/brk.S head/lib/libc/i386/sys/sbrk.S head/lib/libc/mips/sys/brk.S head/lib/libc/mips/sys/sbrk.S head/lib/libc/powerpc/sys/brk.S head/lib/libc/powerpc/sys/sbrk.S head/lib/libc/powerpc64/sys/brk.S head/lib/libc/powerpc64/sys/sbrk.S head/lib/libc/sparc64/sys/brk.S head/lib/libc/sparc64/sys/sbrk.S Modified: head/lib/libc/amd64/Symbol.map head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/Symbol.map head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/Symbol.map head/lib/libc/i386/sys/Makefile.inc head/lib/libc/mips/Symbol.map head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/Symbol.map head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc head/lib/libc/sparc64/Symbol.map head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libc/sys/brk.2 head/lib/libc/tests/sys/Makefile head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/vm/vm_unix.c Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/amd64/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -63,7 +63,6 @@ FBSDprivate_1.0 { signalcontext; __siglongjmp; _brk; - _end; __sys_vfork; _vfork; }; Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/amd64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -8,7 +8,7 @@ SRCS+= \ amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S +MDASM= vfork.S cerror.S getcontext.S # Don't generate default code for these syscalls: -NOASM+= vfork.o +NOASM+= sbrk.o vfork.o Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/arm/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -58,7 +58,6 @@ FBSDprivate_1.0 { __sys_vfork; _vfork; _brk; - _end; _sbrk; _libc_arm_fpu_present; Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/arm/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S +MDASM= Ovfork.S cerror.S syscall.S # Don't generate default code for these syscalls: -NOASM+= vfork.o +NOASM+= sbrk.o vfork.o Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/i386/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -61,6 +61,5 @@ FBSDprivate_1.0 { __siglongjmp; __sys_vfork; _vfork; - _end; _brk; }; Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/i386/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -7,9 +7,9 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S syscall.S +MDASM= Ovfork.S cerror.S getcontext.S syscall.S -NOASM+= vfork.o +NOASM+= sbrk.o vfork.o MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 MAN+= i386_set_watch.3 Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/mips/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -50,7 +50,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_vfork; _vfork; - _end; _brk; _sbrk; }; Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/mips/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -2,7 +2,7 @@ SRCS+= trivial-vdso_tc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S +MDASM= Ovfork.S cerror.S syscall.S # Don't generate default code for these syscalls: -NOASM+= vfork.o +NOASM+= sbrk.o vfork.o Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/powerpc/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -54,5 +54,4 @@ FBSDprivate_1.0 { signalcontext; __signalcontext; __syncicache; - _end; }; Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/powerpc/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S sbrk.S +MDASM+= cerror.S Modified: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- head/lib/libc/powerpc64/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/powerpc64/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -50,5 +50,4 @@ FBSDprivate_1.0 { signalcontext; __signalcontext; __syncicache; - _end; }; Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/powerpc64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S sbrk.S +MDASM+= cerror.S Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/riscv/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -7,4 +7,4 @@ MDASM= cerror.S \ vfork.S # Don't generate default code for these syscalls: -NOASM+= vfork.o +NOASM+= sbrk.o vfork.o Modified: head/lib/libc/sparc64/Symbol.map ============================================================================== --- head/lib/libc/sparc64/Symbol.map Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/sparc64/Symbol.map Mon Jun 4 19:35:15 2018 (r334626) @@ -81,7 +81,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_brk; _brk; - _end; __sys_sbrk; _sbrk; __sys_vfork; Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/sparc64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S sbrk.S sigaction1.S +MDASM+= cerror.S sigaction1.S Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/sys/Makefile.inc Mon Jun 4 19:35:15 2018 (r334626) @@ -17,8 +17,7 @@ # While historically machine dependent, all architectures have the following # declarations in common: # -NOASM= break.o \ - exit.o \ +NOASM= exit.o \ getlogin.o \ sstk.o \ yield.o @@ -45,6 +44,7 @@ SRCS+= getdirentries.c NOASM+= getdirentries.o PSEUDO+= _getdirentries.o +SRCS+= brk.c SRCS+= pipe.c SRCS+= vadvise.c Modified: head/lib/libc/sys/brk.2 ============================================================================== --- head/lib/libc/sys/brk.2 Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/sys/brk.2 Mon Jun 4 19:35:15 2018 (r334626) @@ -28,7 +28,7 @@ .\" @(#)brk.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd May 24, 2018 +.Dd June 2, 2018 .Dt BRK 2 .Os .Sh NAME @@ -183,3 +183,8 @@ is sometimes used to monitor heap use by calling with The result is unlikely to reflect actual utilization in combination with an .Xr mmap 2 based malloc. +.Pp +.Fn brk +and +.Fn sbrk +are not thread-safe. Added: head/lib/libc/sys/brk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/brk.c Mon Jun 4 19:35:15 2018 (r334626) @@ -0,0 +1,107 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Mark Johnston + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +void *__sys_break(char *nsize); + +static uintptr_t curbrk, minbrk; +static int curbrk_initted; + +static int +initbrk(void) +{ + void *newbrk; + + if (!curbrk_initted) { + newbrk = __sys_break(NULL); + if (newbrk == (void *)-1) + return (-1); + curbrk = minbrk = (uintptr_t)newbrk; + curbrk_initted = 1; + } + return (0); +} + +static void * +mvbrk(void *addr) +{ + uintptr_t oldbrk; + + if ((uintptr_t)addr < minbrk) { + /* Emulate legacy error handling in the syscall. */ + errno = EINVAL; + return ((void *)-1); + } + if (__sys_break(addr) == (void *)-1) + return ((void *)-1); + oldbrk = curbrk; + curbrk = (uintptr_t)addr; + return ((void *)oldbrk); +} + +int +brk(const void *addr) +{ + + if (initbrk() == -1) + return (-1); + if ((uintptr_t)addr < minbrk) + addr = (void *)minbrk; + return (mvbrk(__DECONST(void *, addr)) == (void *)-1 ? -1 : 0); +} + +int +_brk(const void *addr) +{ + + if (initbrk() == -1) + return (-1); + return (mvbrk(__DECONST(void *, addr)) == (void *)-1 ? -1 : 0); +} + +void * +sbrk(intptr_t incr) +{ + + if (initbrk() == -1) + return ((void *)-1); + if ((incr > 0 && curbrk + incr < curbrk) || + (incr < 0 && curbrk + incr > curbrk)) { + /* Emulate legacy error handling in the syscall. */ + errno = EINVAL; + return ((void *)-1); + } + return (mvbrk((void *)(curbrk + incr))); +} Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Mon Jun 4 18:51:06 2018 (r334625) +++ head/lib/libc/tests/sys/Makefile Mon Jun 4 19:35:15 2018 (r334626) @@ -4,6 +4,7 @@ PACKAGE= tests .include +ATF_TESTS_C+= brk_test ATF_TESTS_C+= queue_test # TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, Added: head/lib/libc/tests/sys/brk_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/brk_test.c Mon Jun 4 19:35:15 2018 (r334626) @@ -0,0 +1,149 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Mark Johnston + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include + +ATF_TC(brk_basic); +ATF_TC_HEAD(brk_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", "Verify basic brk() functionality"); +} +ATF_TC_BODY(brk_basic, tc) +{ + void *oldbrk, *newbrk; + int error; + + /* Reset the break. */ + error = brk(0); + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); + + oldbrk = sbrk(0); + ATF_REQUIRE(oldbrk != (void *)-1); + + /* Try to allocate a page. */ + error = brk((void *)((intptr_t)oldbrk + PAGE_SIZE * 2)); + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); + + /* + * Attempt to set the break below minbrk. This should have no effect. + */ + error = brk((void *)((intptr_t)oldbrk - 1)); + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); + newbrk = sbrk(0); + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); + ATF_REQUIRE(newbrk == oldbrk); +} + +ATF_TC(sbrk_basic); +ATF_TC_HEAD(sbrk_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", "Verify basic sbrk() functionality"); +} +ATF_TC_BODY(sbrk_basic, tc) +{ + void *newbrk, *oldbrk; + int *p; + + oldbrk = sbrk(0); + ATF_REQUIRE_MSG(oldbrk != (void *)-1, "sbrk: %s", strerror(errno)); + p = sbrk(sizeof(*p)); + *p = 0; + ATF_REQUIRE(oldbrk == p); + + newbrk = sbrk(-sizeof(*p)); + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); + ATF_REQUIRE(oldbrk == sbrk(0)); + + oldbrk = sbrk(PAGE_SIZE * 2 + 1); + ATF_REQUIRE_MSG(oldbrk != (void *)-1, "sbrk: %s", strerror(errno)); + memset(oldbrk, 0, PAGE_SIZE * 2 + 1); + newbrk = sbrk(-(PAGE_SIZE * 2 + 1)); + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); + ATF_REQUIRE(sbrk(0) == oldbrk); +} + +ATF_TC(mlockfuture); +ATF_TC_HEAD(mlockfuture, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify that mlockall(MCL_FUTURE) applies to the data segment"); +} +ATF_TC_BODY(mlockfuture, tc) +{ + void *oldbrk, *n, *newbrk; + int error; + char v; + + error = mlockall(MCL_FUTURE); + ATF_REQUIRE_MSG(error == 0, + "mlockall: %s", strerror(errno)); + + /* + * Advance the break so that at least one page is added to the data + * segment. This page should be automatically faulted in to the address + * space. + */ + oldbrk = sbrk(0); + ATF_REQUIRE(oldbrk != (void *)-1); + newbrk = sbrk(PAGE_SIZE * 2); + ATF_REQUIRE(newbrk != (void *)-1); + + n = (void *)(((uintptr_t)oldbrk + PAGE_SIZE) & ~PAGE_SIZE); + v = 0; + error = mincore(n, PAGE_SIZE, &v); + ATF_REQUIRE_MSG(error == 0, + "mincore: %s", strerror(errno)); + ATF_REQUIRE_MSG((v & MINCORE_INCORE) != 0, + "unexpected page flags %#x", v); + + error = brk(oldbrk); + ATF_REQUIRE(error == 0); + + error = munlockall(); + ATF_REQUIRE_MSG(error == 0, + "munlockall: %s", strerror(errno)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, brk_basic); + ATF_TP_ADD_TC(tp, sbrk_basic); + ATF_TP_ADD_TC(tp, mlockfuture); + + return (atf_no_error()); +} Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Jun 4 18:51:06 2018 (r334625) +++ head/sys/compat/freebsd32/syscalls.master Mon Jun 4 19:35:15 2018 (r334626) @@ -87,7 +87,7 @@ int mode, int dev); } 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } -17 AUE_NULL NOPROTO { int obreak(char *nsize); } break \ +17 AUE_NULL NOPROTO { caddr_t obreak(char *nsize); } break \ obreak_args int 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Jun 4 18:51:06 2018 (r334625) +++ head/sys/kern/syscalls.master Mon Jun 4 19:35:15 2018 (r334626) @@ -118,7 +118,7 @@ 15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } 16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ int uid, int gid); } -17 AUE_NULL STD { int obreak(_In_ char *nsize); } break \ +17 AUE_NULL STD { caddr_t obreak(_In_ char *nsize); } break \ obreak_args int 18 AUE_GETFSSTAT COMPAT4 { int getfsstat( \ _Out_writes_bytes_opt_(bufsize) \ Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Mon Jun 4 18:51:06 2018 (r334625) +++ head/sys/vm/vm_unix.c Mon Jun 4 19:35:15 2018 (r334626) @@ -102,13 +102,16 @@ sys_obreak(struct thread *td, struct obreak_args *uap) } } else if (new < base) { /* - * This is simply an invalid value. If someone wants to - * do fancy address space manipulations, mmap and munmap - * can do most of what the user would want. + * Simply return the current break address without + * modifying any state. This is an ad-hoc interface + * used by libc to determine the initial break address, + * avoiding a dependency on magic features in the system + * linker. */ - error = EINVAL; + new = old; goto done; } + if (new > old) { if (!old_mlock && map->flags & MAP_WIREFUTURE) { if (ptoa(pmap_wired_count(map->pmap)) + @@ -224,6 +227,9 @@ done: if (do_map_wirefuture) (void) vm_map_wire(map, old, new, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); + + if (error == 0) + td->td_retval[0] = new; return (error); #else /* defined(__aarch64__) || defined(__riscv__) */ From owner-svn-src-head@freebsd.org Mon Jun 4 19:36:49 2018 Return-Path: Delivered-To: svn-src-head@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 0F2C4FE624A; Mon, 4 Jun 2018 19:36:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD00481AF9; Mon, 4 Jun 2018 19:36:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DFF411CDB; Mon, 4 Jun 2018 19:36:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54JamJQ020865; Mon, 4 Jun 2018 19:36:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54JamNp020863; Mon, 4 Jun 2018 19:36:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041936.w54JamNp020863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 19:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334627 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 334627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 19:36:49 -0000 Author: markj Date: Mon Jun 4 19:36:47 2018 New Revision: 334627 URL: https://svnweb.freebsd.org/changeset/base/334627 Log: Regen after r334626. Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Jun 4 19:35:15 2018 (r334626) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Jun 4 19:36:47 2018 (r334627) @@ -8889,7 +8889,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* obreak */ case 17: if (ndx == 0 || ndx == 1) - p = "int"; + p = "caddr_t"; break; /* getpid */ case 20: Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Jun 4 19:35:15 2018 (r334626) +++ head/sys/kern/systrace_args.c Mon Jun 4 19:36:47 2018 (r334627) @@ -8838,7 +8838,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* obreak */ case 17: if (ndx == 0 || ndx == 1) - p = "int"; + p = "caddr_t"; break; /* getpid */ case 20: From owner-svn-src-head@freebsd.org Mon Jun 4 19:47:25 2018 Return-Path: Delivered-To: svn-src-head@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 DBDE0FE82FA; Mon, 4 Jun 2018 19:47:25 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4F482694; Mon, 4 Jun 2018 19:47:25 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B08D11E69; Mon, 4 Jun 2018 19:47:25 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54JlPr3025858; Mon, 4 Jun 2018 19:47:25 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54JlP1b025857; Mon, 4 Jun 2018 19:47:25 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806041947.w54JlP1b025857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 19:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334628 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 19:47:26 -0000 Author: pstef Date: Mon Jun 4 19:47:24 2018 New Revision: 334628 URL: https://svnweb.freebsd.org/changeset/base/334628 Log: indent(1): replace BSD bcopy() with C memmove() Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Mon Jun 4 19:36:47 2018 (r334627) +++ head/usr.bin/indent/indent.c Mon Jun 4 19:47:24 2018 (r334628) @@ -1136,7 +1136,7 @@ check_type: } if (sc_end - save_com + com_end - com_start > sc_size) errx(1, "input too long"); - bcopy(s_lab + com_start, sc_end, com_end - com_start); + memmove(sc_end, s_lab + com_start, com_end - com_start); sc_end += com_end - com_start; e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) From owner-svn-src-head@freebsd.org Mon Jun 4 20:24:32 2018 Return-Path: Delivered-To: svn-src-head@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 B7380FEE240; Mon, 4 Jun 2018 20:24:32 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B28884476; Mon, 4 Jun 2018 20:24:32 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BE5F124E5; Mon, 4 Jun 2018 20:24:32 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54KOWi6045802; Mon, 4 Jun 2018 20:24:32 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KOWPt045801; Mon, 4 Jun 2018 20:24:32 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806042024.w54KOWPt045801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 20:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334630 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:24:32 -0000 Author: pstef Date: Mon Jun 4 20:24:31 2018 New Revision: 334630 URL: https://svnweb.freebsd.org/changeset/base/334630 Log: indent(1): remove static const char copyright[] It repeats what is already said in the heading comment and it's optimized out so serves no purpose. Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Mon Jun 4 20:21:51 2018 (r334629) +++ head/usr.bin/indent/indent.c Mon Jun 4 20:24:31 2018 (r334630) @@ -35,14 +35,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1985 Sun Microsystems, Inc.\n\ -@(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.\n\ -@(#) Copyright (c) 1980, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - #if 0 #ifndef lint static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93"; From owner-svn-src-head@freebsd.org Mon Jun 4 20:40:00 2018 Return-Path: Delivered-To: svn-src-head@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 05FF4FEFF8F; Mon, 4 Jun 2018 20:40:00 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADDE884FE4; Mon, 4 Jun 2018 20:39:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EF17126A1; Mon, 4 Jun 2018 20:39:59 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54Kdx20051732; Mon, 4 Jun 2018 20:39:59 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KdxGC051730; Mon, 4 Jun 2018 20:39:59 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806042039.w54KdxGC051730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 20:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334632 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:40:00 -0000 Author: pstef Date: Mon Jun 4 20:39:58 2018 New Revision: 334632 URL: https://svnweb.freebsd.org/changeset/base/334632 Log: indent(1): remove the STACKSIZE macro and all of its use It conflicts with a system-provided macro of the same name on another OS. Modified: head/usr.bin/indent/indent_globs.h head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Mon Jun 4 20:34:53 2018 (r334631) +++ head/usr.bin/indent/indent_globs.h Mon Jun 4 20:39:58 2018 (r334632) @@ -219,13 +219,11 @@ int auto_typedefs; /* set true to recognize ident int space_after_cast; /* "b = (int) a" vs "b = (int)a" */ int tabsize; /* the size of a tab */ -#define STACKSIZE 256 - struct parser_state { int last_token; - int p_stack[STACKSIZE]; /* this is the parsers stack */ - int il[STACKSIZE]; /* this stack stores indentation levels */ - float cstk[STACKSIZE];/* used to store case stmt indentation levels */ + int p_stack[256]; /* this is the parsers stack */ + int il[64]; /* this stack stores indentation levels */ + float cstk[32]; /* used to store case stmt indentation levels */ int box_com; /* set to true when we are in a "boxed" * comment. In that case, the first non-blank * char should be lined up with the / in / followed by * */ Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Mon Jun 4 20:34:53 2018 (r334631) +++ head/usr.bin/indent/parse.c Mon Jun 4 20:39:58 2018 (r334632) @@ -42,10 +42,12 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6 #endif #include +#include __FBSDID("$FreeBSD$"); #include #include + #include "indent_globs.h" #include "indent_codes.h" #include "indent.h" @@ -209,7 +211,7 @@ parse(int tk) /* tk: the code for the construct scanne } /* end of switch */ - if (ps.tos >= STACKSIZE - 1) + if (ps.tos >= nitems(ps.p_stack) - 1) errx(1, "Parser stack overflow"); reduce(); /* see if any reduction can be done */ From owner-svn-src-head@freebsd.org Mon Jun 4 21:05:58 2018 Return-Path: Delivered-To: svn-src-head@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 0483FFF394F; Mon, 4 Jun 2018 21:05:58 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0C92868AF; Mon, 4 Jun 2018 21:05:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7979212B89; Mon, 4 Jun 2018 21:05:57 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54L5vNI075609; Mon, 4 Jun 2018 21:05:57 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54L5vJm075607; Mon, 4 Jun 2018 21:05:57 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806042105.w54L5vJm075607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 21:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334636 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:05:58 -0000 Author: pstef Date: Mon Jun 4 21:05:56 2018 New Revision: 334636 URL: https://svnweb.freebsd.org/changeset/base/334636 Log: indent(1): add --version option There exist multi-platform programs that check indent's version in order to know what they can expect from it. GNU indent provides that via --version, so implement the same option here. Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Mon Jun 4 20:55:25 2018 (r334635) +++ head/usr.bin/indent/args.c Mon Jun 4 21:05:56 2018 (r334636) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include "indent_globs.h" #include "indent.h" +#define INDENT_VERSION "2.0" + /* profile types */ #define PRO_SPECIAL 1 /* special case */ #define PRO_BOOL 2 /* boolean */ @@ -76,6 +78,7 @@ __FBSDID("$FreeBSD$"); static void scan_profile(FILE *); #define KEY_FILE 5 /* only used for args */ +#define VERSION 6 /* only used for args */ const char *option_source = "?"; @@ -97,6 +100,7 @@ struct pro { {"T", PRO_SPECIAL, 0, KEY, 0}, {"U", PRO_SPECIAL, 0, KEY_FILE, 0}, + {"-version", PRO_SPECIAL, 0, VERSION, 0}, {"P", PRO_SPECIAL, 0, IGN, 0}, {"bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation}, {"badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop}, @@ -301,6 +305,10 @@ found: goto need_param; add_typedefs_from_file(param_start); break; + + case VERSION: + printf("FreeBSD indent %s\n", INDENT_VERSION); + exit(0); default: errx(1, "set_option: internal error: p_special %d", p->p_special); Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Mon Jun 4 20:55:25 2018 (r334635) +++ head/usr.bin/indent/indent.1 Mon Jun 4 21:05:56 2018 (r334636) @@ -30,7 +30,7 @@ .\" @(#)indent.1 8.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd August 7, 2017 +.Dd June 4, 2018 .Dt INDENT 1 .Os .Sh NAME @@ -90,6 +90,7 @@ .Op Fl U Ns Ar file .Op Fl ut | Fl nut .Op Fl v | Fl \&nv +.Op Fl -version .Sh DESCRIPTION The .Nm @@ -491,6 +492,10 @@ reports when it splits one line of input into two or m and gives some size statistics at completion. The default is .Fl \&nv . +.It Fl -version +Causes +.Nm +to print its version number and exit. .El .Pp You may set up your own `profile' of defaults to From owner-svn-src-head@freebsd.org Mon Jun 4 21:17:31 2018 Return-Path: Delivered-To: svn-src-head@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 D8A69FF503B; Mon, 4 Jun 2018 21:17:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89DBE86FF1; Mon, 4 Jun 2018 21:17:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 665A712D17; Mon, 4 Jun 2018 21:17:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54LHVRu084297; Mon, 4 Jun 2018 21:17:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54LHV3i084296; Mon, 4 Jun 2018 21:17:31 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806042117.w54LHV3i084296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 21:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334637 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:17:32 -0000 Author: mmacy Date: Mon Jun 4 21:17:30 2018 New Revision: 334637 URL: https://svnweb.freebsd.org/changeset/base/334637 Log: hwpmc: don't defer user callchain capture completion to ast Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 4 21:05:56 2018 (r334636) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jun 4 21:17:30 2018 (r334637) @@ -1715,11 +1715,9 @@ pmc_process_thread_delete(struct thread *td) static void pmc_process_thread_userret(struct thread *td) { - - thread_lock(td); - curthread->td_flags |= TDF_ASTPENDING; - thread_unlock(td); - pmc_post_callchain_callback(); + sched_pin(); + pmc_capture_user_callchain(curcpu, PMC_UR, td->td_frame); + sched_unpin(); } /* @@ -2253,8 +2251,6 @@ pmc_hook_handler(struct thread *td, int function, void cpu = PCPU_GET(cpuid); pmc_capture_user_callchain(cpu, PMC_SR, - (struct trapframe *) arg); - pmc_capture_user_callchain(cpu, PMC_UR, (struct trapframe *) arg); KASSERT(td->td_pinned == 1, From owner-svn-src-head@freebsd.org Mon Jun 4 21:17:43 2018 Return-Path: Delivered-To: svn-src-head@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 3165AFF50C0; Mon, 4 Jun 2018 21:17:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB271870EA; Mon, 4 Jun 2018 21:17:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BA6012D18; Mon, 4 Jun 2018 21:17:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54LHgZG084429; Mon, 4 Jun 2018 21:17:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54LHgq1084428; Mon, 4 Jun 2018 21:17:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806042117.w54LHgq1084428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 21:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334638 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 334638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:17:43 -0000 Author: mmacy Date: Mon Jun 4 21:17:42 2018 New Revision: 334638 URL: https://svnweb.freebsd.org/changeset/base/334638 Log: libpmc / stat: use westmere supported counter Modified: head/lib/libpmc/libpmc_pmu_util.c (contents, props changed) Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 21:17:30 2018 (r334637) +++ head/lib/libpmc/libpmc_pmu_util.c Mon Jun 4 21:17:42 2018 (r334638) @@ -410,7 +410,7 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc * Ultimately rely on AMD calling theirs the same */ static const char *stat_mode_cntrs[] = { - "cpu_clk_unhalted.thread_any", + "cpu_clk_unhalted.thread", "inst_retired.any", "br_inst_retired.all_branches", "br_misp_retired.all_branches", From owner-svn-src-head@freebsd.org Mon Jun 4 21:17:50 2018 Return-Path: Delivered-To: svn-src-head@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 241EEFF5133; Mon, 4 Jun 2018 21:17:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F049F871AD; Mon, 4 Jun 2018 21:17:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD9DB12D19; Mon, 4 Jun 2018 21:17:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54LHlOX084509; Mon, 4 Jun 2018 21:17:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54LHl4k084508; Mon, 4 Jun 2018 21:17:47 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806042117.w54LHl4k084508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 21:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334639 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 334639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:17:50 -0000 Author: mmacy Date: Mon Jun 4 21:17:46 2018 New Revision: 334639 URL: https://svnweb.freebsd.org/changeset/base/334639 Log: libpmc: improve arg checking Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Mon Jun 4 21:17:42 2018 (r334638) +++ head/lib/libpmc/libpmc.c Mon Jun 4 21:17:46 2018 (r334639) @@ -37,12 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include "libpmcinternal.h" @@ -1035,13 +1037,16 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, */ r = spec_copy = strdup(ctrspec); ctrname = strsep(&r, ","); - if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) { - if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0) { + if (pmc_pmu_enabled()) { + if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) { + if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0) { + goto out; + } + retval = 0; + *pmcid = pmc_config.pm_pmcid; goto out; } - retval = 0; - *pmcid = pmc_config.pm_pmcid; - goto out; + errx(EX_USAGE, "ERROR: pmc_pmu_allocate failed, check for ctrname %s\n", ctrname); } else { free(spec_copy); spec_copy = NULL; @@ -1068,7 +1073,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, ev = NULL; for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++) { pcd = pmc_class_table[n]; - if (pmc_mdep_is_compatible_class(pcd->pm_evc_class) && + if (pcd && pmc_mdep_is_compatible_class(pcd->pm_evc_class) && strncasecmp(ctrname, pcd->pm_evc_name, pcd->pm_evc_name_size) == 0) { if ((ev = pmc_match_event_class(ctrname + @@ -1086,7 +1091,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, */ for (n = 0; ev == NULL && n < PMC_CLASS_TABLE_SIZE; n++) { pcd = pmc_class_table[n]; - if (pmc_mdep_is_compatible_class(pcd->pm_evc_class)) + if (pcd && pmc_mdep_is_compatible_class(pcd->pm_evc_class)) ev = pmc_match_event_class(ctrname, pcd); } From owner-svn-src-head@freebsd.org Mon Jun 4 21:21:56 2018 Return-Path: Delivered-To: svn-src-head@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 5AC7BFF5B58; Mon, 4 Jun 2018 21:21:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D9E58783A; Mon, 4 Jun 2018 21:21:56 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E315B12D82; Mon, 4 Jun 2018 21:21:55 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54LLtFj088375; Mon, 4 Jun 2018 21:21:55 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54LLtJ8088374; Mon, 4 Jun 2018 21:21:55 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806042121.w54LLtJ8088374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 21:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334640 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 334640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:21:56 -0000 Author: pstef Date: Mon Jun 4 21:21:55 2018 New Revision: 334640 URL: https://svnweb.freebsd.org/changeset/base/334640 Log: indent(1): fix buildworld after r334632 Fix error: comparison of integers of different signs: 'int' and 'unsigned long' by casting nitems() to int. Reported by: mjg Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Mon Jun 4 21:17:46 2018 (r334639) +++ head/usr.bin/indent/parse.c Mon Jun 4 21:21:55 2018 (r334640) @@ -211,7 +211,7 @@ parse(int tk) /* tk: the code for the construct scanne } /* end of switch */ - if (ps.tos >= nitems(ps.p_stack) - 1) + if (ps.tos >= (int)nitems(ps.p_stack) - 1) errx(1, "Parser stack overflow"); reduce(); /* see if any reduction can be done */ From owner-svn-src-head@freebsd.org Mon Jun 4 21:42:22 2018 Return-Path: Delivered-To: svn-src-head@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 D14F5FF8637; Mon, 4 Jun 2018 21:42:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83964686EB; Mon, 4 Jun 2018 21:42:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 652A1131CA; Mon, 4 Jun 2018 21:42:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54LgMAA099344; Mon, 4 Jun 2018 21:42:22 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54LgMGj099343; Mon, 4 Jun 2018 21:42:22 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806042142.w54LgMGj099343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 21:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334641 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 334641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 21:42:23 -0000 Author: mmacy Date: Mon Jun 4 21:42:21 2018 New Revision: 334641 URL: https://svnweb.freebsd.org/changeset/base/334641 Log: pmc stat: fix offset of specified counter Modified: head/usr.sbin/pmc/cmd_pmc_stat.c (contents, props changed) Modified: head/usr.sbin/pmc/cmd_pmc_stat.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_stat.c Mon Jun 4 21:21:55 2018 (r334640) +++ head/usr.sbin/pmc/cmd_pmc_stat.c Mon Jun 4 21:42:21 2018 (r334641) @@ -86,6 +86,7 @@ getstathz(void) } #define STAT_MODE_NPMCS 6 +#define FIXED_MODE_NPMCS 2 static struct timespec before_ts; #define CYCLES 0 #define INST 1 @@ -179,7 +180,7 @@ pmc_stat_setup_stat(int system_mode, const char *arg) if (pmc_pmu_sample_rate_get(counter) == DEFAULT_SAMPLE_COUNT) errx(EX_USAGE, "ERROR: %s not recognized on host", counter); } - start = IAP_START + STAT_MODE_NPMCS - newcnt; + start = IAP_START + STAT_MODE_NPMCS - FIXED_MODE_NPMCS - newcnt; for (i = 0; i < newcnt; i++) { stat_mode_cntrs[start + i] = new_cntrs[i]; stat_mode_names[start + i] = new_cntrs[i]; From owner-svn-src-head@freebsd.org Mon Jun 4 22:26:52 2018 Return-Path: Delivered-To: svn-src-head@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 72438FDBDC6; Mon, 4 Jun 2018 22:26:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22BA46A2A5; Mon, 4 Jun 2018 22:26:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F399C13833; Mon, 4 Jun 2018 22:26:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54MQpqe019655; Mon, 4 Jun 2018 22:26:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54MQlht019634; Mon, 4 Jun 2018 22:26:47 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201806042226.w54MQlht019634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 4 Jun 2018 22:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334643 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/utilities inc... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/utilities include X-SVN-Commit-Revision: 334643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 22:26:53 -0000 Author: jkim Date: Mon Jun 4 22:26:47 2018 New Revision: 334643 URL: https://svnweb.freebsd.org/changeset/base/334643 Log: MFV: r334448 Import ACPICA 20180531. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/dmtbdump2.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbinfo.h head/sys/contrib/dev/acpica/include/actbl2.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/changes.txt Mon Jun 4 22:26:47 2018 (r334643) @@ -1,4 +1,86 @@ ---------------------------------------- +31 May 2018. Summary of changes for version 20180531: + + +1) ACPICA kernel-resident Subsystem: + +Implemented additional support to help ensure that a DSDT or SSDT is +fully loaded even if errors are incurred during the load. The majority of +the problems that are seen is the failure of individual AML operators +that occur during execution of any module-level code (MLC) existing in +the table. This support adds a mechanism to abort the current ASL +statement (AML opcode), emit an error message, and to simply move on to +the next opcode -- instead of aborting the entire table load. This is +different than the execution of a control method where the entire method +is aborted upon any error. The goal is to perform a very "best effort" to +load the ACPI tables. The most common MLC errors that have been seen in +the field are direct references to unresolved ASL/AML symbols (referenced +directly without the use of the CondRefOf operator to validate the +symbol). This new ACPICA behavior is now compatible with other ACPI +implementations. + +Interpreter: The Unload AML operator is no longer supported for the +reasons below. An AE_NOT_IMPLEMENTED exception is returned. +1) A correct implementation on at least some hosts may not be possible. +2) Other ACPI implementations do not correctly/fully support it. +3) It requires host device driver support which is not known to exist. + (To properly support namespace unload out from underneath.) +4) This AML operator has never been seen in the field. + +Parser: Added a debug option to dump AML parse sub-trees as they are +being executed. Used with ACPI_DEBUG_PRINT, the enabling debug level is +ACPI_DB_PARSE_TREES. + +Debugger: Reduced the verbosity for errors incurred during table load and +module-level code execution. + +Completed an investigation into adding a namespace node "owner list" +instead of the current "owner ID" associated with namespace nodes. This +list would link together all nodes that are owned by an individual +control method. The purpose would be to enhance control method execution +by speeding up cleanup during method exit (all namespace nodes created by +a method are deleted upon method termination.) Currently, the entire +namespace must be searched for matching owner IDs if (and only if) the +method creates named objects outside of the local scope. However, by far +the most common case is that methods create objects locally, not outside +the method scope. There is already an ACPICA optimization in place that +only searches the entire namespace in the rare case of a method creating +objects elsewhere in the namespace. Therefore, it is felt that the +overhead of adding an additional pointer to each namespace node to +implement the owner list makes this feature unnecessary. + + +2) iASL Compiler/Disassembler and Tools: + +iASL, Disassembler, and Template generator: Implemented support for +Revision D of the IORT table. Adds a new subtable that is used to specify +SMMUv3 PMCGs. rmurphy-arm. + +Disassembler: Restored correct table header validation for the "special" +ACPI tables -- RSDP and FACS. These tables do not contain a standard ACPI +table header and must be special-cased. This was a regression that has +been present for apparently a long time. + +AcpiExec: Reduced verbosity of the local exception handler implemented +within acpiexec. This handler is invoked by ACPICA upon any exceptions +generated during control method execution. A new option was added: -vh +restores the original verbosity level if desired. + +AcpiExec: Changed the default base from decimal to hex for the -x option +(set debug level). This simplifies the use of this option and matches the +behavior of the corresponding iASL -x option. + +AcpiExec: Restored a force-exit on multiple control-c (sigint) +interrupts. This allows program termination even if other issues cause +the control-c to fail. + +ASL test suite (ASLTS): Added tests for the recently implemented package +element resolution mechanism that allows forward references to named +objects from individual package elements (this mechanism provides +compatibility with other ACPI implementations.) + + +---------------------------------------- 8 May 2018. Summary of changes for version 20180508: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/common/acfileio.c Mon Jun 4 22:26:47 2018 (r334643) @@ -401,16 +401,16 @@ AcGetOneTableFromFile ( return (AE_CTRL_TERMINATE); } - /* Validate the table signature/header (limited ASCII chars) */ - - Status = AcValidateTableHeader (File, TableOffset); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - if (GetOnlyAmlTables) { + /* Validate the table signature/header (limited ASCII chars) */ + + Status = AcValidateTableHeader (File, TableOffset); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + /* * Table must be an AML table (DSDT/SSDT). * Used for iASL -e option only. @@ -438,7 +438,12 @@ AcGetOneTableFromFile ( fseek (File, TableOffset, SEEK_SET); Count = fread (Table, 1, TableHeader.Length, File); - if (Count != (INT32) TableHeader.Length) + + /* + * Checks for data table headers happen later in the execution. Only verify + * for Aml tables at this point in the code. + */ + if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length) { Status = AE_ERROR; goto ErrorExit; Modified: head/sys/contrib/dev/acpica/common/dmtbdump2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump2.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/common/dmtbdump2.c Mon Jun 4 22:26:47 2018 (r334643) @@ -265,6 +265,12 @@ AcpiDmDumpIort ( Length = IortNode->Length - NodeOffset; break; + case ACPI_IORT_NODE_PMCG: + + InfoTable = AcpiDmTableInfoIort5; + Length = IortNode->Length - NodeOffset; + break; + default: AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n", Modified: head/sys/contrib/dev/acpica/common/dmtbinfo2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo2.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/common/dmtbinfo2.c Mon Jun 4 22:26:47 2018 (r334643) @@ -290,6 +290,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[] = {ACPI_DMT_IORTMEM, ACPI_IORT2_OFFSET (MemoryProperties), "Memory Properties", 0}, {ACPI_DMT_UINT32, ACPI_IORT2_OFFSET (AtsAttribute), "ATS Attribute", 0}, {ACPI_DMT_UINT32, ACPI_IORT2_OFFSET (PciSegmentNumber), "PCI Segment Number", 0}, + {ACPI_DMT_UINT8, ACPI_IORT2_OFFSET (MemoryAddressLimit), "Memory Size Limit", 0}, + {ACPI_DMT_UINT24, ACPI_IORT2_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -350,10 +352,19 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0}, - {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, - {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, - {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (IdMappingIndex), "Device ID Mapping Index", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0x05: PMCG */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[] = +{ + {ACPI_DMT_UINT64, ACPI_IORT5_OFFSET (Page0BaseAddress), "Page 0 Base Address", 0}, + {ACPI_DMT_UINT32, ACPI_IORT5_OFFSET (OverflowGsiv), "Overflow Interrupt GSIV", 0}, + {ACPI_DMT_UINT32, ACPI_IORT5_OFFSET (NodeReference), "Node Reference", 0}, + {ACPI_DMT_UINT64, ACPI_IORT5_OFFSET (Page1BaseAddress), "Page 1 Base Address", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Mon Jun 4 22:26:47 2018 (r334643) @@ -233,7 +233,11 @@ LdLoadNamespace ( /* Dump the namespace if debug is enabled */ - AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX); + if (AcpiDbgLevel & ACPI_LV_TABLES) + { + AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX); + } + ACPI_FREE (WalkState); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/dttable1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable1.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/compiler/dttable1.c Mon Jun 4 22:26:47 2018 (r334643) @@ -1829,6 +1829,19 @@ DtCompileIort ( NodeLength += Subtable->Length; break; + case ACPI_IORT_NODE_PMCG: + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort5, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + NodeLength += Subtable->Length; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT"); Modified: head/sys/contrib/dev/acpica/compiler/dttemplate.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttemplate.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/compiler/dttemplate.h Mon Jun 4 22:26:47 2018 (r334643) @@ -696,18 +696,18 @@ const unsigned char TemplateHpet[] = const unsigned char TemplateIort[] = { - 0x49,0x4F,0x52,0x54,0x90,0x01,0x00,0x00, /* 00000000 "IORT...." */ - 0x00,0x5F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "._INTEL " */ + 0x49,0x4F,0x52,0x54,0xF8,0x01,0x00,0x00, /* 00000000 "IORT...." */ + 0x00,0x72,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".rINTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x31,0x08,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "1.. ...." */ + 0x13,0x03,0x18,0x20,0x06,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x58,0x00,0x00, /* 00000048 ".....X.." */ + 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00, /* 00000048 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ - 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "D......." */ + 0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "l......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x5C,0x5F,0x53,0x42,0x2E,0x50,0x43, /* 00000068 ".\_SB.PC" */ 0x49,0x30,0x2E,0x44,0x45,0x56,0x30,0x00, /* 00000070 "I0.DEV0." */ @@ -716,36 +716,49 @@ const unsigned char TemplateIort[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ - 0x00,0x00,0x00,0x00,0x02,0x34,0x00,0x00, /* 000000A0 ".....4.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 " ......." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ - 0x03,0x60,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000D8 ".`......" */ - 0x01,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000E0 "....L..." */ + 0x00,0x00,0x00,0x00,0x02,0x38,0x00,0x00, /* 000000C8 ".....8.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "$......." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ - 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "<......." */ - 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "L......." */ + 0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x01, /* 00000100 ".....`.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000108 "........" */ 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "L......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ - 0x04,0x58,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000138 ".X......" */ - 0x01,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000140 "....D..." */ + 0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /* 00000128 "....<..." */ + 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 00000130 "....L..." */ + 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 00000138 "....L..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0x04,0x58,0x00,0x01, /* 00000160 ".....X.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000168 "........" */ + 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "D......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000188 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000190 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B0 "........" */ + 0x00,0x00,0x00,0x00,0x05,0x3C,0x00,0x01, /* 000001B8 ".....<.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000001C0 "........" */ + 0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "(......." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00 /* 000001F0 "........" */ }; const unsigned char TemplateIvrs[] = Modified: head/sys/contrib/dev/acpica/components/debugger/dbnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbnames.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/debugger/dbnames.c Mon Jun 4 22:26:47 2018 (r334643) @@ -522,6 +522,7 @@ AcpiDbWalkAndMatchName ( } else { + Info.Count = 0; Info.OwnerId = ACPI_OWNER_ID_MAX; Info.DebugLevel = ACPI_UINT32_MAX; Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT; Modified: head/sys/contrib/dev/acpica/components/debugger/dbobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbobject.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/debugger/dbobject.c Mon Jun 4 22:26:47 2018 (r334643) @@ -187,8 +187,18 @@ AcpiDbDumpMethodInfo ( ACPI_WALK_STATE *WalkState) { ACPI_THREAD_STATE *Thread; + ACPI_NAMESPACE_NODE *Node; + Node = WalkState->MethodNode; + + /* There are no locals or arguments for the module-level code case */ + + if (Node == AcpiGbl_RootNode) + { + return; + } + /* Ignore control codes, they are not errors */ if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) @@ -556,9 +566,16 @@ AcpiDbDecodeLocals ( BOOLEAN DisplayLocals = FALSE; + Node = WalkState->MethodNode; ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; + /* There are no locals for the module-level code case */ + + if (Node == AcpiGbl_RootNode) + { + return; + } + if (!Node) { AcpiOsPrintf ( @@ -634,6 +651,13 @@ AcpiDbDecodeArguments ( Node = WalkState->MethodNode; ObjDesc = WalkState->MethodDesc; + + /* There are no arguments for the module-level code case */ + + if (Node == AcpiGbl_RootNode) + { + return; + } if (!Node) { Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c Mon Jun 4 22:26:47 2018 (r334643) @@ -251,6 +251,7 @@ AcpiDsDumpMethodStack ( ACPI_FUNCTION_TRACE (DsDumpMethodStack); + /* Ignore control codes, they are not errors */ if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL) @@ -320,8 +321,13 @@ AcpiDsDumpMethodStack ( Op->Common.Next = NULL; #ifdef ACPI_DISASSEMBLER - AcpiOsPrintf ("Failed at "); - AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); + if (WalkState->MethodNode != AcpiGbl_RootNode) + { + /* More verbose if not module-level code */ + + AcpiOsPrintf ("Failed at "); + AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); + } #endif Op->Common.Next = Next; } Modified: head/sys/contrib/dev/acpica/components/executer/exconfig.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exconfig.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/executer/exconfig.c Mon Jun 4 22:26:47 2018 (r334643) @@ -678,6 +678,17 @@ AcpiExUnloadTable ( "Received request to unload an ACPI table")); /* + * May 2018: Unload is no longer supported for the following reasons: + * 1) A correct implementation on some hosts may not be possible. + * 2) Other ACPI implementations do not correctly/fully support it. + * 3) It requires host device driver support which does not exist. + * (To properly support namespace unload out from underneath.) + * 4) This AML operator has never been seen in the field. + */ + ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, + "AML Unload operator is not supported")); + + /* * Validate the handle * Although the handle is partially validated in AcpiExReconfiguration() * when it calls AcpiExResolveOperands(), the handle is more completely Modified: head/sys/contrib/dev/acpica/components/namespace/nsdump.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsdump.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/namespace/nsdump.c Mon Jun 4 22:26:47 2018 (r334643) @@ -293,6 +293,7 @@ AcpiNsDumpPathname ( } #endif + /******************************************************************************* * * FUNCTION: AcpiNsDumpOneObject @@ -351,6 +352,7 @@ AcpiNsDumpOneObject ( } Type = ThisNode->Type; + Info->Count++; /* Check if the owner matches */ @@ -815,6 +817,7 @@ AcpiNsDumpObjects ( return; } + Info.Count = 0; Info.DebugLevel = ACPI_LV_TABLES; Info.OwnerId = OwnerId; Info.DisplayType = DisplayType; @@ -823,6 +826,7 @@ AcpiNsDumpObjects ( ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, AcpiNsDumpOneObject, NULL, (void *) &Info, NULL); + AcpiOsPrintf ("\nNamespace node count: %u\n\n", Info.Count); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); } Modified: head/sys/contrib/dev/acpica/components/parser/psloop.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psloop.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/parser/psloop.c Mon Jun 4 22:26:47 2018 (r334643) @@ -665,6 +665,19 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } + if (WalkState->Opcode == AML_SCOPE_OP) + { + /* + * If the scope op fails to parse, skip the body of the + * scope op because the parse failure indicates that the + * device may not exist. + */ + WalkState->ParserState.Aml = WalkState->Aml + 1; + WalkState->ParserState.Aml = + AcpiPsGetNextPackageEnd(&WalkState->ParserState); + WalkState->Aml = WalkState->ParserState.Aml; + ACPI_ERROR ((AE_INFO, "Skipping Scope block")); + } continue; } @@ -707,7 +720,32 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } + if ((WalkState->ControlState) && + ((WalkState->ControlState->Control.Opcode == AML_IF_OP) || + (WalkState->ControlState->Control.Opcode == AML_WHILE_OP))) + { + /* + * If the if/while op fails to parse, we will skip parsing + * the body of the op. + */ + ParserState->Aml = + WalkState->ControlState->Control.AmlPredicateStart + 1; + ParserState->Aml = + AcpiPsGetNextPackageEnd (ParserState); + WalkState->Aml = ParserState->Aml; + ACPI_ERROR ((AE_INFO, "Skipping While/If block")); + if (*WalkState->Aml == AML_ELSE_OP) + { + ACPI_ERROR ((AE_INFO, "Skipping Else block")); + WalkState->ParserState.Aml = WalkState->Aml + 1; + WalkState->ParserState.Aml = + AcpiPsGetNextPackageEnd (ParserState); + WalkState->Aml = ParserState->Aml; + } + ACPI_FREE(AcpiUtPopGenericState (&WalkState->ControlState)); + } + Op = NULL; continue; } } Modified: head/sys/contrib/dev/acpica/components/parser/psobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psobject.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/parser/psobject.c Mon Jun 4 22:26:47 2018 (r334643) @@ -154,6 +154,7 @@ #include #include #include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psobject") @@ -722,6 +723,20 @@ AcpiPsCompleteOp ( { if (*Op) { + /* + * These Opcodes need to be removed from the namespace because they + * get created even if these opcodes cannot be created due to + * errors. + */ + if (((*Op)->Common.AmlOpcode == AML_REGION_OP) || + ((*Op)->Common.AmlOpcode == AML_DATA_REGION_OP)) + { + AcpiNsDeleteChildren ((*Op)->Common.Node); + AcpiNsRemoveNode ((*Op)->Common.Node); + (*Op)->Common.Node = NULL; + AcpiPsDeleteParseTree (*Op); + } + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); if (ACPI_FAILURE (Status2)) { @@ -747,6 +762,20 @@ AcpiPsCompleteOp ( #endif WalkState->PrevOp = NULL; WalkState->PrevArgTypes = WalkState->ArgTypes; + + if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) + { + /* + * There was something that went wrong while executing code at the + * module-level. We need to skip parsing whatever caused the + * error and keep going. One runtime error during the table load + * should not cause the entire table to not be loaded. This is + * because there could be correct AML beyond the parts that caused + * the runtime error. + */ + ACPI_ERROR ((AE_INFO, "Ignore error and continue table load")); + return_ACPI_STATUS (AE_OK); + } return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/parser/pswalk.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/pswalk.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/parser/pswalk.c Mon Jun 4 22:26:47 2018 (r334643) @@ -169,6 +169,8 @@ * ******************************************************************************/ +#include + void AcpiPsDeleteParseTree ( ACPI_PARSE_OBJECT *SubtreeRoot) @@ -176,19 +178,40 @@ AcpiPsDeleteParseTree ( ACPI_PARSE_OBJECT *Op = SubtreeRoot; ACPI_PARSE_OBJECT *Next = NULL; ACPI_PARSE_OBJECT *Parent = NULL; + UINT32 Level = 0; ACPI_FUNCTION_TRACE_PTR (PsDeleteParseTree, SubtreeRoot); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE_TREES, + " root %p\n", SubtreeRoot)); /* Visit all nodes in the subtree */ while (Op) { - /* Check if we are not ascending */ - if (Op != Parent) { + /* This is the descending case */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_PARSE_TREES, _COMPONENT)) + { + /* This debug option will print the entire parse tree */ + + AcpiOsPrintf (" %*.s%s %p", (Level * 4), " ", + AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Op); + + if (Op->Named.AmlOpcode == AML_INT_NAMEPATH_OP) + { + AcpiOsPrintf (" %4.4s", Op->Common.Value.String); + } + if (Op->Named.AmlOpcode == AML_STRING_OP) + { + AcpiOsPrintf (" %s", Op->Common.Value.String); + } + AcpiOsPrintf ("\n"); + } + /* Look for an argument or child of the current op */ Next = AcpiPsGetArg (Op, 0); @@ -197,6 +220,7 @@ AcpiPsDeleteParseTree ( /* Still going downward in tree (Op is not completed yet) */ Op = Next; + Level++; continue; } } @@ -221,6 +245,7 @@ AcpiPsDeleteParseTree ( } else { + Level--; Op = Parent; } } Modified: head/sys/contrib/dev/acpica/components/utilities/uterror.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/uterror.c Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/components/utilities/uterror.c Mon Jun 4 22:26:47 2018 (r334643) @@ -352,20 +352,20 @@ AcpiUtPrefixedNamespaceError ( { case AE_ALREADY_EXISTS: - AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); Message = "Failure creating"; break; case AE_NOT_FOUND: - AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); - Message = "Failure looking up"; + AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + Message = "Could not resolve"; break; default: - AcpiOsPrintf (ACPI_MSG_ERROR); - Message = "Failure looking up"; + AcpiOsPrintf ("\n" ACPI_MSG_ERROR); + Message = "Failure resolving"; break; } Modified: head/sys/contrib/dev/acpica/include/acdisasm.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acdisasm.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/acdisasm.h Mon Jun 4 22:26:47 2018 (r334643) @@ -449,6 +449,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[]; Modified: head/sys/contrib/dev/acpica/include/aclocal.h ============================================================================== --- head/sys/contrib/dev/acpica/include/aclocal.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/aclocal.h Mon Jun 4 22:26:47 2018 (r334643) @@ -284,7 +284,7 @@ typedef enum * DescriptorType is used to differentiate between internal descriptors. * * The node is optimized for both 32-bit and 64-bit platforms: - * 28 bytes for the 32-bit case, 48 bytes for the 64-bit case. + * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. * * Note: The DescriptorType and Type fields must appear in the identical * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT @@ -301,12 +301,10 @@ typedef struct acpi_namespace_node struct acpi_namespace_node *Parent; /* Parent node */ struct acpi_namespace_node *Child; /* First child */ struct acpi_namespace_node *Peer; /* First peer */ - struct acpi_namespace_node *OwnerList; /* All nodes owned by a table or method */ -/* - * The following fields are appended to the namespace node and - * are used by the ASL compiler and AML disassembler only - */ + /* + * The following fields are used by the ASL compiler and disassembler only + */ #ifdef ACPI_LARGE_NAMESPACE_NODE union acpi_parse_object *Op; void *MethodLocals; @@ -314,6 +312,7 @@ typedef struct acpi_namespace_node UINT32 Value; UINT32 Length; UINT8 ArgCount; + #endif } ACPI_NAMESPACE_NODE; Modified: head/sys/contrib/dev/acpica/include/acoutput.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acoutput.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/acoutput.h Mon Jun 4 22:26:47 2018 (r334643) @@ -223,7 +223,8 @@ #define ACPI_LV_ALLOCATIONS 0x00100000 #define ACPI_LV_FUNCTIONS 0x00200000 #define ACPI_LV_OPTIMIZATIONS 0x00400000 -#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1 +#define ACPI_LV_PARSE_TREES 0x00800000 +#define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1 #define ACPI_LV_ALL ACPI_LV_VERBOSITY2 /* Trace verbosity level 3 [Threading, I/O, and Interrupts] */ @@ -275,6 +276,7 @@ #define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES) #define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS) #define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS) +#define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES) #define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES) #define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS) #define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS) Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/acpixf.h Mon Jun 4 22:26:47 2018 (r334643) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20180508 +#define ACPI_CA_VERSION 0x20180531 #include #include Modified: head/sys/contrib/dev/acpica/include/actbinfo.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbinfo.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/actbinfo.h Mon Jun 4 22:26:47 2018 (r334643) @@ -257,6 +257,7 @@ #define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f) #define ACPI_IORT3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f) #define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f) +#define ACPI_IORT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f) #define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f) #define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f) #define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f) Modified: head/sys/contrib/dev/acpica/include/actbl2.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbl2.h Mon Jun 4 22:15:24 2018 (r334642) +++ head/sys/contrib/dev/acpica/include/actbl2.h Mon Jun 4 22:26:47 2018 (r334643) @@ -213,7 +213,7 @@ * IORT - IO Remapping Table * * Conforms to "IO Remapping Table System Software on ARM Platforms", - * Document number: ARM DEN 0049C, May 2017 + * Document number: ARM DEN 0049D, March 2018 * ******************************************************************************/ @@ -250,7 +250,8 @@ enum AcpiIortNodeType ACPI_IORT_NODE_NAMED_COMPONENT = 0x01, ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, ACPI_IORT_NODE_SMMU = 0x03, - ACPI_IORT_NODE_SMMU_V3 = 0x04 + ACPI_IORT_NODE_SMMU_V3 = 0x04, + ACPI_IORT_NODE_PMCG = 0x05 }; @@ -316,12 +317,18 @@ typedef struct acpi_iort_named_component } ACPI_IORT_NAMED_COMPONENT; +/* Masks for Flags field above */ +#define ACPI_IORT_NC_STALL_SUPPORTED (1) +#define ACPI_IORT_NC_PASID_BITS (31<<1) + typedef struct acpi_iort_root_complex { UINT64 MemoryProperties; /* Memory access properties */ UINT32 AtsAttribute; UINT32 PciSegmentNumber; + UINT8 MemoryAddressLimit; /* Memory address size limit */ + UINT8 Reserved[3]; /* Reserved, must be zero */ } ACPI_IORT_ROOT_COMPLEX; @@ -383,9 +390,7 @@ typedef struct acpi_iort_smmu_v3 UINT32 PriGsiv; UINT32 GerrGsiv; UINT32 SyncGsiv; - UINT8 Pxm; - UINT8 Reserved1; - UINT16 Reserved2; + UINT32 Pxm; UINT32 IdMappingIndex; } ACPI_IORT_SMMU_V3; @@ -399,8 +404,17 @@ typedef struct acpi_iort_smmu_v3 /* Masks for Flags field above */ #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) -#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1) +#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1) #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3) + +typedef struct acpi_iort_pmcg +{ + UINT64 Page0BaseAddress; + UINT32 OverflowGsiv; + UINT32 NodeReference; + UINT64 Page1BaseAddress; + +} ACPI_IORT_PMCG; /******************************************************************************* From owner-svn-src-head@freebsd.org Mon Jun 4 22:39:24 2018 Return-Path: Delivered-To: svn-src-head@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 F3972FDDB21; Mon, 4 Jun 2018 22:39:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A17FD6AC1A; Mon, 4 Jun 2018 22:39:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E0AC139C1; Mon, 4 Jun 2018 22:39:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54MdNB6024741; Mon, 4 Jun 2018 22:39:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54MdNNi024740; Mon, 4 Jun 2018 22:39:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806042239.w54MdNNi024740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 4 Jun 2018 22:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334644 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 334644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 22:39:24 -0000 Author: mmacy Date: Mon Jun 4 22:39:22 2018 New Revision: 334644 URL: https://svnweb.freebsd.org/changeset/base/334644 Log: pmc stat: add debug option for intermediate state Modified: head/usr.sbin/pmc/cmd_pmc_stat.c (contents, props changed) Modified: head/usr.sbin/pmc/cmd_pmc_stat.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_stat.c Mon Jun 4 22:26:47 2018 (r334643) +++ head/usr.sbin/pmc/cmd_pmc_stat.c Mon Jun 4 22:39:22 2018 (r334644) @@ -244,11 +244,26 @@ pmc_stat_print_stat(struct rusage *ru) uint64_t ticks, value; int hz, i; - hz = getstathz(); - ticks = hz * (ru->ru_utime.tv_sec + ru->ru_stime.tv_sec) + - hz * (ru->ru_utime.tv_usec + ru->ru_stime.tv_usec) / 1000000; - if (clock_gettime(CLOCK_MONOTONIC, &after)) - err(1, "clock_gettime"); + if (ru) { + hz = getstathz(); + ticks = hz * (ru->ru_utime.tv_sec + ru->ru_stime.tv_sec) + + hz * (ru->ru_utime.tv_usec + ru->ru_stime.tv_usec) / 1000000; + if (clock_gettime(CLOCK_MONOTONIC, &after)) + err(1, "clock_gettime"); + /* + * If our round-off on the tick calculation still puts us at 0, + * then always assume at least one tick. + */ + if (ticks == 0) + ticks = 1; + fprintf(pmc_args.pa_printfile, "%16ld %s\t\t#\t%02.03f M/sec\n", + ru->ru_minflt, "page faults", ((double)ru->ru_minflt / (double)ticks) / hz); + fprintf(pmc_args.pa_printfile, "%16ld %s\t\t#\t%02.03f M/sec\n", + ru->ru_nvcsw, "voluntary csw", ((double)ru->ru_nvcsw / (double)ticks) / hz); + fprintf(pmc_args.pa_printfile, "%16ld %s\t#\t%02.03f M/sec\n", + ru->ru_nivcsw, "involuntary csw", ((double)ru->ru_nivcsw / (double)ticks) / hz); + } + bzero(&cvals, sizeof(cvals)); STAILQ_FOREACH(ev, &pmc_args.pa_events, ev_next) { if (pmc_read(ev->ev_pmcid, &value) < 0) @@ -259,19 +274,6 @@ pmc_stat_print_stat(struct rusage *ru) cvals[i] += value; } - /* - * If our round-off on the tick calculation still puts us at 0, - * then always assume at least one tick. - */ - if (ticks == 0) - ticks = 1; - fprintf(pmc_args.pa_printfile, "%16ld %s\t\t#\t%02.03f M/sec\n", - ru->ru_minflt, "page faults", ((double)ru->ru_minflt / (double)ticks) / hz); - fprintf(pmc_args.pa_printfile, "%16ld %s\t\t#\t%02.03f M/sec\n", - ru->ru_nvcsw, "voluntary csw", ((double)ru->ru_nvcsw / (double)ticks) / hz); - fprintf(pmc_args.pa_printfile, "%16ld %s\t#\t%02.03f M/sec\n", - ru->ru_nivcsw, "involuntary csw", ((double)ru->ru_nivcsw / (double)ticks) / hz); - fprintf(pmc_args.pa_printfile, "%16jd %s\n", (uintmax_t)cvals[CYCLES], stat_mode_names[CYCLES]); fprintf(pmc_args.pa_printfile, "%16jd %s\t\t#\t%01.03f inst/cycle\n", (uintmax_t)cvals[INST], stat_mode_names[INST], (double)cvals[INST] / cvals[CYCLES]); @@ -294,8 +296,8 @@ pmc_stat_print_stat(struct rusage *ru) fprintf(pmc_args.pa_printfile, "\t\t#\t%.03f%%\n", 100 * ((double)cvals[CACHE_MISS] / cvals[CACHE])); - - showtime(pmc_args.pa_printfile, &before_ts, &after, ru); + if (ru) + showtime(pmc_args.pa_printfile, &before_ts, &after, ru); } static struct option longopts[] = { @@ -313,15 +315,18 @@ pmc_stat_internal(int argc, char **argv, int system_mo struct winsize ws; struct pmcstat_ev *ev; int c, option, runstate; - int waitstatus, ru_valid; + int waitstatus, ru_valid, do_debug; - ru_valid = 0; + do_debug = ru_valid = 0; r = event = NULL; - while ((option = getopt_long(argc, argv, "j:", longopts, NULL)) != -1) { + while ((option = getopt_long(argc, argv, "dj:", longopts, NULL)) != -1) { switch (option) { case 'j': r = event = strdup(optarg); break; + case 'd': + do_debug = 1; + break; case '?': default: usage(); @@ -342,6 +347,10 @@ pmc_stat_internal(int argc, char **argv, int system_mo EV_SET(&kev, SIGIO, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); if (kevent(pmc_kq, &kev, 1, NULL, 0, NULL) < 0) err(EX_OSERR, "ERROR: Cannot register kevent for SIGIO"); + EV_SET(&kev, 0, EVFILT_TIMER, EV_ADD, 0, 1000, NULL); + if (kevent(pmc_kq, &kev, 1, NULL, 0, NULL) < 0) + err(EX_OSERR, + "ERROR: Cannot register kevent for timer"); STAILQ_FOREACH(ev, &pmc_args.pa_events, ev_next) { if (pmc_allocate(ev->ev_spec, ev->ev_mode, @@ -415,7 +424,10 @@ pmc_stat_internal(int argc, char **argv, int system_mo case EVFILT_READ: /* log file data is present */ break; - + case EVFILT_TIMER: + if (do_debug) + pmc_stat_print_stat(NULL); + break; case EVFILT_SIGNAL: if (kev.ident == SIGCHLD) { /* From owner-svn-src-head@freebsd.org Mon Jun 4 23:17:19 2018 Return-Path: Delivered-To: svn-src-head@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 ADD43FE3A0B; Mon, 4 Jun 2018 23:17:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613026D060; Mon, 4 Jun 2018 23:17:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C1491401F; Mon, 4 Jun 2018 23:17:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54NHJWl045180; Mon, 4 Jun 2018 23:17:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54NHJAB045179; Mon, 4 Jun 2018 23:17:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806042317.w54NHJAB045179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 4 Jun 2018 23:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334645 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 334645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 23:17:19 -0000 Author: np Date: Mon Jun 4 23:17:18 2018 New Revision: 334645 URL: https://svnweb.freebsd.org/changeset/base/334645 Log: cxgbetool: Disallow negative values for numeric parameters. Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Mon Jun 4 22:39:22 2018 (r334644) +++ head/usr.sbin/cxgbetool/cxgbetool.c Mon Jun 4 23:17:18 2018 (r334645) @@ -606,31 +606,33 @@ static int parse_val_mask(const char *param, const char *args[], uint32_t *val, uint32_t *mask, int hashfilter) { + long l; char *p; if (strcmp(param, args[0]) != 0) return (EINVAL); - *val = strtoul(args[1], &p, 0); - if (p > args[1]) { - if (p[0] == 0) { - *mask = ~0; - return (0); - } + p = str_to_number(args[1], &l, NULL); + if (l >= 0 && l <= UINT32_MAX) { + *val = (uint32_t)l; + if (p > args[1]) { + if (p[0] == 0) { + *mask = ~0; + return (0); + } - if (p[0] == ':' && p[1] != 0) { - if (hashfilter) { - warnx("param %s: mask not allowed for " - "hashfilter or nat params", param); - return (EINVAL); + if (p[0] == ':' && p[1] != 0) { + if (hashfilter) { + warnx("param %s: mask not allowed for " + "hashfilter or nat params", param); + return (EINVAL); + } + p = str_to_number(p + 1, &l, NULL); + if (l >= 0 && l <= UINT32_MAX && p[0] == 0) { + *mask = (uint32_t)l; + return (0); + } } - *mask = strtoul(p+1, &p, 0); - if (p[0] == 0) - return (0); - } else { - warnx("param %s: mask not allowed for hashfilter", - param); - return (EINVAL); } } @@ -767,16 +769,19 @@ static int parse_val(const char *param, const char *args[], uint32_t *val) { char *p; + long l; if (strcmp(param, args[0]) != 0) return (EINVAL); - *val = strtoul(args[1], &p, 0); - if (p > args[1] && p[0] == 0) - return (0); + p = str_to_number(args[1], &l, NULL); + if (*p || l < 0 || l > UINT32_MAX) { + warnx("parameter \"%s\" has bad \"value\" %s", args[0], args[1]); + return (EINVAL); + } - warnx("parameter \"%s\" has bad \"value\" %s", args[0], args[1]); - return (EINVAL); + *val = (uint32_t)l; + return (0); } static void From owner-svn-src-head@freebsd.org Tue Jun 5 00:00:25 2018 Return-Path: Delivered-To: svn-src-head@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 621C0FE9409; Tue, 5 Jun 2018 00:00:25 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC42B6EF84; Tue, 5 Jun 2018 00:00:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5500Mlh098071; Mon, 4 Jun 2018 17:00:22 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5500Men098070; Mon, 4 Jun 2018 17:00:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806050000.w5500Men098070@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334630 - head/usr.bin/indent In-Reply-To: <201806042024.w54KOWPt045801@repo.freebsd.org> To: Piotr Pawel Stefaniak Date: Mon, 4 Jun 2018 17:00:22 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 00:00:25 -0000 > Author: pstef > Date: Mon Jun 4 20:24:31 2018 > New Revision: 334630 > URL: https://svnweb.freebsd.org/changeset/base/334630 > > Log: > indent(1): remove static const char copyright[] > > It repeats what is already said in the heading comment and it's optimized out > so serves no purpose. The purpose would be to put a copyright into the binary, and why that is not happening when the original authors intended that is not good. This is a regression, as 5.4p8 shows: {108}% strings /usr/bin/indent | grep -i copy bcopy @(#) Copyright (c) 1985 Sun Microsystems, Inc. @(#) Copyright (c) 1976 Board of Trustees of the University of Illinois. @(#) Copyright (c) 1980, 1993 Please walk very very very carefully around all things "copyright". > Modified: > head/usr.bin/indent/indent.c > > Modified: head/usr.bin/indent/indent.c > ============================================================================== > --- head/usr.bin/indent/indent.c Mon Jun 4 20:21:51 2018 (r334629) > +++ head/usr.bin/indent/indent.c Mon Jun 4 20:24:31 2018 (r334630) > @@ -35,14 +35,6 @@ > * SUCH DAMAGE. > */ > > -#ifndef lint > -static const char copyright[] = > -"@(#) Copyright (c) 1985 Sun Microsystems, Inc.\n\ > -@(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.\n\ > -@(#) Copyright (c) 1980, 1993\n\ > - The Regents of the University of California. All rights reserved.\n"; > -#endif /* not lint */ > - > #if 0 > #ifndef lint > static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93"; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 5 02:08:09 2018 Return-Path: Delivered-To: svn-src-head@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 6B6F1FDBBB8 for ; Tue, 5 Jun 2018 02:08:09 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 ED77276564 for ; Tue, 5 Jun 2018 02:08:08 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 4579221a-6865-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 4579221a-6865-11e8-8837-614b7c574d04; Tue, 05 Jun 2018 02:08:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5527x23036281; Mon, 4 Jun 2018 20:07:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528164479.32688.223.camel@freebsd.org> Subject: Re: svn commit: r334630 - head/usr.bin/indent From: Ian Lepore To: rgrimes@freebsd.org, Piotr Pawel Stefaniak Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 04 Jun 2018 20:07:59 -0600 In-Reply-To: <201806050000.w5500Men098070@pdx.rh.CN85.dnsmgr.net> References: <201806050000.w5500Men098070@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 02:08:09 -0000 On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote: > > > > Author: pstef > > Date: Mon Jun  4 20:24:31 2018 > > New Revision: 334630 > > URL: https://svnweb.freebsd.org/changeset/base/334630 > > > > Log: > >   indent(1): remove static const char copyright[] > >    > >   It repeats what is already said in the heading comment and it's optimized out > >   so serves no purpose. > The purpose would be to put a copyright into the binary, and why that is not > happening when the original authors intended that is not good. > > This is a regression, as 5.4p8 shows: > {108}% strings /usr/bin/indent | grep -i copy > bcopy > @(#) Copyright (c) 1985 Sun Microsystems, Inc. > @(#) Copyright (c) 1976 Board of Trustees of the University of Illinois. > @(#) Copyright (c) 1980, 1993 > > Please walk very very very carefully around all things "copyright". > Does it matter what the original author intended? Nothing in the license text itself requires that copyright info be included in the binary (it just has to be in the docs and accompanying materials). So why would an edit to remove that from the binary be any different than any other edit to the code that any committer chooses to make? -- Ian From owner-svn-src-head@freebsd.org Tue Jun 5 02:47:42 2018 Return-Path: Delivered-To: svn-src-head@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 CB22DFE2F58; Tue, 5 Jun 2018 02:47:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5305478A14; Tue, 5 Jun 2018 02:47:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w552lcGh098577; Mon, 4 Jun 2018 19:47:38 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w552lcRx098576; Mon, 4 Jun 2018 19:47:38 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806050247.w552lcRx098576@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334630 - head/usr.bin/indent In-Reply-To: <1528164479.32688.223.camel@freebsd.org> To: Ian Lepore Date: Mon, 4 Jun 2018 19:47:38 -0700 (PDT) CC: rgrimes@freebsd.org, Piotr Pawel Stefaniak , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 02:47:43 -0000 [ Charset ISO-8859-1 unsupported, converting... ] > On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote: > > > > > > Author: pstef > > > Date: Mon Jun??4 20:24:31 2018 > > > New Revision: 334630 > > > URL: https://svnweb.freebsd.org/changeset/base/334630 > > > > > > Log: > > > ? indent(1): remove static const char copyright[] > > > ?? > > > ? It repeats what is already said in the heading comment and it's optimized out > > > ? so serves no purpose. > > The purpose would be to put a copyright into the binary, and why that is not > > happening when the original authors intended that is not good. > > > > This is a regression, as 5.4p8 shows: > > {108}% strings /usr/bin/indent | grep -i copy > > bcopy > > @(#) Copyright (c) 1985 Sun Microsystems, Inc. > > @(#) Copyright (c) 1976 Board of Trustees of the University of Illinois. > > @(#) Copyright (c) 1980, 1993 > > > > Please walk very very very carefully around all things "copyright". > > > > Does it matter what the original author intended? Yes, it does. > Nothing in the > license text itself requires that copyright info be included in the > binary (it just has to be in the docs and accompanying materials). So > why would an edit to remove that from the binary be any different than > any other edit to the code that any committer chooses to make? Because he deleted lines that contain the word "copyright" and that is just a dangerious place to play. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 5 02:56:23 2018 Return-Path: Delivered-To: svn-src-head@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 8298AFE45C4 for ; Tue, 5 Jun 2018 02:56:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 09E1C79231 for ; Tue, 5 Jun 2018 02:56:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id t6-v6so1470626iob.10 for ; Mon, 04 Jun 2018 19:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W3wufb5Ursl3aQy899paiAoVgNBEcIhZNtUhilAZDws=; b=DcH7EN0AUNEFa7/k++EOSwr4sRrDzKGaXv5csN1583SANk/BV/zXbBST5JgP6WEtQN dDvh0SVE/YSA2t5UYOoVj8kkjQk8OSQHN8RAUOAtn6f4KD79MVmCT6yJxuO4YJZyegDq mPQNm4788jHU+YODI6FUDmA0WwRfMJbtLR2pzdmBC+Y/yQLWkPqZLgedwQkwS3wkNNOe kuQMkT4fHAQ4fRBx5nQmZ6YKSb0WJdVK9GV7XHngO4oywln+ja/nMoCTX4FYSImmpN50 Ks3aboO/8+9aFK+mQVjS9CKAQqz29gcMAhIZX+Dm30iYDhZax2KvMymlVo6j8Ob/aT2d NZHw== 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=W3wufb5Ursl3aQy899paiAoVgNBEcIhZNtUhilAZDws=; b=lOa0gWBzlkERgvP617QUNNgMS5LdGzRLYpngi7Y7CBxVov2XlNtvXw57P7XLJvu+E9 O6U0oSLqt3jutg6ObD8CKiK21L3JvB95Lqq2yUaBUSVSK3ZAK/vLTtjBcvtOhqgqFNj4 p5qBB3PxgwlB98VnCKJU3TccpfDOROQVp2vRSocIdGEJCLhYw9/p3htgVnnOKt0TRyXN /UgWFr4yC/iLezRWK+GMxXMqP1FO+D8pKPblNZnCJ1BG4PzKtDLlmmnYtkYSYn3UbzfS uyJZyhLpDBMD1f85cpV84RssRAnbU7xVxQDyteCHrjIlDbI0SCG3vwe5O/r1NVElRnjM r/Pw== X-Gm-Message-State: ALKqPweG+2UUZSPTv4aIFrde6di+Wy9/YUbGXaXob35RrNBi0P07lPqb H+aQY+scINtPBOzQq1KL6IcAGZCIiI+ucseM8IXSWw== X-Google-Smtp-Source: ADUXVKLyLOAYpFPpo2YBQ/ux1P6Ge3s99bij3clgqxv6BgwNupdt6ITSAbijEZ8I277moCSIsCKxBSoVghIwbPeKQbA= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr23131541iof.299.1528167382201; Mon, 04 Jun 2018 19:56:22 -0700 (PDT) MIME-Version: 1.0 References: <1528164479.32688.223.camel@freebsd.org> <201806050247.w552lcRx098576@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201806050247.w552lcRx098576@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 4 Jun 2018 20:56:10 -0600 Message-ID: Subject: Re: svn commit: r334630 - head/usr.bin/indent To: "Rodney W. Grimes" Cc: Ian Lepore , "Piotr P. Stefaniak" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 02:56:23 -0000 On Mon, Jun 4, 2018, 8:47 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset ISO-8859-1 unsupported, converting... ] > > On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote: > > > > > > > > Author: pstef > > > > Date: Mon Jun??4 20:24:31 2018 > > > > New Revision: 334630 > > > > URL: https://svnweb.freebsd.org/changeset/base/334630 > > > > > > > > Log: > > > > ? indent(1): remove static const char copyright[] > > > > ?? > > > > ? It repeats what is already said in the heading comment and it's > optimized out > > > > ? so serves no purpose. > > > The purpose would be to put a copyright into the binary, and why that > is not > > > happening when the original authors intended that is not good. > > > > > > This is a regression, as 5.4p8 shows: > > > {108}% strings /usr/bin/indent | grep -i copy > > > bcopy > > > @(#) Copyright (c) 1985 Sun Microsystems, Inc. > > > @(#) Copyright (c) 1976 Board of Trustees of the University of > Illinois. > > > @(#) Copyright (c) 1980, 1993 > > > > > > Please walk very very very carefully around all things "copyright". > > > > > > > Does it matter what the original author intended? > Yes, it does. > > > Nothing in the > > license text itself requires that copyright info be included in the > > binary (it just has to be in the docs and accompanying materials). So > > why would an edit to remove that from the binary be any different than > > any other edit to the code that any committer chooses to make? > > Because he deleted lines that contain the word "copyright" > and that is just a dangerious place to play. > It looked fine to me. All the dates predate the adoption of the Berne Convention. Marking isn't needed anymore for a copyright. The same text is earlier in the file. I'm not sure there is a problem here... Warner Warner > From owner-svn-src-head@freebsd.org Tue Jun 5 03:00:08 2018 Return-Path: Delivered-To: svn-src-head@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 606BDFE4E0E; Tue, 5 Jun 2018 03:00:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA39B79510; Tue, 5 Jun 2018 03:00:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w55305BI098665; Mon, 4 Jun 2018 20:00:05 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w55305GE098664; Mon, 4 Jun 2018 20:00:05 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806050300.w55305GE098664@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334630 - head/usr.bin/indent In-Reply-To: To: Warner Losh Date: Mon, 4 Jun 2018 20:00:05 -0700 (PDT) CC: "Rodney W. Grimes" , Ian Lepore , "Piotr P. Stefaniak" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 03:00:08 -0000 > On Mon, Jun 4, 2018, 8:47 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset ISO-8859-1 unsupported, converting... ] > > > On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote: > > > > > > > > > > Author: pstef > > > > > Date: Mon Jun??4 20:24:31 2018 > > > > > New Revision: 334630 > > > > > URL: https://svnweb.freebsd.org/changeset/base/334630 > > > > > > > > > > Log: > > > > > ? indent(1): remove static const char copyright[] > > > > > ?? > > > > > ? It repeats what is already said in the heading comment and it's > > optimized out > > > > > ? so serves no purpose. > > > > The purpose would be to put a copyright into the binary, and why that > > is not > > > > happening when the original authors intended that is not good. > > > > > > > > This is a regression, as 5.4p8 shows: > > > > {108}% strings /usr/bin/indent | grep -i copy > > > > bcopy > > > > @(#) Copyright (c) 1985 Sun Microsystems, Inc. > > > > @(#) Copyright (c) 1976 Board of Trustees of the University of > > Illinois. > > > > @(#) Copyright (c) 1980, 1993 > > > > > > > > Please walk very very very carefully around all things "copyright". > > > > > > > > > > Does it matter what the original author intended? > > Yes, it does. > > > > > Nothing in the > > > license text itself requires that copyright info be included in the > > > binary (it just has to be in the docs and accompanying materials). So > > > why would an edit to remove that from the binary be any different than > > > any other edit to the code that any committer chooses to make? > > > > Because he deleted lines that contain the word "copyright" > > and that is just a dangerious place to play. > > > > It looked fine to me. All the dates predate the adoption of the Berne > Convention. Which means exactly what? That Berne does not apply, or does apply? > Marking isn't needed anymore for a copyright. Marking was needed at the time that copyright was applied, so that marking should stay intact. > The same text is > earlier in the file. I'm not sure there is a problem here... I dont make legal bets on "not sure", do you? > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jun 5 03:12:10 2018 Return-Path: Delivered-To: svn-src-head@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 54F92FE6DB9; Tue, 5 Jun 2018 03:12:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F15C87A539; Tue, 5 Jun 2018 03:12:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 8DC5219411; Tue, 5 Jun 2018 03:12:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f51.google.com with SMTP id v135-v6so1117424lfa.9; Mon, 04 Jun 2018 20:12:09 -0700 (PDT) X-Gm-Message-State: APt69E3jLuYf5kSCcWeQwar4m1ZeaBeH33keb5IH3JtBPRlh6oZFpoCo z013ZAk+dldLj6WI/p3tyT7KOQTGSF2tUkQPnaQ= X-Google-Smtp-Source: ADUXVKI5chUkeK/abH1FHEd9IvuIbHU637dsPNx02tklB8SFq/3zw1i6S5o6pJ6j5+9SnjIYXxLSWz52nO+7aBshTYw= X-Received: by 2002:a2e:1188:: with SMTP id 8-v6mr14127721ljr.38.1528168327922; Mon, 04 Jun 2018 20:12:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3112:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 20:11:47 -0700 (PDT) In-Reply-To: <201805252146.w4PLk7vL009258@repo.freebsd.org> References: <201805252146.w4PLk7vL009258@repo.freebsd.org> From: Kyle Evans Date: Mon, 4 Jun 2018 22:11:47 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 03:12:10 -0000 On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri May 25 21:46:07 2018 > New Revision: 334226 > URL: https://svnweb.freebsd.org/changeset/base/334226 > > Log: > Cleanup style > > Modified: > head/lib/libpmcstat/pmu-events/Makefile > > Modified: head/lib/libpmcstat/pmu-events/Makefile > ============================================================================== > --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2018 (r334225) > +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2018 (r334226) > @@ -1,9 +1,10 @@ > # $FreeBSD$ > > -PROG=jevents > -SRCS=jevents.c jsmn.c json.c > +PROG= jevents > +SRCS= jevents.c jsmn.c json.c > CFLAGS+= -Wno-cast-qual > -.PATH: ${.CURDIR} > -build-tools: jevents > MAN= > + > +build-tools: jevents > + > .include > Hi Bryan, Something about this appears to be subtly wrong, but I can't quite pin down what. I'm getting a failure in the lib32 build of libpmc: sh: ./pmu-events/jevents: not found My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents. ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and libpmc_events.c.meta. I'm guessing this is the problem- that obj-lib32/... doesn't have the built jevents, but it's not obvious to me why this is the case. From owner-svn-src-head@freebsd.org Tue Jun 5 04:26:44 2018 Return-Path: Delivered-To: svn-src-head@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 79F08FF1A6D; Tue, 5 Jun 2018 04:26:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ABB57DA9B; Tue, 5 Jun 2018 04:26:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EF4177A2; Tue, 5 Jun 2018 04:26:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w554QhDP001409; Tue, 5 Jun 2018 04:26:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w554QfVq001396; Tue, 5 Jun 2018 04:26:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806050426.w554QfVq001396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 5 Jun 2018 04:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334647 - in head: lib/libpmc sys/dev/hwpmc sys/kern sys/sys usr.sbin usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmc sys/dev/hwpmc sys/kern sys/sys usr.sbin usr.sbin/pmc X-SVN-Commit-Revision: 334647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 04:26:44 -0000 Author: mmacy Date: Tue Jun 5 04:26:40 2018 New Revision: 334647 URL: https://svnweb.freebsd.org/changeset/base/334647 Log: hwpmc: log name->pid, name->tid mappings By logging all threads and processes 'pmc filter' can now filter on process or thread name, relieving the user of the burden of determining which tid or pid was which when the sample was taken. % pmc filter -T if_io_tqg -P nginx pmc.log pmc-iflib.log % pmc filter -x -T idle pmc.log pmc-noidle.log Added: head/usr.sbin/pmc/cmd_pmc_filter.cc - copied, changed from r334645, head/usr.sbin/pmc/cmd_pmc_filter.c Deleted: head/usr.sbin/pmc/cmd_pmc_filter.c Modified: head/lib/libpmc/pmclog.c head/lib/libpmc/pmclog.h head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/sys/pmc.h head/sys/sys/pmckern.h head/sys/sys/pmclog.h head/usr.sbin/Makefile head/usr.sbin/pmc/Makefile (contents, props changed) head/usr.sbin/pmc/cmd_pmc.h (contents, props changed) Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/lib/libpmc/pmclog.c Tue Jun 5 04:26:40 2018 (r334647) @@ -404,6 +404,19 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_USERDATA: PMCLOG_READ32(le,ev->pl_u.pl_u.pl_userdata); break; + case PMCLOG_TYPE_THR_CREATE: + PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_tid); + PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_pid); + PMCLOG_READ32(le,noop); + memcpy(ev->pl_u.pl_tc.pl_tdname, le, MAXCOMLEN+1); + break; + case PMCLOG_TYPE_THR_EXIT: + PMCLOG_READ32(le,ev->pl_u.pl_te.pl_tid); + break; + case PMCLOG_TYPE_PROC_CREATE: + PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_pid); + memcpy(ev->pl_u.pl_pc.pl_pcomm, le, MAXCOMLEN+1); + break; default: /* unknown record type */ ps->ps_state = PL_STATE_ERROR; ev->pl_state = PMCLOG_ERROR; Modified: head/lib/libpmc/pmclog.h ============================================================================== --- head/lib/libpmc/pmclog.h Tue Jun 5 01:05:58 2018 (r334646) +++ head/lib/libpmc/pmclog.h Tue Jun 5 04:26:40 2018 (r334647) @@ -120,6 +120,11 @@ struct pmclog_ev_proccsw { pmc_value_t pl_value; }; +struct pmclog_ev_proccreate { + pid_t pl_pid; + char pl_pcomm[MAXCOMLEN+1]; +}; + struct pmclog_ev_procexec { pid_t pl_pid; pmc_id_t pl_pmcid; @@ -142,6 +147,16 @@ struct pmclog_ev_sysexit { pid_t pl_pid; }; +struct pmclog_ev_threadcreate { + pid_t pl_tid; + pid_t pl_pid; + char pl_tdname[MAXCOMLEN+1]; +}; + +struct pmclog_ev_threadexit { + pid_t pl_tid; +}; + struct pmclog_ev_userdata { uint32_t pl_userdata; }; @@ -166,10 +181,13 @@ struct pmclog_ev { struct pmclog_ev_pmcattach pl_t; struct pmclog_ev_pmcdetach pl_d; struct pmclog_ev_proccsw pl_c; + struct pmclog_ev_proccreate pl_pc; struct pmclog_ev_procexec pl_x; struct pmclog_ev_procexit pl_e; struct pmclog_ev_procfork pl_f; struct pmclog_ev_sysexit pl_se; + struct pmclog_ev_threadcreate pl_tc; + struct pmclog_ev_threadexit pl_te; struct pmclog_ev_userdata pl_u; } pl_u; }; Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/dev/hwpmc/hwpmc_logging.c Tue Jun 5 04:26:40 2018 (r334647) @@ -229,7 +229,7 @@ static void pmclog_loop(void *arg); static void pmclog_release(struct pmc_owner *po); static uint32_t *pmclog_reserve(struct pmc_owner *po, int length); static void pmclog_schedule_io(struct pmc_owner *po, int wakeup); -static void pmclog_schedule_all(struct pmc_owner *po); +static void pmclog_schedule_all(struct pmc_owner *po, int force); static void pmclog_stop_kthread(struct pmc_owner *po); /* @@ -808,7 +808,7 @@ pmclog_deconfigure_log(struct pmc_owner *po) */ int -pmclog_flush(struct pmc_owner *po) +pmclog_flush(struct pmc_owner *po, int force) { int error; @@ -832,7 +832,7 @@ pmclog_flush(struct pmc_owner *po) goto error; } - pmclog_schedule_all(po); + pmclog_schedule_all(po, force); error: mtx_unlock(&pmc_kthread_mtx); @@ -840,9 +840,8 @@ pmclog_flush(struct pmc_owner *po) } static void -pmclog_schedule_one_cond(void *arg) +pmclog_schedule_one_cond(struct pmc_owner *po, int force) { - struct pmc_owner *po = arg; struct pmclog_buffer *plb; int cpu; @@ -851,7 +850,8 @@ pmclog_schedule_one_cond(void *arg) /* tell hardclock not to run again */ if (PMC_CPU_HAS_SAMPLES(cpu)) PMC_CALL_HOOK_UNLOCKED(curthread, PMC_FN_DO_SAMPLES, NULL); - pmc_flush_samples(cpu); + if (force) + pmc_flush_samples(cpu); plb = po->po_curbuf[cpu]; if (plb && plb->plb_ptr != plb->plb_base) pmclog_schedule_io(po, 1); @@ -859,7 +859,7 @@ pmclog_schedule_one_cond(void *arg) } static void -pmclog_schedule_all(struct pmc_owner *po) +pmclog_schedule_all(struct pmc_owner *po, int force) { /* * Schedule the current buffer if any and not empty. @@ -868,7 +868,7 @@ pmclog_schedule_all(struct pmc_owner *po) thread_lock(curthread); sched_bind(curthread, i); thread_unlock(curthread); - pmclog_schedule_one_cond(po); + pmclog_schedule_one_cond(po, force); } thread_lock(curthread); sched_unbind(curthread); @@ -895,7 +895,7 @@ pmclog_close(struct pmc_owner *po) /* * Schedule the current buffer. */ - pmclog_schedule_all(po); + pmclog_schedule_all(po, 0); wakeup_one(po); mtx_unlock(&pmc_kthread_mtx); @@ -1044,6 +1044,22 @@ pmclog_process_pmcdetach(struct pmc *pm, pid_t pid) PMCLOG_DESPATCH_SYNC(po); } +void +pmclog_process_proccreate(struct pmc_owner *po, struct proc *p, int sync) +{ + if (sync) { + PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); + PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); + PMCLOG_DESPATCH_SYNC(po); + } else { + PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); + PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); + PMCLOG_DESPATCH(po); + } +} + /* * Log a context switch event to the log file. */ @@ -1079,14 +1095,13 @@ pmclog_process_procexec(struct pmc_owner *po, pmc_id_t pathlen = strlen(path) + 1; /* #bytes for the path */ recordlen = offsetof(struct pmclog_procexec, pl_pathname) + pathlen; - PMCLOG_RESERVE(po, PROCEXEC, recordlen); PMCLOG_EMIT32(pid); PMCLOG_EMIT32(pmid); PMCLOG_EMIT32(0); PMCLOG_EMITADDR(startaddr); PMCLOG_EMITSTRING(path,pathlen); - PMCLOG_DESPATCH(po); + PMCLOG_DESPATCH_SYNC(po); } /* @@ -1135,6 +1150,38 @@ pmclog_process_sysexit(struct pmc_owner *po, pid_t pid { PMCLOG_RESERVE(po, SYSEXIT, sizeof(struct pmclog_sysexit)); PMCLOG_EMIT32(pid); + PMCLOG_DESPATCH(po); +} + +void +pmclog_process_threadcreate(struct pmc_owner *po, struct thread *td, int sync) +{ + struct proc *p; + + p = td->td_proc; + if (sync) { + PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); + PMCLOG_EMIT32(td->td_tid); + PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMIT32(0); + PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); + PMCLOG_DESPATCH_SYNC(po); + } else { + PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); + PMCLOG_EMIT32(td->td_tid); + PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMIT32(0); + PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); + PMCLOG_DESPATCH(po); + } +} + +void +pmclog_process_threadexit(struct pmc_owner *po, struct thread *td) +{ + + PMCLOG_RESERVE(po, THR_EXIT, sizeof(struct pmclog_threadexit)); + PMCLOG_EMIT32(td->td_tid); PMCLOG_DESPATCH(po); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Jun 5 04:26:40 2018 (r334647) @@ -269,6 +269,11 @@ static int generic_switch_out(struct pmc_cpu *pc, stru static struct pmc_mdep *pmc_generic_cpu_initialize(void); static void pmc_generic_cpu_finalize(struct pmc_mdep *md); static void pmc_post_callchain_callback(void); +static void pmc_process_threadcreate(struct thread *td); +static void pmc_process_threadexit(struct thread *td); +static void pmc_process_proccreate(struct proc *p); +static void pmc_process_allproc(struct pmc *pm); + /* * Kernel tunables and sysctl(8) interface. */ @@ -2049,6 +2054,9 @@ const char *pmc_hooknames[] = { "THR-CREATE", "THR-EXIT", "THR-USERRET", + "THR-CREATE-LOG", + "THR-EXIT-LOG", + "PROC-CREATE-LOG" }; #endif @@ -2225,6 +2233,10 @@ pmc_hook_handler(struct thread *td, int function, void pmc_process_munmap(td, (struct pmckern_map_out *) arg); break; + case PMC_FN_PROC_CREATE_LOG: + pmc_process_proccreate((struct proc *)arg); + break; + case PMC_FN_USER_CALLCHAIN: /* * Record a call chain. @@ -2270,14 +2282,22 @@ pmc_hook_handler(struct thread *td, int function, void case PMC_FN_THR_CREATE: pmc_process_thread_add(td); + pmc_process_threadcreate(td); break; + case PMC_FN_THR_CREATE_LOG: + pmc_process_threadcreate(td); + break; + case PMC_FN_THR_EXIT: KASSERT(td == curthread, ("[pmc,%d] td != curthread", __LINE__)); pmc_process_thread_delete(td); + pmc_process_threadexit(td); break; - + case PMC_FN_THR_EXIT_LOG: + pmc_process_threadexit(td); + break; case PMC_FN_THR_USERRET: KASSERT(td == curthread, ("[pmc,%d] td != curthread", __LINE__)); @@ -2697,9 +2717,9 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * Loop (with a forced context switch) till the PMC's runcount * comes down to zero. */ - pmclog_flush(pm->pm_owner); + pmclog_flush(pm->pm_owner, 1); while (counter_u64_fetch(pm->pm_runcount) > 0) { - pmclog_flush(pm->pm_owner); + pmclog_flush(pm->pm_owner, 1); #ifdef HWPMC_DEBUG maxloop--; KASSERT(maxloop > 0, @@ -3439,7 +3459,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a break; } - error = pmclog_flush(po); + error = pmclog_flush(po, 0); } break; @@ -4015,6 +4035,8 @@ pmc_syscall_handler(struct thread *td, void *syscall_a pmc = NULL; break; } + if (mode == PMC_MODE_SS) + pmc_process_allproc(pmc); /* * Return the allocated index. @@ -5216,8 +5238,10 @@ pmc_process_fork(void *arg __unused, struct proc *p1, */ epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) - if (po->po_flags & PMC_PO_OWNS_LOGFILE) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_procfork(po, p1->p_pid, newproc->p_pid); + pmclog_process_proccreate(po, newproc, 1); + } epoch_exit_preempt(global_epoch_preempt); if (!is_using_hwpmcs) @@ -5277,6 +5301,64 @@ pmc_process_fork(void *arg __unused, struct proc *p1, done: sx_xunlock(&pmc_sx); +} + +static void +pmc_process_threadcreate(struct thread *td) +{ + struct pmc_owner *po; + + epoch_enter_preempt(global_epoch_preempt); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_threadcreate(po, td, 1); + epoch_exit_preempt(global_epoch_preempt); +} + +static void +pmc_process_threadexit(struct thread *td) +{ + struct pmc_owner *po; + + epoch_enter_preempt(global_epoch_preempt); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_threadexit(po, td); + epoch_exit_preempt(global_epoch_preempt); +} + +static void +pmc_process_proccreate(struct proc *p) +{ + struct pmc_owner *po; + + epoch_enter_preempt(global_epoch_preempt); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_proccreate(po, p, 1 /* sync */); + epoch_exit_preempt(global_epoch_preempt); +} + +static void +pmc_process_allproc(struct pmc *pm) +{ + struct pmc_owner *po; + struct thread *td; + struct proc *p; + + po = pm->pm_owner; + if ((po->po_flags & PMC_PO_OWNS_LOGFILE) == 0) + return; + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + pmclog_process_proccreate(po, p, 0 /* sync */); + PROC_LOCK(p); + FOREACH_THREAD_IN_PROC(p, td) + pmclog_process_threadcreate(po, td, 0 /* sync */); + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + pmclog_flush(po, 0); } static void Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/kern/kern_kthread.c Tue Jun 5 04:26:40 2018 (r334647) @@ -126,6 +126,12 @@ kproc_create(void (*func)(void *), void *arg, sched_clear_tdname(td); #endif TSTHREAD(td, td->td_name); +#ifdef HWPMC_HOOKS + if (PMC_SYSTEM_SAMPLING_ACTIVE()) { + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_PROC_CREATE_LOG, p2); + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_CREATE_LOG, NULL); + } +#endif /* call the processes' main()... */ cpu_fork_kthread_handler(td, func, arg); @@ -310,7 +316,10 @@ kthread_add(void (*func)(void *), void *arg, struct pr /* Avoid inheriting affinity from a random parent. */ cpuset_kernthread(newtd); - +#ifdef HWPMC_HOOKS + if (PMC_SYSTEM_SAMPLING_ACTIVE()) + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_CREATE_LOG, NULL); +#endif /* Delay putting it on the run queue until now. */ if (!(flags & RFSTOPPED)) { thread_lock(newtd); @@ -331,6 +340,10 @@ kthread_exit(void) td = curthread; p = td->td_proc; +#ifdef HWPMC_HOOKS + if (PMC_SYSTEM_SAMPLING_ACTIVE()) + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_EXIT_LOG, NULL); +#endif /* A module may be waiting for us to exit. */ wakeup(td); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/kern/kern_thr.c Tue Jun 5 04:26:40 2018 (r334647) @@ -265,6 +265,8 @@ thread_create(struct thread *td, struct rtprio *rtp, #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(p)) PMC_CALL_HOOK(newtd, PMC_FN_THR_CREATE, NULL); + else if (PMC_SYSTEM_SAMPLING_ACTIVE()) + PMC_CALL_HOOK_UNLOCKED(newtd, PMC_FN_THR_CREATE_LOG, NULL); #endif tidhash_add(newtd); @@ -592,6 +594,10 @@ sys_thr_set_name(struct thread *td, struct thr_set_nam if (ttd == NULL) return (ESRCH); strcpy(ttd->td_name, name); +#ifdef HWPMC_HOOKS + if (PMC_PROC_IS_USING_PMCS(p) || PMC_SYSTEM_SAMPLING_ACTIVE()) + PMC_CALL_HOOK_UNLOCKED(ttd, PMC_FN_THR_CREATE_LOG, NULL); +#endif #ifdef KTR sched_clear_tdname(ttd); #endif Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/kern/kern_thread.c Tue Jun 5 04:26:40 2018 (r334647) @@ -589,7 +589,8 @@ thread_exit(void) if (PMC_PROC_IS_USING_PMCS(td->td_proc)) { PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_EXIT, NULL); - } + } else if (PMC_SYSTEM_SAMPLING_ACTIVE()) + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_EXIT_LOG, NULL); #endif PROC_UNLOCK(p); PROC_STATLOCK(p); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/sys/pmc.h Tue Jun 5 04:26:40 2018 (r334647) @@ -62,7 +62,7 @@ * The patch version is incremented for every bug fix. */ #define PMC_VERSION_MAJOR 0x06 -#define PMC_VERSION_MINOR 0x01 +#define PMC_VERSION_MINOR 0x02 #define PMC_VERSION_PATCH 0x0000 #define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \ Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/sys/pmckern.h Tue Jun 5 04:26:40 2018 (r334647) @@ -63,6 +63,9 @@ #define PMC_FN_THR_CREATE 12 #define PMC_FN_THR_EXIT 13 #define PMC_FN_THR_USERRET 14 +#define PMC_FN_THR_CREATE_LOG 15 +#define PMC_FN_THR_EXIT_LOG 16 +#define PMC_FN_PROC_CREATE_LOG 17 #define PMC_HR 0 /* Hardware ring buffer */ #define PMC_SR 1 /* Software ring buffer */ Modified: head/sys/sys/pmclog.h ============================================================================== --- head/sys/sys/pmclog.h Tue Jun 5 01:05:58 2018 (r334646) +++ head/sys/sys/pmclog.h Tue Jun 5 04:26:40 2018 (r334647) @@ -67,7 +67,13 @@ enum pmclog_type { * * New variant of PMCLOG_TYPE_PMCALLOCATE for dynamic event. */ - PMCLOG_TYPE_PMCALLOCATEDYN = 17 + PMCLOG_TYPE_PMCALLOCATEDYN = 17, + /* + * V6 ABI + */ + PMCLOG_TYPE_THR_CREATE = 18, + PMCLOG_TYPE_THR_EXIT = 19, + PMCLOG_TYPE_PROC_CREATE = 20 }; /* @@ -181,6 +187,12 @@ struct pmclog_proccsw { uint32_t pl_tid; } __packed; +struct pmclog_proccreate { + PMCLOG_ENTRY_HEADER + uint32_t pl_pid; + uint64_t pl_pcomm[MAXCOMLEN+1]; /* keep 8 byte aligned */ +} __packed; + struct pmclog_procexec { PMCLOG_ENTRY_HEADER uint32_t pl_pid; @@ -210,6 +222,19 @@ struct pmclog_sysexit { uint32_t pl_pid; } __packed; +struct pmclog_threadcreate { + PMCLOG_ENTRY_HEADER + uint32_t pl_tid; + uint32_t pl_pid; + uint32_t pl_pad; + uint64_t pl_tdname[MAXCOMLEN+1]; /* keep 8 byte aligned */ +} __packed; + +struct pmclog_threadexit { + PMCLOG_ENTRY_HEADER + uint32_t pl_tid; +} __packed; + struct pmclog_userdata { PMCLOG_ENTRY_HEADER uint32_t pl_userdata; @@ -261,7 +286,7 @@ union pmclog_entry { /* only used to size scratch are int pmclog_configure_log(struct pmc_mdep *_md, struct pmc_owner *_po, int _logfd); int pmclog_deconfigure_log(struct pmc_owner *_po); -int pmclog_flush(struct pmc_owner *_po); +int pmclog_flush(struct pmc_owner *_po, int force); int pmclog_close(struct pmc_owner *_po); void pmclog_initialize(void); int pmclog_proc_create(struct thread *td, void **handlep); @@ -283,6 +308,9 @@ void pmclog_process_procexec(struct pmc_owner *_po, pm void pmclog_process_procexit(struct pmc *_pm, struct pmc_process *_pp); void pmclog_process_procfork(struct pmc_owner *_po, pid_t _oldpid, pid_t _newpid); void pmclog_process_sysexit(struct pmc_owner *_po, pid_t _pid); +void pmclog_process_threadcreate(struct pmc_owner *_po, struct thread *td, int sync); +void pmclog_process_threadexit(struct pmc_owner *_po, struct thread *td); +void pmclog_process_proccreate(struct pmc_owner *_po, struct proc *p, int sync); int pmclog_process_userlog(struct pmc_owner *_po, struct pmc_op_writelog *_wl); void pmclog_shutdown(void); Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jun 5 01:05:58 2018 (r334646) +++ head/usr.sbin/Makefile Tue Jun 5 04:26:40 2018 (r334647) @@ -179,7 +179,9 @@ SUBDIR.${MK_OPENSSL}+= keyserv SUBDIR.${MK_PC_SYSINSTALL}+= pc-sysinstall SUBDIR.${MK_PF}+= ftp-proxy SUBDIR.${MK_PKGBOOTSTRAP}+= pkg +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) SUBDIR.${MK_PMC}+= pmc +.endif SUBDIR.${MK_PMC}+= pmcannotate SUBDIR.${MK_PMC}+= pmccontrol SUBDIR.${MK_PMC}+= pmcstat Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Tue Jun 5 01:05:58 2018 (r334646) +++ head/usr.sbin/pmc/Makefile Tue Jun 5 04:26:40 2018 (r334647) @@ -2,12 +2,14 @@ # $FreeBSD$ # -PROG= pmc +.include +PROG_CXX= pmc MAN= +CXXFLAGS+= -O0 LIBADD= kvm pmc m ncursesw pmcstat elf SRCS= pmc.c pmc_util.c cmd_pmc_stat.c \ - cmd_pmc_list.c cmd_pmc_filter.c + cmd_pmc_list.c cmd_pmc_filter.cc .include Modified: head/usr.sbin/pmc/cmd_pmc.h ============================================================================== --- head/usr.sbin/pmc/cmd_pmc.h Tue Jun 5 01:05:58 2018 (r334646) +++ head/usr.sbin/pmc/cmd_pmc.h Tue Jun 5 04:26:40 2018 (r334647) @@ -40,11 +40,16 @@ extern struct pmcstat_args pmc_args; typedef int (*cmd_disp_t)(int, char **); -int cmd_pmc_stat(int, char **); -int cmd_pmc_filter(int, char **); -int cmd_pmc_stat_system(int, char **); -int cmd_pmc_list_events(int, char **); - +#if defined(__cplusplus) +extern "C" { +#endif + int cmd_pmc_stat(int, char **); + int cmd_pmc_filter(int, char **); + int cmd_pmc_stat_system(int, char **); + int cmd_pmc_list_events(int, char **); +#if defined(__cplusplus) +}; +#endif int pmc_util_get_pid(struct pmcstat_args *); void pmc_util_start_pmcs(struct pmcstat_args *); void pmc_util_cleanup(struct pmcstat_args *); Copied and modified: head/usr.sbin/pmc/cmd_pmc_filter.cc (from r334645, head/usr.sbin/pmc/cmd_pmc_filter.c) ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 23:17:18 2018 (r334645, copy source) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Tue Jun 5 04:26:40 2018 (r334647) @@ -68,11 +68,22 @@ __FBSDID("$FreeBSD$"); #include #include "cmd_pmc.h" +#include +#include +#if _LIBCPP_STD_VER >= 11 +#include +using std::unordered_map; +#else +#include +using std::tr1::unordered_map; +#endif #define LIST_MAX 64 static struct option longopts[] = { - {"threads", no_argument, NULL, 't'}, - {"pids", no_argument, NULL, 'p'}, - {"events", no_argument, NULL, 'e'}, + {"lwps", required_argument, NULL, 't'}, + {"pids", required_argument, NULL, 'p'}, + {"threads", required_argument, NULL, 'T'}, + {"processes", required_argument, NULL, 'P'}, + {"events", required_argument, NULL, 'e'}, {NULL, 0, NULL, 0} }; @@ -81,15 +92,18 @@ usage(void) { errx(EX_USAGE, "\t filter log file\n" - "\t -t , --threads -- comma-delimited list of lwps to filter on\n" - "\t -p , --pids -- comma-delimited list of pids to filter on\n" "\t -e , --events -- comma-delimited list of events to filter on\n" + "\t -p , --pids -- comma-delimited list of pids to filter on\n" + "\t -P , --processes -- comma-delimited list of process names to filter on\n" + "\t -t , --lwps -- comma-delimited list of lwps to filter on\n" + "\t -T , --threads -- comma-delimited list of thread names to filter on\n" + "\t -x -- toggle inclusive filtering\n" ); } static void -parse_intlist(char *strlist, int *intlist, int *pcount, int (*fn) (const char *)) +parse_intlist(char *strlist, uint32_t *intlist, int *pcount, int (*fn) (const char *)) { char *token; int count, tokenval; @@ -105,7 +119,7 @@ parse_intlist(char *strlist, int *intlist, int *pcount } static void -parse_events(char *strlist, int *intlist, int *pcount, char *cpuid) +parse_events(char *strlist, uint32_t intlist[LIST_MAX], int *pcount, char *cpuid) { char *token; int count, tokenval; @@ -120,6 +134,21 @@ parse_events(char *strlist, int *intlist, int *pcount, *pcount = count; } +static void +parse_names(char *strlist, char *namelist[LIST_MAX], int *pcount) +{ + char *token; + int count; + + count = 0; + while ((token = strsep(&strlist, ",")) != NULL && + count < LIST_MAX) { + namelist[count++] = token; + } + *pcount = count; +} + + struct pmcid_ent { uint32_t pe_pmcid; uint32_t pe_idx; @@ -129,23 +158,52 @@ struct pmcid_ent { (PMCLOG_TYPE_ ## T << 16) | \ ((L) & 0xFFFF)) + +typedef unordered_map < int ,std::string > idmap; +typedef std::pair < int ,std::string > identry; + +static bool +pmc_find_name(idmap & map, uint32_t id, char *list[LIST_MAX], int count) +{ + int i; + + auto kvpair = map.find(id); + if (kvpair == map.end()) { + printf("unknown id: %d\n", id); + return (false); + } + auto p = list; + for (i = 0; i < count; i++, p++) { + if (strstr(kvpair->second.c_str(), *p) != NULL) + return (true); + } + return (false); +} + static void pmc_filter_handler(uint32_t *lwplist, int lwpcount, uint32_t *pidlist, int pidcount, - char *events, int infd, int outfd) + char *events, char *processes, char *threads, bool exclusive, int infd, + int outfd) { struct pmclog_ev ev; struct pmclog_parse_state *ps; struct pmcid_ent *pe; uint32_t eventlist[LIST_MAX]; char cpuid[PMC_CPUID_LEN]; - int i, pmccount, copies, eventcount; - uint32_t idx, h; - off_t dstoff; + char *proclist[LIST_MAX]; + char *threadlist[LIST_MAX]; + int i, pmccount, copies, eventcount, proccount, threadcount; + uint32_t idx; + idmap pidmap, tidmap; - if ((ps = pmclog_open(infd)) == NULL) + if ((ps = static_cast < struct pmclog_parse_state *>(pmclog_open(infd)))== NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - eventcount = pmccount = 0; + proccount = eventcount = pmccount = 0; + if (processes) + parse_names(processes, proclist, &proccount); + if (threads) + parse_names(threads, threadlist, &threadcount); while (pmclog_read(ps, &ev) == 0) { if (ev.pl_type == PMCLOG_TYPE_INITIALIZE) memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); @@ -157,9 +215,9 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui lseek(infd, 0, SEEK_SET); pmclog_close(ps); - if ((ps = pmclog_open(infd)) == NULL) + if ((ps = static_cast < struct pmclog_parse_state *>(pmclog_open(infd)))== NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - if ((pe = malloc(sizeof(*pe) * pmccount)) == NULL) + if ((pe = (typeof(pe)) malloc(sizeof(*pe) * pmccount)) == NULL) errx(EX_OSERR, "ERROR: failed to allocate pmcid map"); i = 0; while (pmclog_read(ps, &ev) == 0 && i < pmccount) { @@ -171,12 +229,14 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui } lseek(infd, 0, SEEK_SET); pmclog_close(ps); - if ((ps = pmclog_open(infd)) == NULL) + if ((ps = static_cast < struct pmclog_parse_state *>(pmclog_open(infd)))== NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - dstoff = copies = 0; + copies = 0; while (pmclog_read(ps, &ev) == 0) { - dstoff += ev.pl_len; - h = *(uint32_t *)ev.pl_data; + if (ev.pl_type == PMCLOG_TYPE_THR_CREATE) + tidmap.insert(identry(ev.pl_u.pl_tc.pl_tid, ev.pl_u.pl_tc.pl_tdname)); + if (ev.pl_type == PMCLOG_TYPE_PROC_CREATE) + pidmap.insert(identry(ev.pl_u.pl_pc.pl_pid, ev.pl_u.pl_pc.pl_pcomm)); if (ev.pl_type != PMCLOG_TYPE_CALLCHAIN) { if (write(outfd, ev.pl_data, ev.pl_len) != (ssize_t)ev.pl_len) errx(EX_OSERR, "ERROR: failed output write"); @@ -186,14 +246,14 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui for (i = 0; i < pidcount; i++) if (pidlist[i] == ev.pl_u.pl_cc.pl_pid) break; - if (i == pidcount) + if ((i == pidcount) == exclusive) continue; } if (lwpcount) { for (i = 0; i < lwpcount; i++) if (lwplist[i] == ev.pl_u.pl_cc.pl_tid) break; - if (i == lwpcount) + if ((i == lwpcount) == exclusive) continue; } if (eventcount) { @@ -210,9 +270,15 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui if (idx == eventlist[i]) break; } - if (i == eventcount) + if ((i == eventcount) == exclusive) continue; } + if (proccount && + pmc_find_name(pidmap, ev.pl_u.pl_cc.pl_pid, proclist, proccount) == exclusive) + continue; + if (threadcount && + pmc_find_name(tidmap, ev.pl_u.pl_cc.pl_tid, threadlist, threadcount) == exclusive) + continue; if (write(outfd, ev.pl_data, ev.pl_len) != (ssize_t)ev.pl_len) errx(EX_OSERR, "ERROR: failed output write"); } @@ -221,25 +287,36 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui int cmd_pmc_filter(int argc, char **argv) { - char *lwps, *pids, *events; + char *lwps, *pids, *events, *processes, *threads; uint32_t lwplist[LIST_MAX]; uint32_t pidlist[LIST_MAX]; int option, lwpcount, pidcount; int prelogfd, postlogfd; + bool exclusive; - lwps = pids = events = NULL; + threads = processes = lwps = pids = events = NULL; lwpcount = pidcount = 0; - while ((option = getopt_long(argc, argv, "t:p:e:", longopts, NULL)) != -1) { + exclusive = false; + while ((option = getopt_long(argc, argv, "e:p:t:xP:T:", longopts, NULL)) != -1) { switch (option) { - case 't': - lwps = strdup(optarg); + case 'e': + events = strdup(optarg); break; case 'p': pids = strdup(optarg); break; - case 'e': - events = strdup(optarg); + case 'P': + processes = strdup(optarg); break; + case 't': + lwps = strdup(optarg); + break; + case 'T': + threads = strdup(optarg); + break; + case 'x': + exclusive = !exclusive; + break; case '?': default: usage(); @@ -264,6 +341,6 @@ cmd_pmc_filter(int argc, char **argv) strerror(errno)); pmc_filter_handler(lwplist, lwpcount, pidlist, pidcount, events, - prelogfd, postlogfd); + processes, threads, exclusive, prelogfd, postlogfd); return (0); } From owner-svn-src-head@freebsd.org Tue Jun 5 04:33:05 2018 Return-Path: Delivered-To: svn-src-head@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 CE913FF2AA2; Tue, 5 Jun 2018 04:33:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F63D7E14E; Tue, 5 Jun 2018 04:33:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 18F7619CFF; Tue, 5 Jun 2018 04:33:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f44.google.com with SMTP id v135-v6so1315448lfa.9; Mon, 04 Jun 2018 21:33:05 -0700 (PDT) X-Gm-Message-State: ALKqPwcYo/AjnR5K9rZDKMrcrmQ1y5VbkjdBkMNVGF9kGwqz3rI+ZeRI zbt1lxvLdykAZD85UzfvA4AKOnTsU+exPnZmoOA= X-Google-Smtp-Source: ADUXVKJzJMKGiR6sI7Wv+UPQqVduOQ9RDx8Is/B9f0jOKe3Fw2G4X23GmX0Xj0jHd1fAbEX9bdcthxJptPjYuS/1f/o= X-Received: by 2002:a2e:1b0a:: with SMTP id b10-v6mr16726421ljb.76.1528173183606; Mon, 04 Jun 2018 21:33:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3112:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 21:32:43 -0700 (PDT) In-Reply-To: References: <201805252146.w4PLk7vL009258@repo.freebsd.org> From: Kyle Evans Date: Mon, 4 Jun 2018 23:32:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 04:33:06 -0000 On Mon, Jun 4, 2018 at 10:11 PM, Kyle Evans wrote: > On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Fri May 25 21:46:07 2018 >> New Revision: 334226 >> URL: https://svnweb.freebsd.org/changeset/base/334226 >> >> Log: >> Cleanup style >> >> Modified: >> head/lib/libpmcstat/pmu-events/Makefile >> >> Modified: head/lib/libpmcstat/pmu-events/Makefile >> ============================================================================== >> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2018 (r334225) >> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2018 (r334226) >> @@ -1,9 +1,10 @@ >> # $FreeBSD$ >> >> -PROG=jevents >> -SRCS=jevents.c jsmn.c json.c >> +PROG= jevents >> +SRCS= jevents.c jsmn.c json.c >> CFLAGS+= -Wno-cast-qual >> -.PATH: ${.CURDIR} >> -build-tools: jevents >> MAN= >> + >> +build-tools: jevents >> + >> .include >> > > Hi Bryan, > > Something about this appears to be subtly wrong, but I can't quite pin > down what. I'm getting a failure in the lib32 build of libpmc: > > sh: ./pmu-events/jevents: not found > > My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents > exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents. > ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and > libpmc_events.c.meta. I'm guessing this is the problem- that > obj-lib32/... doesn't have the built jevents, but it's not obvious to > me why this is the case. Some additional context: SRCCONF is defined to a file that looks like this: WITH_BSD_GREP="YES" WITHOUT_BSD_GREP_FASTMATCH="YES" WITH_LOADER_LUA="YES" WITHOUT_FORTH="YES" _SRC_ENV_CONF and __MAKE_CONF are set to /dev/null; all three set in arguments to make(1). OBJDIR has been completely wiped before-hand. From owner-svn-src-head@freebsd.org Tue Jun 5 05:19:05 2018 Return-Path: Delivered-To: svn-src-head@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 CB664FD0223; Tue, 5 Jun 2018 05:19:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80E1980032; Tue, 5 Jun 2018 05:19:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61EF318005; Tue, 5 Jun 2018 05:19:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w555J5Vk026011; Tue, 5 Jun 2018 05:19:05 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w555J5G0026010; Tue, 5 Jun 2018 05:19:05 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201806050519.w555J5G0026010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 5 Jun 2018 05:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334648 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 334648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 05:19:06 -0000 Author: kevlo Date: Tue Jun 5 05:19:04 2018 New Revision: 334648 URL: https://svnweb.freebsd.org/changeset/base/334648 Log: Add support for SIMCom SIM7600E. Sponsored by: MSI/FUNTORO Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Jun 5 04:26:40 2018 (r334647) +++ head/sys/dev/usb/serial/u3g.c Tue Jun 5 05:19:04 2018 (r334648) @@ -208,6 +208,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(ALINK, 3G, 0), U3G_DEV(ALINK, 3GU, 0), U3G_DEV(ALINK, DWM652U5, 0), + U3G_DEV(ALINK, SIM7600E, 0), U3G_DEV(AMOI, H01, 0), U3G_DEV(AMOI, H01A, 0), U3G_DEV(AMOI, H02, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jun 5 04:26:40 2018 (r334647) +++ head/sys/dev/usb/usbdevs Tue Jun 5 05:19:04 2018 (r334648) @@ -1022,6 +1022,7 @@ product ALCOR AU6390 0x6390 AU6390 USB-IDE converter /* Alink products */ product ALINK DWM652U5 0xce16 DWM-652 product ALINK 3G 0x9000 3G modem +product ALINK SIM7600E 0x9001 LTE modem product ALINK 3GU 0x9200 3G modem /* Altec Lansing products */ From owner-svn-src-head@freebsd.org Tue Jun 5 05:24:44 2018 Return-Path: Delivered-To: svn-src-head@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 14AFDFD12A9; Tue, 5 Jun 2018 05:24:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC24E80751; Tue, 5 Jun 2018 05:24:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB38181BB; Tue, 5 Jun 2018 05:24:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w555Oh9K031116; Tue, 5 Jun 2018 05:24:43 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w555OhHM031114; Tue, 5 Jun 2018 05:24:43 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201806050524.w555OhHM031114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 5 Jun 2018 05:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334649 - in head/sys: arm/conf arm64/conf X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: in head/sys: arm/conf arm64/conf X-SVN-Commit-Revision: 334649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 05:24:44 -0000 Author: kevlo Date: Tue Jun 5 05:24:42 2018 New Revision: 334649 URL: https://svnweb.freebsd.org/changeset/base/334649 Log: Since we don't enable BUF_TRACKING and FULL_BUF_TRACKING buffer debugging options in GENERIC kernels on arm and arm64, there's no need to disable them. Sponsored by: MSI/FUNTORO Modified: head/sys/arm/conf/GENERIC-NODEBUG head/sys/arm64/conf/GENERIC-NODEBUG Modified: head/sys/arm/conf/GENERIC-NODEBUG ============================================================================== --- head/sys/arm/conf/GENERIC-NODEBUG Tue Jun 5 05:19:04 2018 (r334648) +++ head/sys/arm/conf/GENERIC-NODEBUG Tue Jun 5 05:24:42 2018 (r334649) @@ -34,7 +34,5 @@ nooptions INVARIANTS nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN -nooptions BUF_TRACKING nooptions DEADLKRES -nooptions FULL_BUF_TRACKING Modified: head/sys/arm64/conf/GENERIC-NODEBUG ============================================================================== --- head/sys/arm64/conf/GENERIC-NODEBUG Tue Jun 5 05:19:04 2018 (r334648) +++ head/sys/arm64/conf/GENERIC-NODEBUG Tue Jun 5 05:24:42 2018 (r334649) @@ -34,7 +34,5 @@ nooptions INVARIANTS nooptions INVARIANT_SUPPORT nooptions WITNESS nooptions WITNESS_SKIPSPIN -nooptions BUF_TRACKING nooptions DEADLKRES -nooptions FULL_BUF_TRACKING nooptions USB_DEBUG From owner-svn-src-head@freebsd.org Tue Jun 5 05:32:11 2018 Return-Path: Delivered-To: svn-src-head@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 8569EFD3A96; Tue, 5 Jun 2018 05:32:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA3B8101F; Tue, 5 Jun 2018 05:32:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id BC5B31048A4; Tue, 5 Jun 2018 15:32:01 +1000 (AEST) Date: Tue, 5 Jun 2018 15:32:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334604 - head/usr.bin/top In-Reply-To: <1528128032.32688.218.camel@freebsd.org> Message-ID: <20180605141442.Y1370@besplex.bde.org> References: <201806040527.w545R1UA075420@repo.freebsd.org> <1528128032.32688.218.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=LulXne3407rxXn8zq4sA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 05:32:11 -0000 On Mon, 4 Jun 2018, Ian Lepore wrote: > On Mon, 2018-06-04 at 05:27 +0000, Eitan Adler wrote: >> ... >> Log: >> \xa0 top(1): some nitpicks >> \xa0\xa0 >> \xa0 - prefer fully spelled names to "u_long" > > Why? I though we preferred the u_char, u_int, u_long spellings in BSD > code? (I certainly prefer them, and I thought style(9) did too, but I > seem to be remembering that wrong). u_foo is only prefered in system-y code (like top and the kernel). However, top used to be portable and using u_foo in it just breaks portability. However2, u_foo was only used in the MD parts of top, and was only used twice, and 1 of these uses is wrong (*). Top doesn't suffer much from unsigned poisoning, so it has little need for u_foo. It mostly uses int, and that is mostly correct. In the old MD code (just machine.c), it used 'unsigned xxx' just 3 times, and all 3 were wrong: - unsigned int swap_delay. swap_delay is boolean, but should have been int and not churned to bool. It has not been churned. - casts of len and nlen to unsigned long to print them in getsysctl(). Although the values in these variables are or should be small, the variables need to have type size_t to use them conveniently with APIs like sysctl(3). Then to print them, we bogusly cast them to unsigned long. Old versions used the wrong format %d so were broken on non-32-bit arches, and instead of fixing this properly using %zu, the warning was broken by changing the format to %lu and casting to unsigned long. unsigned long of course works unless the values are preposterous, and unsigned long is large enough for even preposterous values on all supported arches, but verifying this is more work than using %zu. Casting to int to match the old format would also work for non-preposterous values. The bogus fix was committed in 2001. I think libc supported %zu then theough this was not long after C99 standardized %zu. top/machine.c is FreeBSD-only, so it should have used the unportable %zu. (*) The use of u_long for swap_maxpages is correct. This variable is read from a kernel variable with type u_long using SYSCTL_ULONG(). The use of u_long for cpumask is now very wrong. Originally, the correct type was cpumask_t. This was u_int even on amd64. u_long was originally only slightly wrong since it is larger than u_int and cpumask is populated without asking the kernel what the CPUs are. (This method was OK. It checks for activity on all CPU numbers between 0 and ncpus - 1.) FreeBSD had fancy cpusets implemented as of arrays of (signed) long when this was new, but the kernel also used simple masks of type cpumask_t or worse, so it was limited to 32 CPUs too. Now the kernel can handle many more than 32 CPUs, but top can only handle 8 * sizeof(u_long) CPUs. top's display is also limited to 2-digit CPU numbers. style(9) says nothing about this. Its only literal match for either u_ or unsigned is in a rule saying that the C99 spelling [for fixed-width types] of uintXX_t should be used instead of the BSD spelling u_intXX_t. It hasn't suffered from unsigned poisoning and uses plain int in most examples. It doesn't even have much typedef poisoning or any examples or many rules for foo_t. Its only matches for _t are for u*_t as above, and in a rule that allows churning bool_t to bool, and in a rule that says to not use [private] typedefs ending in _t [because POSIX reserves names ending in _t]. Bruce From owner-svn-src-head@freebsd.org Tue Jun 5 07:50:14 2018 Return-Path: Delivered-To: svn-src-head@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 7AB49FEC783; Tue, 5 Jun 2018 07:50:14 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 1706886BB4; Tue, 5 Jun 2018 07:50:14 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id y31-v6so1423563qty.9; Tue, 05 Jun 2018 00:50:14 -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=An8dnA1GFujAMCRDLjKmGyQA89i18BSj/i5fISsWvmI=; b=QTLlkVF59aE1xKzt5dMLuCm/GIt05dTu5nv81xypQzZn0Oxiaxd4VkXxEaR1wKf0a2 F15s45kOP8sYO9zFuHRpK8M/5BvUixAHRP0pxFjMd9eDzhw6NuyjvaMJX3LzaIHXvy/W D+Py6WBrYWcs8XRR/OPXULl7Nf9/nM4XzUFmW1/9JkG04bfHmjoLr6tv0wZ7gd/bw3j9 RK3UzGtTz1M9HwMDyhbZZlZleqyTecStEUZHXJ+xAGYOwicDR+5GDLqZF/Pu1fOOxHxq E4ZjZkdCALcl1eZnHaQwzIzOR4TZGhGI6o+1qbSQcZ7M2o1PCgYZ01a+BeMFsbrnrTKp mk9A== 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=An8dnA1GFujAMCRDLjKmGyQA89i18BSj/i5fISsWvmI=; b=YCnWIZGFJMWZS7dbMbOVAA/5osz2/1RR+UaMsIWwqBX3fKHnWZ+ThbknbMYXuNA3qf OG2CIi1NZMsycHEBa2i1q95pSSAfSQ11sN66/WxsVjYMKsQeYod3pxTpyWcHT/rW7Ic+ QscOdeXIBYz5lX5fm3bpVrOeREGw6venN6dtrl977eY/Hl2fjms8DP+nEHZd16ctDBGT CtraBhkfgqDX5VPQCVbL8eAylgXEz5KotSk1A1oEqlvaoiBYiN5Xhnd8XaB6gjEG1bxt XWtbHB30WGzwhl55ov/4qNgTpQ2CpLo798g1j+yq1GuRC69l4wJjQj8da6nnXqgYhG3S q8YQ== X-Gm-Message-State: APt69E0lA0KeYcmBuihvYlNfqAqTXIapJMzet0WDW+qY60sl2n711Eao qi0CJ0Ltlreq5nowZ/fgL45MXS9YvYiWMzvBmBJhpQ== X-Google-Smtp-Source: ADUXVKLiNx/GIgcCZhC76gw0oQypaMryX98Gm++twoxDHLCGqJ8ItV9YJqyVQwBBuzFKWUA3xrxfXdlqpliWmiLInmY= X-Received: by 2002:ac8:3808:: with SMTP id q8-v6mr14534381qtb.354.1528185013279; Tue, 05 Jun 2018 00:50:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2e21:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 00:50:12 -0700 (PDT) In-Reply-To: <201806041935.w54JZFsF020741@repo.freebsd.org> References: <201806041935.w54JZFsF020741@repo.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 5 Jun 2018 15:50:12 +0800 Message-ID: Subject: Re: svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ... To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 07:50:15 -0000 On Tue, Jun 5, 2018 at 3:35 AM, Mark Johnston wrote: > Author: markj > Date: Mon Jun 4 19:35:15 2018 > New Revision: 334626 > URL: https://svnweb.freebsd.org/changeset/base/334626 > > Log: > Reimplement brk() and sbrk() to avoid the use of _end. > > Previously, libc.so would initialize its notion of the break address > using _end, a special symbol emitted by the static linker following > the bss section. Compatibility issues between lld and ld.bfd could > cause the wrong definition of _end (libc.so's definition rather than > that of the executable) to be used, breaking the brk()/sbrk() > interface. > > Avoid this problem and future interoperability issues by simply not > relying on _end. Instead, modify the break() system call to return > the kernel's view of the current break address, and have libc > initialize its state using an extra syscall upon the first use of the > interface. As a side effect, this appears to fix brk()/sbrk() usage > in executables run with rtld direct exec, since the kernel and libc.so > no longer maintain separate views of the process' break address. > Maybe it is not really related, or I'm doing something wrong, but when I try to run release.sh script on FreeBSD 11.0-RELEASE-p9 to build pine64 image, it stops with error: ... /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk >>> referenced by brk_test.c:52 (/usr/src/lib/libc/tests/sys/brk_test.c:52) >>> brk_test.o:(atfu_brk_basic_body) /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk >>> referenced by brk_test.c:55 (/usr/src/lib/libc/tests/sys/brk_test.c:55) >>> brk_test.o:(atfu_brk_basic_body) /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk >>> referenced by brk_test.c:59 (/usr/src/lib/libc/tests/sys/brk_test.c:59) >>> brk_test.o:(atfu_brk_basic_body) /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk >>> referenced by brk_test.c:65 (/usr/src/lib/libc/tests/sys/brk_test.c:65) >>> brk_test.o:(atfu_brk_basic_body) /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk >>> referenced by brk_test.c:67 (/usr/src/lib/libc/tests/sys/brk_test.c:67) >>> brk_test.o:(atfu_brk_basic_body) /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk >>> referenced by brk_test.c:82 (/usr/src/lib/libc/tests/sys/brk_test.c:82) >>> brk_test.o:(atfu_sbrk_basic_body) ... Ganbold > > PR: 228574 > Reviewed by: kib (previous version) > MFC after: 2 months > Differential Revision: https://reviews.freebsd.org/D15663 > > Added: > head/lib/libc/sys/brk.c (contents, props changed) > head/lib/libc/tests/sys/brk_test.c (contents, props changed) > Deleted: > head/lib/libc/amd64/sys/brk.S > head/lib/libc/amd64/sys/sbrk.S > head/lib/libc/arm/sys/brk.S > head/lib/libc/arm/sys/sbrk.S > head/lib/libc/i386/sys/brk.S > head/lib/libc/i386/sys/sbrk.S > head/lib/libc/mips/sys/brk.S > head/lib/libc/mips/sys/sbrk.S > head/lib/libc/powerpc/sys/brk.S > head/lib/libc/powerpc/sys/sbrk.S > head/lib/libc/powerpc64/sys/brk.S > head/lib/libc/powerpc64/sys/sbrk.S > head/lib/libc/sparc64/sys/brk.S > head/lib/libc/sparc64/sys/sbrk.S > Modified: > head/lib/libc/amd64/Symbol.map > head/lib/libc/amd64/sys/Makefile.inc > head/lib/libc/arm/Symbol.map > head/lib/libc/arm/sys/Makefile.inc > head/lib/libc/i386/Symbol.map > head/lib/libc/i386/sys/Makefile.inc > head/lib/libc/mips/Symbol.map > head/lib/libc/mips/sys/Makefile.inc > head/lib/libc/powerpc/Symbol.map > head/lib/libc/powerpc/sys/Makefile.inc > head/lib/libc/powerpc64/Symbol.map > head/lib/libc/powerpc64/sys/Makefile.inc > head/lib/libc/riscv/sys/Makefile.inc > head/lib/libc/sparc64/Symbol.map > head/lib/libc/sparc64/sys/Makefile.inc > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/brk.2 > head/lib/libc/tests/sys/Makefile > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/vm/vm_unix.c > > Modified: head/lib/libc/amd64/Symbol.map > ============================================================ > ================== > --- head/lib/libc/amd64/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/amd64/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -63,7 +63,6 @@ FBSDprivate_1.0 { > signalcontext; > __siglongjmp; > _brk; > - _end; > __sys_vfork; > _vfork; > }; > > Modified: head/lib/libc/amd64/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/amd64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/amd64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -8,7 +8,7 @@ SRCS+= \ > amd64_set_fsbase.c \ > amd64_set_gsbase.c > > -MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S > +MDASM= vfork.S cerror.S getcontext.S > > # Don't generate default code for these syscalls: > -NOASM+= vfork.o > +NOASM+= sbrk.o vfork.o > > Modified: head/lib/libc/arm/Symbol.map > ============================================================ > ================== > --- head/lib/libc/arm/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/arm/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -58,7 +58,6 @@ FBSDprivate_1.0 { > __sys_vfork; > _vfork; > _brk; > - _end; > _sbrk; > > _libc_arm_fpu_present; > > Modified: head/lib/libc/arm/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/arm/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/arm/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -2,7 +2,7 @@ > > SRCS+= __vdso_gettc.c > > -MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S > +MDASM= Ovfork.S cerror.S syscall.S > > # Don't generate default code for these syscalls: > -NOASM+= vfork.o > +NOASM+= sbrk.o vfork.o > > Modified: head/lib/libc/i386/Symbol.map > ============================================================ > ================== > --- head/lib/libc/i386/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/i386/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -61,6 +61,5 @@ FBSDprivate_1.0 { > __siglongjmp; > __sys_vfork; > _vfork; > - _end; > _brk; > }; > > Modified: head/lib/libc/i386/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/i386/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/i386/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -7,9 +7,9 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c > SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c > i386_get_ldt.c \ > i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c > i386_set_ldt.c > > -MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S syscall.S > +MDASM= Ovfork.S cerror.S getcontext.S syscall.S > > -NOASM+= vfork.o > +NOASM+= sbrk.o vfork.o > > MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 > MAN+= i386_set_watch.3 > > Modified: head/lib/libc/mips/Symbol.map > ============================================================ > ================== > --- head/lib/libc/mips/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/mips/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -50,7 +50,6 @@ FBSDprivate_1.0 { > __siglongjmp; > __sys_vfork; > _vfork; > - _end; > _brk; > _sbrk; > }; > > Modified: head/lib/libc/mips/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/mips/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/mips/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -2,7 +2,7 @@ > > SRCS+= trivial-vdso_tc.c > > -MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S > +MDASM= Ovfork.S cerror.S syscall.S > > # Don't generate default code for these syscalls: > -NOASM+= vfork.o > +NOASM+= sbrk.o vfork.o > > Modified: head/lib/libc/powerpc/Symbol.map > ============================================================ > ================== > --- head/lib/libc/powerpc/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/powerpc/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -54,5 +54,4 @@ FBSDprivate_1.0 { > signalcontext; > __signalcontext; > __syncicache; > - _end; > }; > > Modified: head/lib/libc/powerpc/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/powerpc/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/powerpc/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -1,3 +1,3 @@ > # $FreeBSD$ > > -MDASM+= brk.S cerror.S sbrk.S > +MDASM+= cerror.S > > Modified: head/lib/libc/powerpc64/Symbol.map > ============================================================ > ================== > --- head/lib/libc/powerpc64/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/powerpc64/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -50,5 +50,4 @@ FBSDprivate_1.0 { > signalcontext; > __signalcontext; > __syncicache; > - _end; > }; > > Modified: head/lib/libc/powerpc64/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/powerpc64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/powerpc64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -1,3 +1,3 @@ > # $FreeBSD$ > > -MDASM+= brk.S cerror.S sbrk.S > +MDASM+= cerror.S > > Modified: head/lib/libc/riscv/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/riscv/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/riscv/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -7,4 +7,4 @@ MDASM= cerror.S \ > vfork.S > > # Don't generate default code for these syscalls: > -NOASM+= vfork.o > +NOASM+= sbrk.o vfork.o > > Modified: head/lib/libc/sparc64/Symbol.map > ============================================================ > ================== > --- head/lib/libc/sparc64/Symbol.map Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/sparc64/Symbol.map Mon Jun 4 19:35:15 2018 > (r334626) > @@ -81,7 +81,6 @@ FBSDprivate_1.0 { > __siglongjmp; > __sys_brk; > _brk; > - _end; > __sys_sbrk; > _sbrk; > __sys_vfork; > > Modified: head/lib/libc/sparc64/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/sparc64/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/sparc64/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ > > CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu > > -MDASM+= brk.S cerror.S sbrk.S sigaction1.S > +MDASM+= cerror.S sigaction1.S > > Modified: head/lib/libc/sys/Makefile.inc > ============================================================ > ================== > --- head/lib/libc/sys/Makefile.inc Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/sys/Makefile.inc Mon Jun 4 19:35:15 2018 > (r334626) > @@ -17,8 +17,7 @@ > # While historically machine dependent, all architectures have the > following > # declarations in common: > # > -NOASM= break.o \ > - exit.o \ > +NOASM= exit.o \ > getlogin.o \ > sstk.o \ > yield.o > @@ -45,6 +44,7 @@ SRCS+= getdirentries.c > NOASM+= getdirentries.o > PSEUDO+= _getdirentries.o > > +SRCS+= brk.c > SRCS+= pipe.c > SRCS+= vadvise.c > > > Modified: head/lib/libc/sys/brk.2 > ============================================================ > ================== > --- head/lib/libc/sys/brk.2 Mon Jun 4 18:51:06 2018 (r334625) > +++ head/lib/libc/sys/brk.2 Mon Jun 4 19:35:15 2018 (r334626) > @@ -28,7 +28,7 @@ > .\" @(#)brk.2 8.4 (Berkeley) 5/1/95 > .\" $FreeBSD$ > .\" > -.Dd May 24, 2018 > +.Dd June 2, 2018 > .Dt BRK 2 > .Os > .Sh NAME > @@ -183,3 +183,8 @@ is sometimes used to monitor heap use by calling with > The result is unlikely to reflect actual utilization in combination with > an > .Xr mmap 2 > based malloc. > +.Pp > +.Fn brk > +and > +.Fn sbrk > +are not thread-safe. > > Added: head/lib/libc/sys/brk.c > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/sys/brk.c Mon Jun 4 19:35:15 2018 (r334626) > @@ -0,0 +1,107 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Mark Johnston > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > +void *__sys_break(char *nsize); > + > +static uintptr_t curbrk, minbrk; > +static int curbrk_initted; > + > +static int > +initbrk(void) > +{ > + void *newbrk; > + > + if (!curbrk_initted) { > + newbrk = __sys_break(NULL); > + if (newbrk == (void *)-1) > + return (-1); > + curbrk = minbrk = (uintptr_t)newbrk; > + curbrk_initted = 1; > + } > + return (0); > +} > + > +static void * > +mvbrk(void *addr) > +{ > + uintptr_t oldbrk; > + > + if ((uintptr_t)addr < minbrk) { > + /* Emulate legacy error handling in the syscall. */ > + errno = EINVAL; > + return ((void *)-1); > + } > + if (__sys_break(addr) == (void *)-1) > + return ((void *)-1); > + oldbrk = curbrk; > + curbrk = (uintptr_t)addr; > + return ((void *)oldbrk); > +} > + > +int > +brk(const void *addr) > +{ > + > + if (initbrk() == -1) > + return (-1); > + if ((uintptr_t)addr < minbrk) > + addr = (void *)minbrk; > + return (mvbrk(__DECONST(void *, addr)) == (void *)-1 ? -1 : 0); > +} > + > +int > +_brk(const void *addr) > +{ > + > + if (initbrk() == -1) > + return (-1); > + return (mvbrk(__DECONST(void *, addr)) == (void *)-1 ? -1 : 0); > +} > + > +void * > +sbrk(intptr_t incr) > +{ > + > + if (initbrk() == -1) > + return ((void *)-1); > + if ((incr > 0 && curbrk + incr < curbrk) || > + (incr < 0 && curbrk + incr > curbrk)) { > + /* Emulate legacy error handling in the syscall. */ > + errno = EINVAL; > + return ((void *)-1); > + } > + return (mvbrk((void *)(curbrk + incr))); > +} > > Modified: head/lib/libc/tests/sys/Makefile > ============================================================ > ================== > --- head/lib/libc/tests/sys/Makefile Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/lib/libc/tests/sys/Makefile Mon Jun 4 19:35:15 2018 > (r334626) > @@ -4,6 +4,7 @@ PACKAGE= tests > > .include > > +ATF_TESTS_C+= brk_test > ATF_TESTS_C+= queue_test > > # TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, > > Added: head/lib/libc/tests/sys/brk_test.c > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/tests/sys/brk_test.c Mon Jun 4 19:35:15 2018 > (r334626) > @@ -0,0 +1,149 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Mark Johnston > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > + > +ATF_TC(brk_basic); > +ATF_TC_HEAD(brk_basic, tc) > +{ > + atf_tc_set_md_var(tc, "descr", "Verify basic brk() functionality"); > +} > +ATF_TC_BODY(brk_basic, tc) > +{ > + void *oldbrk, *newbrk; > + int error; > + > + /* Reset the break. */ > + error = brk(0); > + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); > + > + oldbrk = sbrk(0); > + ATF_REQUIRE(oldbrk != (void *)-1); > + > + /* Try to allocate a page. */ > + error = brk((void *)((intptr_t)oldbrk + PAGE_SIZE * 2)); > + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); > + > + /* > + * Attempt to set the break below minbrk. This should have no > effect. > + */ > + error = brk((void *)((intptr_t)oldbrk - 1)); > + ATF_REQUIRE_MSG(error == 0, "brk: %s", strerror(errno)); > + newbrk = sbrk(0); > + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); > + ATF_REQUIRE(newbrk == oldbrk); > +} > + > +ATF_TC(sbrk_basic); > +ATF_TC_HEAD(sbrk_basic, tc) > +{ > + atf_tc_set_md_var(tc, "descr", "Verify basic sbrk() > functionality"); > +} > +ATF_TC_BODY(sbrk_basic, tc) > +{ > + void *newbrk, *oldbrk; > + int *p; > + > + oldbrk = sbrk(0); > + ATF_REQUIRE_MSG(oldbrk != (void *)-1, "sbrk: %s", strerror(errno)); > + p = sbrk(sizeof(*p)); > + *p = 0; > + ATF_REQUIRE(oldbrk == p); > + > + newbrk = sbrk(-sizeof(*p)); > + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); > + ATF_REQUIRE(oldbrk == sbrk(0)); > + > + oldbrk = sbrk(PAGE_SIZE * 2 + 1); > + ATF_REQUIRE_MSG(oldbrk != (void *)-1, "sbrk: %s", strerror(errno)); > + memset(oldbrk, 0, PAGE_SIZE * 2 + 1); > + newbrk = sbrk(-(PAGE_SIZE * 2 + 1)); > + ATF_REQUIRE_MSG(newbrk != (void *)-1, "sbrk: %s", strerror(errno)); > + ATF_REQUIRE(sbrk(0) == oldbrk); > +} > + > +ATF_TC(mlockfuture); > +ATF_TC_HEAD(mlockfuture, tc) > +{ > + atf_tc_set_md_var(tc, "descr", > + "Verify that mlockall(MCL_FUTURE) applies to the data > segment"); > +} > +ATF_TC_BODY(mlockfuture, tc) > +{ > + void *oldbrk, *n, *newbrk; > + int error; > + char v; > + > + error = mlockall(MCL_FUTURE); > + ATF_REQUIRE_MSG(error == 0, > + "mlockall: %s", strerror(errno)); > + > + /* > + * Advance the break so that at least one page is added to the data > + * segment. This page should be automatically faulted in to the > address > + * space. > + */ > + oldbrk = sbrk(0); > + ATF_REQUIRE(oldbrk != (void *)-1); > + newbrk = sbrk(PAGE_SIZE * 2); > + ATF_REQUIRE(newbrk != (void *)-1); > + > + n = (void *)(((uintptr_t)oldbrk + PAGE_SIZE) & ~PAGE_SIZE); > + v = 0; > + error = mincore(n, PAGE_SIZE, &v); > + ATF_REQUIRE_MSG(error == 0, > + "mincore: %s", strerror(errno)); > + ATF_REQUIRE_MSG((v & MINCORE_INCORE) != 0, > + "unexpected page flags %#x", v); > + > + error = brk(oldbrk); > + ATF_REQUIRE(error == 0); > + > + error = munlockall(); > + ATF_REQUIRE_MSG(error == 0, > + "munlockall: %s", strerror(errno)); > +} > + > +ATF_TP_ADD_TCS(tp) > +{ > + ATF_TP_ADD_TC(tp, brk_basic); > + ATF_TP_ADD_TC(tp, sbrk_basic); > + ATF_TP_ADD_TC(tp, mlockfuture); > + > + return (atf_no_error()); > +} > > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================ > ================== > --- head/sys/compat/freebsd32/syscalls.master Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/sys/compat/freebsd32/syscalls.master Mon Jun 4 19:35:15 2018 > (r334626) > @@ -87,7 +87,7 @@ > int mode, int dev); } > 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } > 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); > } > -17 AUE_NULL NOPROTO { int obreak(char *nsize); } break \ > +17 AUE_NULL NOPROTO { caddr_t obreak(char *nsize); } break \ > obreak_args int > 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ > struct statfs32 *buf, long bufsize, \ > > Modified: head/sys/kern/syscalls.master > ============================================================ > ================== > --- head/sys/kern/syscalls.master Mon Jun 4 18:51:06 2018 > (r334625) > +++ head/sys/kern/syscalls.master Mon Jun 4 19:35:15 2018 > (r334626) > @@ -118,7 +118,7 @@ > 15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } > 16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ > int uid, int gid); } > -17 AUE_NULL STD { int obreak(_In_ char *nsize); } break \ > +17 AUE_NULL STD { caddr_t obreak(_In_ char *nsize); } > break \ > obreak_args int > 18 AUE_GETFSSTAT COMPAT4 { int getfsstat( \ > _Out_writes_bytes_opt_(bufsize) \ > > Modified: head/sys/vm/vm_unix.c > ============================================================ > ================== > --- head/sys/vm/vm_unix.c Mon Jun 4 18:51:06 2018 (r334625) > +++ head/sys/vm/vm_unix.c Mon Jun 4 19:35:15 2018 (r334626) > @@ -102,13 +102,16 @@ sys_obreak(struct thread *td, struct obreak_args > *uap) > } > } else if (new < base) { > /* > - * This is simply an invalid value. If someone wants to > - * do fancy address space manipulations, mmap and munmap > - * can do most of what the user would want. > + * Simply return the current break address without > + * modifying any state. This is an ad-hoc interface > + * used by libc to determine the initial break address, > + * avoiding a dependency on magic features in the system > + * linker. > */ > - error = EINVAL; > + new = old; > goto done; > } > + > if (new > old) { > if (!old_mlock && map->flags & MAP_WIREFUTURE) { > if (ptoa(pmap_wired_count(map->pmap)) + > @@ -224,6 +227,9 @@ done: > if (do_map_wirefuture) > (void) vm_map_wire(map, old, new, > VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); > + > + if (error == 0) > + td->td_retval[0] = new; > > return (error); > #else /* defined(__aarch64__) || defined(__riscv__) */ > > From owner-svn-src-head@freebsd.org Tue Jun 5 09:52:39 2018 Return-Path: Delivered-To: svn-src-head@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 65DA6FDD5BA; Tue, 5 Jun 2018 09:52:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17A226D01F; Tue, 5 Jun 2018 09:52:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECBFC1AEA5; Tue, 5 Jun 2018 09:52:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w559qcQP066481; Tue, 5 Jun 2018 09:52:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w559qc3l066480; Tue, 5 Jun 2018 09:52:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806050952.w559qc3l066480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 5 Jun 2018 09:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334650 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 334650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 09:52:39 -0000 Author: eadler Date: Tue Jun 5 09:52:38 2018 New Revision: 334650 URL: https://svnweb.freebsd.org/changeset/base/334650 Log: usbdevs: sync from NetBSD This adds several vendors from NetBSD's copy of the same file (r1.749). Prefer longer more "canonical" names where the names differed. Sort while here. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jun 5 05:24:42 2018 (r334649) +++ head/sys/dev/usb/usbdevs Tue Jun 5 09:52:38 2018 (r334650) @@ -60,7 +60,7 @@ vendor UNKNOWN2 0x0105 Unknown vendor vendor EGALAX2 0x0123 eGalax, Inc. vendor CHIPSBANK 0x0204 Chipsbank Microelectronics Co. vendor HUMAX 0x02ad HUMAX -vendor INTENSO 0x2109 INTENSO +vendor QUAN 0x01e1 Quan vendor LTS 0x0386 LTS vendor BWCT 0x03da Bernd Walter Computer Technology vendor AOX 0x03e8 AOX @@ -92,7 +92,7 @@ vendor FUJITSU2 0x0407 Fujitsu Personal Systems vendor QUANTA 0x0408 Quanta vendor NEC 0x0409 NEC vendor KODAK 0x040a Eastman Kodak -vendor WELTREND 0x040b Weltrend +vendor WELTREND 0x040b Weltrend Semiconductor vendor VIA 0x040d VIA vendor MCCI 0x040e MCCI vendor MELCO 0x0411 Melco @@ -145,7 +145,7 @@ vendor LUCENT 0x047e Lucent vendor PLANTRONICS 0x047f Plantronics vendor KYOCERA 0x0482 Kyocera Wireless Corp. vendor STMICRO 0x0483 STMicroelectronics -vendor FOXCONN 0x0489 Foxconn +vendor FOXCONN 0x0489 Foxconn / Hon Hai vendor MEIZU 0x0492 Meizu Electronics vendor YAMAHA 0x0499 YAMAHA vendor COMPAQ 0x049f Compaq @@ -197,7 +197,7 @@ vendor TOKYOELECTRON 0x04ec Tokyo Electron vendor ANNABOOKS 0x04ed Annabooks vendor JVC 0x04f1 JVC vendor CHICONY 0x04f2 Chicony Electronics -vendor ELAN 0x04f3 Elan +vendor ELAN 0x04f3 ELAN Microelectronics vendor NEWNEX 0x04f7 Newnex vendor BROTHER 0x04f9 Brother Industries vendor DALLAS 0x04fa Dallas Semiconductor @@ -254,6 +254,7 @@ vendor HAUPPAUGE 0x0573 Hauppauge Computer Works vendor BAFO 0x0576 BAFO/Quality Computer Accessories vendor YEDATA 0x057b Y-E Data vendor AVM 0x057c AVM +vendor NINTENDO 0x057e Nintendo vendor QUICKSHOT 0x057f Quickshot vendor ROLAND 0x0582 Roland vendor ROCKFIRE 0x0583 Rockfire @@ -311,6 +312,7 @@ vendor AOC 0x05f6 AOC International vendor CHIC 0x05fe Chic Technology vendor BARCO 0x0600 Barco Display Systems vendor BRIDGE 0x0607 Bridge Information +vendor SMK 0x0609 SMK vendor SOLIDYEAR 0x060b Solid Year vendor BIORAD 0x0614 Bio-Rad Laboratories vendor MACALLY 0x0618 Macally @@ -365,6 +367,7 @@ vendor IMATION 0x0718 Imation vendor TECLAST 0x071b Teclast vendor SONYERICSSON 0x0731 Sony Ericsson vendor EICON 0x0734 Eicon Networks +vendor MADCATZ 0x0738 Mad Catz, Inc. vendor SYNTECH 0x0745 Syntech Information vendor DIGITALSTREAM 0x074e Digital Stream vendor AUREAL 0x0755 Aureal Semiconductor @@ -394,6 +397,7 @@ vendor MICROTECH 0x07af Microtech vendor GENERALINSTMNTS 0x07b2 General Instruments (Motorola) vendor OLYMPUS 0x07b4 Olympus vendor ABOCOM 0x07b8 AboCom Systems +vendor KINGSUN 0x07c0 KingSun vendor KEISOKUGIKEN 0x07c1 Keisokugiken vendor ONSPEC 0x07c4 OnSpec vendor APG 0x07c5 APG Cash Drawer @@ -407,11 +411,13 @@ vendor APTIO 0x07d2 Aptio Products vendor ARASAN 0x07da Arasan Chip Systems vendor ALLIEDCABLE 0x07e6 Allied Cable vendor STSN 0x07ef STSN +vendor BEWAN 0x07fa Bewan vendor CENTURY 0x07f7 Century Corp vendor NEWLINK 0x07ff NEWlink vendor MAGTEK 0x0801 Mag-Tek vendor ZOOM 0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems +vendor SYNET 0x0812 Synet Electronics vendor ALPHASMART 0x081e AlphaSmart, Inc. vendor BROADLOGIC 0x0827 BroadLogic vendor HANDSPRING 0x082d Handspring @@ -469,8 +475,10 @@ vendor ACERW 0x0967 Acer vendor ADIRONDACK 0x0976 Adirondack Wire & Cable vendor BECKHOFF 0x0978 Beckhoff vendor MINDSATWORK 0x097a Minds At Work +vendor ZIPPY 0x099a Zippy Technology Corporation vendor POINTCHIPS 0x09a6 PointChips vendor INTERSIL 0x09aa Intersil +vendor TRIPPLITE2 0x09ae Tripp Lite vendor ALTIUS 0x09b3 Altius Solutions vendor ARRIS 0x09c1 Arris Interactive vendor ACTIVCARD 0x09c3 ACTIVCARD @@ -573,6 +581,7 @@ vendor DYNASTREAM 0x0fcf Dynastream Innovations vendor LARSENBRUSGAARD 0x0fd8 Larsen and Brusgaard vendor OWL 0x0fde OWL vendor KONTRON 0x0fe6 Kontron AG +vendor DVICO 0x0fe9 DViCO vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer vendor MOTOROLA4 0x100d Motorola @@ -614,6 +623,7 @@ vendor SIEMENS3 0x11f5 Siemens vendor NETINDEX 0x11f6 NetIndex vendor ALCATEL 0x11f7 Alcatel vendor INTERBIOMETRICS 0x1209 Interbiometrics +vendor FUJITSU3 0x1221 Fujitsu Ltd. vendor UNKNOWN3 0x1233 Unknown vendor vendor TSUNAMI 0x1241 Tsunami vendor PHEENET 0x124a Pheenet @@ -631,6 +641,7 @@ vendor AINCOMM 0x12fd Aincomm vendor MOBILITY 0x1342 Mobility vendor DICKSMITH 0x1371 Dick Smith Electronics vendor NETGEAR3 0x1385 Netgear +vendor VALIDITY 0x138a Validity Sensors, Inc. vendor BALTECH 0x13ad Baltech vendor CISCOLINKSYS 0x13b1 Cisco-Linksys vendor SHARK 0x13d2 Shark @@ -638,6 +649,7 @@ vendor AZUREWAVE 0x13d3 AsureWave vendor INITIO 0x13fd Initio Corporation vendor EMTEC 0x13fe Emtec vendor NOVATEL 0x1410 Novatel Wireless +vendor OMNIVISION2 0x1415 OmniVision Technologies, Inc. vendor MERLIN 0x1416 Merlin vendor REDOCTANE 0x1430 RedOctane vendor WISTRONNEWEB 0x1435 Wistron NeWeb @@ -692,17 +704,23 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor MISC 0x1781 Misc Vendors vendor DISPLAYLINK 0x17e9 DisplayLink vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala +vendor E3C 0x18b4 E3C Technologies vendor AMIT 0x18c5 AMIT vendor GOOGLE 0x18d1 Google vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys +vendor MEINBERG 0x1938 Meinberg Funkuhren +vendor BECEEM 0x198f Beceem Communications vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor QUALCOMM3 0x19f5 Qualcomm, Inc. +vendor QUANTA2 0x1a32 Quanta +vendor TERMINUS 0x1a40 Terminus Technology vendor ABBOTT 0x1a61 Abbott Diabetics vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics @@ -741,11 +759,15 @@ vendor QIHARDWARE 0x20b7 QI-hardware vendor PARA 0x20b8 PARA Industrial vendor SIMTEC 0x20df Simtec Electronics vendor TRENDNET 0x20f4 TRENDnet -vendor RTSYSTEMS 0x2100 RTSYSTEMS +vendor RTSYSTEMS 0x2100 RT Systems +vendor DLINK4 0x2101 D-Link +vendor INTENSO 0x2109 INTENSO vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor WETELECOM 0x22de WeTelecom +vendor PINNACLE 0x2304 Pinnacle Systems +vendor ARDUINO 0x2341 Arduino SA vendor TPLINK 0x2357 TP-Link vendor WESTMOUNTAIN 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite @@ -775,7 +797,9 @@ vendor SWEEX 0x5173 Sweex vendor PROLIFIC2 0x5372 Prolific Technologies vendor ONSPEC2 0x55aa OnSpec Electronic Inc. vendor ZINWELL 0x5a57 Zinwell +vendor INGENIC 0x601a Ingenic Semiconductor Ltd. vendor SITECOM 0x6189 Sitecom +vendor SPRINGERDESIGN 0x6400 Springer Design, Inc. vendor ARKMICRO 0x6547 Arkmicro Technologies Inc. vendor 3COM2 0x6891 3Com vendor EDIMAX 0x7392 Edimax @@ -788,8 +812,10 @@ vendor NETGEAR4 0x9846 Netgear vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com vendor CACE 0xcace CACE Technologies -vendor EVOLUTION 0xdeee Evolution Robotics products +vendor COMPARE 0xcdab Compare vendor DATAAPEX 0xdaae DataApex +vendor EVOLUTION 0xdeee Evolution Robotics +vendor EMPIA 0xeb1a eMPIA Technology vendor HP2 0xf003 Hewlett Packard vendor LOGILINK 0xfc08 LogiLink vendor USRP 0xfffe GNU Radio USRP @@ -799,7 +825,7 @@ vendor USRP 0xfffe GNU Radio USRP */ /* 3Com products */ -product 3COM HOMECONN 0x009d HomeConnect Camera +product 3COM HOMECONN 0x009d HomeConnect USB Camera product 3COM 3CREB96 0x00a0 Bluetooth USB Adapter product 3COM 3C19250 0x03e8 3C19250 Ethernet Adapter product 3COM 3CRSHEW696 0x0a01 3CRSHEW696 Wireless Adapter @@ -823,6 +849,10 @@ product ABBOTT STRIP_PORT 0x3420 Abbott Diabetics Stri /* ABIT products */ product ABIT AK_020 0x7d0e 3G modem +product ACDC HUB 0x2315 USB Pen Drive HUB +product ACDC SECWRITE 0x2316 USB Pen Drive Secure Write +product ACDC PEN 0x2317 USB Pen Drive with Secure Write + /* AboCom products */ product ABOCOM XX1 0x110c XX1 product ABOCOM XX2 0x200c XX2 @@ -930,6 +960,9 @@ product ACTIVEWIRE IOBOARD_FW1 0x0101 I/O Board, rev. /* Adaptec products */ product ADAPTEC AWN8020 0x0020 AWN-8020 WLAN +/* Addonics products */ +product ADDONICS2 205 0xa001 Cable 205 + /* Addtron products */ product ADDTRON AWU120 0xff31 AWU-120 @@ -2238,6 +2271,7 @@ product GLOBALSUN AR5523_2 0x7811 AR5523 product GLOBALSUN AR5523_2_NF 0x7812 AR5523 (no firmware) /* Globespan products */ +product GLOBESPAN MODEM_1 0x1329 USB Modem product GLOBESPAN PRISM_GT_1 0x2000 PrismGT USB 2.0 WLAN product GLOBESPAN PRISM_GT_2 0x2002 PrismGT USB 2.0 WLAN @@ -4755,7 +4789,18 @@ product XYRATEX PRISM_GT_2 0x2002 PrismGT USB 2.0 WLAN /* Yamaha products */ product YAMAHA UX256 0x1000 UX256 MIDI I/F +product YAMAHA MU1000 0x1001 MU1000 MIDI Synth. +product YAMAHA MU2000 0x1002 MU2000 MIDI Synth. +product YAMAHA MU500 0x1003 MU500 MIDI Synth. +product YAMAHA UW500 0x1004 UW500 USB Audio I/F +product YAMAHA MOTIF6 0x1005 MOTIF6 MIDI Synth. Workstation +product YAMAHA MOTIF7 0x1006 MOTIF7 MIDI Synth. Workstation +product YAMAHA MOTIF8 0x1007 MOTIF8 MIDI Synth. Workstation product YAMAHA UX96 0x1008 UX96 MIDI I/F +product YAMAHA UX16 0x1009 UX16 MIDI I/F +product YAMAHA S08 0x100e S08 MIDI Keyboard +product YAMAHA CLP150 0x100f CLP-150 digital piano +product YAMAHA CLP170 0x1010 CLP-170 digital piano product YAMAHA RPU200 0x3104 RP-U200 product YAMAHA RTA54I 0x4000 NetVolante RTA54i Broadband&ISDN Router product YAMAHA RTW65B 0x4001 NetVolante RTW65b Broadband Wireless Router @@ -4790,6 +4835,9 @@ product ZCOM UB81 0x0023 UB81 product ZCOM RT2870_2 0x0025 RT2870 product ZCOM UB82 0x0026 UB82 +/* Zeevo, Inc. products */ +product ZEEVO BLUETOOTH 0x07d0 BT-500 Bluetooth USB Adapter + /* Zinwell products */ product ZINWELL RT2570 0x0260 RT2570 product ZINWELL RT2870_1 0x0280 RT2870 @@ -4800,14 +4848,28 @@ product ZINWELL RT3070 0x5257 RT3070 /* Zoom Telephonics, Inc. products */ product ZOOM 2986L 0x9700 2986L Fax modem +product ZOOM 3095 0x3095 3095 USB Fax modem /* Zoran Microelectronics products */ product ZORAN EX20DSC 0x4343 Digital Camera EX-20 DSC +/* ZTE products */ +product ZTE MF622 0x0001 MF622 modem +product ZTE MF628 0x0015 MF628 modem +product ZTE MF626 0x0031 MF626 modem +product ZTE MF820D_INSTALLER 0x0166 MF820D CD +product ZTE MF820D 0x0167 MF820D modem +product ZTE INSTALLER 0x2000 UMTS CD +product ZTE MC2718 0xffe8 MC2718 modem +product ZTE AC8700 0xfffe CDMA 1xEVDO USB modem + /* Zydas Technology Corporation products */ +product ZYDAS ZD1201 0x1201 ZD1201 product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg product ZYDAS ZD1211B 0x1215 ZD1211B product ZYDAS ZD1221 0x1221 ZD1221 +product ZYDAS ALL0298 0xa211 ALL0298 +product ZYDAS ZD1211B_2 0xb215 ZD1211B /* ZyXEL Communication Co. products */ product ZYXEL OMNI56K 0x1500 Omni 56K Plus @@ -4816,8 +4878,10 @@ product ZYXEL ZYAIRG220 0x3401 ZyAIR G-220 product ZYXEL G200V2 0x3407 G-200 v2 product ZYXEL AG225H 0x3409 AG-225H product ZYXEL M202 0x340a M-202 +product ZYXEL G270S 0x340c G-270S product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 +product ZYXEL RT2573 0x3415 RT2573 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL NWD271N 0x3417 NWD-271N product ZYXEL NWD211AN 0x3418 NWD-211AN @@ -4825,4 +4889,5 @@ product ZYXEL RT2870_2 0x341a RT2870 product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU product ZYXEL NWD2705 0x3421 NWD2705 -product ZYXEL NWD6605 0x3426 NWD6605 +product ZYXEL NWD6605 0x3426 ND6605 +product ZYXEL PRESTIGE 0x401a Prestige From owner-svn-src-head@freebsd.org Tue Jun 5 10:21:56 2018 Return-Path: Delivered-To: svn-src-head@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 852D3FE24EB; Tue, 5 Jun 2018 10:21:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 E59076E6D8; Tue, 5 Jun 2018 10:21:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w55ALj4V049691; Tue, 5 Jun 2018 13:21:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w55ALj4V049691 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w55ALiuU049690; Tue, 5 Jun 2018 13:21:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jun 2018 13:21:44 +0300 From: Konstantin Belousov To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat Message-ID: <20180605102144.GF2450@kib.kiev.ua> References: <201806040110.w541ANZr044727@repo.freebsd.org> <20180604120815.GB2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 10:21:56 -0000 On Mon, Jun 04, 2018 at 10:27:21AM -0700, Matthew Macy wrote: > On Mon, Jun 4, 2018 at 5:08 AM, Konstantin Belousov wrote: > > On Mon, Jun 04, 2018 at 01:10:23AM +0000, Matt Macy wrote: > >> @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void > >> > >> pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR, > >> (struct trapframe *) arg); > >> + > >> + KASSERT(td->td_pinned == 1, > >> + ("[pmc,%d] invalid td_pinned value", __LINE__)); > >> + sched_unpin(); /* Can migrate safely now. */ > > sched_pin() is called from pmc_post_callchain_callback(), which is > > called from userret(). userret() is executed with interrupts and > > preemption enabled, so there is a non-trivial chance that the thread > > already migrated. > > > > In fact, I do not see a need to disable migration for the thread if user > > callchain is planned to be gathered. You only need to remember the cpu > > where the interrupt occured, to match it against the request. Or are > > per-cpu PMC registers still accessed during callchain collection ? > > The buffers are pcpu. Although it would in principle be safe in this > case since I > don't modify the read/write indices. However, I'd have to add another field for > the CPU and it doesn't handle the case of multiple migrations. > You already moved the collection to userret(), thanks. So the only reason to sched_pin() in pmc_process_thread_userret() is to make pmc_capture_user_callchain() to operate on the stable cpu ? May be, add a comment there, and move the assert that td_pinned > 0, into pmc_capture_user_callchain() ? > > > >> +int > >> +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, > >> + int inuserspace) > >> +{ > >> + struct thread *td; > >> + > >> + td = curthread; > >> + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && > >> + td && td->td_proc && > >> + (td->td_proc->p_flag & P_KPROC) == 0 && > >> + !inuserspace) { > > I am curious why a lot of the pmc code checks for curthread != NULL and, > > like this fragment, for curproc != NULL. I am sure that at least on x86, > > we never let curthread point to the garbage, even during the context > > switches. NMI handler has the same cargo-cult check, BTW. > > I didn't think they could be NULL, but have been cargo culting the > existing code. You already cleaned this, thanks. > > > Also, please fix the indentation of the conditions block. > > > > > >> + atomic_add_int(&curthread->td_pmcpend, 1); > > You can use atomic_store_int() there, I believe, Then there would be > > no locked op executed at all, on x86. > > Storing a 1 would enable me to early terminate the loop. > > > > >> @@ -375,6 +375,7 @@ struct thread { > >> void *td_lkpi_task; /* LinuxKPI task struct pointer */ > >> TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ > >> epoch_section_t td_epoch_section; /* (t) epoch section object */ > >> + int td_pmcpend; > > Why this member was not put into the zeroed region ? Wouldn't a garbage > > there cause uneccessary ASTs ? > > It would cause _1_ unnecessary check for callchains after initial > creation. Putting it in the zero area would break the ABI. We do not care about KBI stability on HEAD. If you care about it more than usual, you can bump __FreeBSD_version to prevent older modules from load, when struct thread layout changed. Practically we change KBI as needed without special measures. From owner-svn-src-head@freebsd.org Tue Jun 5 11:03:25 2018 Return-Path: Delivered-To: svn-src-head@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 3D999FE8172; Tue, 5 Jun 2018 11:03:25 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4F637041A; Tue, 5 Jun 2018 11:03:24 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C22E01BA1C; Tue, 5 Jun 2018 11:03:24 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55B3Oe8001550; Tue, 5 Jun 2018 11:03:24 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55B3OnS001549; Tue, 5 Jun 2018 11:03:24 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806051103.w55B3OnS001549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 5 Jun 2018 11:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334651 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 334651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 11:03:25 -0000 Author: kibab Date: Tue Jun 5 11:03:24 2018 New Revision: 334651 URL: https://svnweb.freebsd.org/changeset/base/334651 Log: Enable high-speed on the card before increasing frequency on the controller Increasing operating frequency without telling card to switch to high-speed mode first upsets some cards and generates CRC errors. While here, deselect / reselect cards after CMD6 and SCR fetch, as in original code. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15568 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Jun 5 09:52:38 2018 (r334650) +++ head/sys/cam/mmc/mmc_da.c Tue Jun 5 11:03:24 2018 (r334651) @@ -171,7 +171,7 @@ static void sdda_start_init_task(void *context, int pe static void sdda_process_mmc_partitions(struct cam_periph *periph, union ccb *start_ccb); static uint32_t sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb); static void sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int part); - +static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca); static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return MMC_SECTOR_SIZE;} /* TODO: actually issue GET_TRAN_SETTINGS to get R/O status */ @@ -901,6 +901,38 @@ mmc_switch_fill_mmcio(union ccb *ccb, } static int +mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca) +{ + int flags; + + flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC; + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ CAM_DIR_IN, + /*mmc_opcode*/ MMC_SELECT_CARD, + /*mmc_arg*/ rca << 16, + /*mmc_flags*/ flags, + /*mmc_data*/ NULL, + /*timeout*/ 0); + + cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + + if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { + if (ccb->mmcio.cmd.error != 0) { + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, + ("%s: MMC_SELECT command failed", __func__)); + return EIO; + } + return 0; /* Normal return */ + } else { + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, + ("%s: CAM request failed\n", __func__)); + return EIO; + } +} + +static int mmc_switch(struct cam_periph *periph, union ccb *ccb, uint8_t set, uint8_t index, uint8_t value, u_int timeout) { @@ -953,18 +985,24 @@ mmc_sd_switch(struct cam_periph *periph, union ccb *cc uint8_t *res) { struct mmc_data mmc_d; + uint32_t arg; memset(res, 0, 64); mmc_d.len = 64; mmc_d.data = res; mmc_d.flags = MMC_DATA_READ; + arg = mode << 31; /* 0 - check, 1 - set */ + arg |= 0x00FFFFFF; + arg &= ~(0xF << (grp * 4)); + arg |= value << (grp * 4); + cam_fill_mmcio(&ccb->mmcio, /*retries*/ 0, /*cbfcnp*/ NULL, /*flags*/ CAM_DIR_IN, /*mmc_opcode*/ SD_SWITCH_FUNC, - /*mmc_arg*/ mode << 31, + /*mmc_arg*/ arg, /*mmc_flags*/ MMC_RSP_R1 | MMC_CMD_ADTC, /*mmc_data*/ &mmc_d, /*timeout*/ 0); @@ -1273,6 +1311,19 @@ sdda_start_init(void *context, union ccb *start_ccb) CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Card supports HS\n")); softc->card_f_max = SD_HS_MAX; } + + /* + * We deselect then reselect the card here. Some cards + * become unselected and timeout with the above two + * commands, although the state tables / diagrams in the + * standard suggest they go back to the transfer state. + * Other cards don't become deselected, and if we + * attempt to blindly re-select them, we get timeout + * errors from some controllers. So we deselect then + * reselect to handle all situations. + */ + mmc_select_card(periph, start_ccb, 0); + mmc_select_card(periph, start_ccb, get_rca(periph)); } else { CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Not trying the switch\n")); goto finish_hs_tests; @@ -1293,6 +1344,15 @@ finish_hs_tests: f_max = min(host_f_max, softc->card_f_max); CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Set SD freq to %d MHz (min out of host f=%d MHz and card f=%d MHz)\n", f_max / 1000000, host_f_max / 1000000, softc->card_f_max / 1000000)); + /* Enable high-speed timing on the card */ + if (f_max > 25000000) { + err = mmc_set_timing(periph, start_ccb, bus_timing_hs); + if (err != MMC_ERR_NONE) { + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("Cannot switch card to high-speed mode")); + f_max = 25000000; + } + } + /* Set frequency on the controller */ start_ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; start_ccb->ccb_h.flags = CAM_DIR_NONE; start_ccb->ccb_h.retry_count = 0; @@ -1326,12 +1386,6 @@ finish_hs_tests: bus_width_str(max_host_bus_width), bus_width_str(max_card_bus_width))); sdda_set_bus_width(periph, start_ccb, desired_bus_width); - - if (f_max > 25000000) { - err = mmc_set_timing(periph, start_ccb, bus_timing_hs); - if (err != MMC_ERR_NONE) - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("Cannot switch card to high-speed mode")); - } softc->state = SDDA_STATE_NORMAL; From owner-svn-src-head@freebsd.org Tue Jun 5 12:06:35 2018 Return-Path: Delivered-To: svn-src-head@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 42652FF1824; Tue, 5 Jun 2018 12:06:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD7373661; Tue, 5 Jun 2018 12:06:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QAjJfeIb8uYopQAjKfPI0G; Tue, 05 Jun 2018 06:06:27 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=J7jIlIlCvbTruzeGJHcA:9 a=1DzDg_EYHYBtquMQ:21 a=TwhC9JfmmZpoJfKh:21 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D5F15FAB; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w55C6O02035542; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w55C6O4K035526; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806051206.w55C6O4K035526@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ganbold Tsagaankhuu cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ... In-Reply-To: Message from Ganbold Tsagaankhuu of "Tue, 05 Jun 2018 15:50:12 +0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 05:06:24 -0700 X-CMAE-Envelope: MS4wfMJOoQXU1dmPvLtZIvo94DsCFBtebXTsIS+Nsk9AWTvOjJteV6g8eF/gAamRVmHRX/c1zhJEdfAZDQZHlkKD6FST94KqeDJ4DGKryxrRMwshE/oLaShy wrtYPKawqxfU7T3NhqtfmCmIgd5f49VQM1NUop6yQ4RZBuJZ7yeE+VcUI5lA5CK4bHCjOlQfXd/yJM9mlpA+sGw8RopoeoBFE2TbrKDIwB0WDrMiv65kCZIl +TFkB8xrLkvUMt/yjTscErLIn20XsPlM5DujggZdxt13tgOFXxdPx2RF0Rf6k51A X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 12:06:35 -0000 In message , Ganbold Tsagaankhuu writes: > On Tue, Jun 5, 2018 at 3:35 AM, Mark Johnston wrote: > > > Author: markj > > Date: Mon Jun 4 19:35:15 2018 > > New Revision: 334626 > > URL: https://svnweb.freebsd.org/changeset/base/334626 > > > > Log: > > Reimplement brk() and sbrk() to avoid the use of _end. > > > > Previously, libc.so would initialize its notion of the break address > > using _end, a special symbol emitted by the static linker following > > the bss section. Compatibility issues between lld and ld.bfd could > > cause the wrong definition of _end (libc.so's definition rather than > > that of the executable) to be used, breaking the brk()/sbrk() > > interface. > > > > Avoid this problem and future interoperability issues by simply not > > relying on _end. Instead, modify the break() system call to return > > the kernel's view of the current break address, and have libc > > initialize its state using an extra syscall upon the first use of the > > interface. As a side effect, this appears to fix brk()/sbrk() usage > > in executables run with rtld direct exec, since the kernel and libc.so > > no longer maintain separate views of the process' break address. > > > > > Maybe it is not really related, or I'm doing something wrong, but when I > try to run release.sh script on FreeBSD 11.0-RELEASE-p9 to build pine64 > image, it stops with error: > ... > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:52 (/usr/src/lib/libc/tests/sys/brk_test.c:52) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:55 (/usr/src/lib/libc/tests/sys/brk_test.c:55) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:59 (/usr/src/lib/libc/tests/sys/brk_test.c:59) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:65 (/usr/src/lib/libc/tests/sys/brk_test.c:65) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:67 (/usr/src/lib/libc/tests/sys/brk_test.c:67) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:82 (/usr/src/lib/libc/tests/sys/brk_test.c:82) > >>> brk_test.o:(atfu_sbrk_basic_body) > ... > > Ganbold Do a clean build or at the very least remove all libc objects and depends, the while directory in /usr/obj, and build again. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jun 5 13:00:43 2018 Return-Path: Delivered-To: svn-src-head@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 AAF41FF8C34; Tue, 5 Jun 2018 13:00:43 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:375::1:5]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42AF976542; Tue, 5 Jun 2018 13:00:43 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Tue, 05 Jun 2018 15:00:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1528203640; bh=C09/U/cPgD2CSCYmv2YJT+4j+VjJt0MnZV3cysWoflg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=n8xRqoGpqJX2jxdRWhqjAnb4aug2xzxvOrqpznfvaRE0LJf3rBNuMMgrYK1hY0OM+ +upb+ZPffi44N6/kHLS3BSqdqA40wJYC9XckNVU4DlaGiOJh+0Ix7OTLM3TCUXIhwU GGhVfp31iUOF1d2Nx8Bc7R7zI4BVX63wo9Np/6Q0utVjBkw7a2gRtU/seGuu1/dm1f 15ybLAKkdHeG5xLutGzVWzlamokp/yZgUg+y6lNRdnRBeJ/dEYLParodbEaC2R7r1w n9YEck8k490Yhzwk9k8Tk7DJZoepQP4CNHGBHvNlMesA3bOY95v5iXVp3/9IJDBhIa fp08qNDuuIQRw== Message-ID: <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> From: Alexander Leidinger To: Brad Davis Cc: rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334617 - in head: . etc References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> In-Reply-To: <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_-6qg7vUDNS76YCNokYnQJw-"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:00:43 -0000 This message is in MIME format and has been PGP signed. --=_-6qg7vUDNS76YCNokYnQJw- Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Brad Davis (from Mon, 04 Jun 2018 12:55:50 -0600)= : > On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote: >> [ Charset UTF-8 unsupported, converting... ] >> > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: >> > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: >> > > > > I believe there are also other external consumers of this. >> > > > >> > > > Such as? >> > > >> > > Iirc some of the make release stuff calls into here, but that >> > > may of changed to use src/Makefile targets. distrib-dirs comes >> > > to mind. >> > >> > Sure, but those can go away or be updated as needed.. >> >> So again, no plan yet? > > Most of them are gone, I am still in progress on some of it. See=20=20 >=20the github branch above. > > My testing is all done by building release VMs and comparing them=20=20 >=20against a VM built from the last merge from HEAD. So I will update=20= =20 >=20the release stuff as I go. It is my responsibility to keep the=20=20 >=20release stuff working as I change these. Have you checked mergemaster? IIRC it uses the distribution target. Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_-6qg7vUDNS76YCNokYnQJw- Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJbFolmAAoJEKrxQhqFIICEP+4QAJUEFxYXTfyTT7VoIbNzPHOV 991cuZEXuHBelnd0bYBi0bNENyJdHwAC/ZI8nzd4AztJdHVpCSV+6P+OmLLZ5hKe 7oki09FcsSxJhR1mfEBSmyWtAAA0+8XqB9DvJwfmfhJofeg9IkKIyUBL+huP1VFf 8Xt7WzcUSeB33V4svtIatIWtrhm8oCUCbAXIYwCr3h1IdMsjSvT2zhEnnhfeCeyo Fcjbbh6DZw3UgKJjw68E+WrDdc0c/Mq6DXsS4793EQVcvjSrcAMDTmYsvYbAkraX X4krCFxPqnYKwyqNw2a0J/1G+EJLFE5LqHcH3v8QnVwNsWeIxaHiUu6qI51Knk91 0NeVujW1503IPkj4gZAt8O14rttvQ7/AKAGO8zTNb7bEHd2RCDK3KAT9jESpLQfa IVYVuhq9bccMsVoSKGu2N/qVjA6QzwkLfKFFm4bxMgsipOFkkSsB7iFRqSeI6R4J syQMexHSpZfs0Phn317Pxb9nqoSJe81SEmOoPWUEcgR4iCLU8Sd07Q9DsBAwQtGl jWy8hH/FAMRzeZ+5ndUj31pjAdkkKijwosBAzwpoTBXnZgufc56BCpHUyqogVJc9 B5fIeI0r2JgrbhDF7Yk8G7MtaBj42I7PuckhMtCuo5kND0cJLjms4Wy7b5AEwS/v Brj3dJI5CL9h7DIJ03ZC =kPQG -----END PGP SIGNATURE----- --=_-6qg7vUDNS76YCNokYnQJw--- From owner-svn-src-head@freebsd.org Tue Jun 5 13:03:34 2018 Return-Path: Delivered-To: svn-src-head@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 86A6BFD045C for ; Tue, 5 Jun 2018 13:03:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-13.consmr.mail.bf2.yahoo.com (sonic315-13.consmr.mail.bf2.yahoo.com [74.6.134.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE427698F for ; Tue, 5 Jun 2018 13:03:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: LtnHWGQVM1nHX6CJowtCRTy6finFHq6faSYOH.Ct7LhMUVbdgSrluP0WHQcXdcG FzCwTUPUgWqu0gwjyplqMP1uAiZXj75NxXOWsXl7mKMKz5SX.46HMlU7aOOb0bXQYQxkQqmwryPm Qb.HhfDtsbYgCmESQ8tMn0hrzi3Zun3BBiloPZud0HY3qmusxIp3Kl5vbnauXHJJp5jIjWH.Svu5 ifx27Kgm2i8qKYr45yCTYK1Ai9LoL5XCVWt8um2xDwaGngsseCe_cZFh1dehnYUXTXz43UW85zPq VHRFwVMWZY62tIpBTzaSFe8EfF0sX2OVn7kB6UYJ0OT1cuepkS7.grKe4xlsw4oD9Et5rLbWew2S yWpXczeuDk.XUnZmjzZW3RxAnW6RB0q29cQQDQpe4lx_IRp9a_Sq7vpOFmx_GbGsXRkopaljMFI1 kQ8.lAxOinGmzoRiIwyZB2pwDLHix7ImmboF_.mYkrJfjSa95wqNZAUn_60frO.FB0padPQta17y T3ejYYlOF3TnXsqhe1nHKsMUK5fSlkOpcD94yWvZFCq6KqTxUbDPQMwC2GrCGDPqzrh62xDoGq5r VPS0PGBzLS_Bj_XzxMuPplQ37DTUueuIwskQ4BO1uCk2QwKfkk9aejlusEIdOv.8rfk.FbPvLM79 nd3ZAuDCp4WDzdX6Znv7d9oWZ_oeh5drPLKftrQDjCZi.VIrTo_B79XKJBMqUnix5QxaTspsQQA5 iJbSvV8JQLMhc7hAAak3xUjUzbXNXlGLnx1FAFXLzZ.zk2uh2vZ3MseXbmu60AxAHPpm9E4WV4yk kJhVKsSohCwtgEj68CFLsQCI.RfW5jYK6b4EplLyHynTJDwqjj5yHxV5WryRrrf3QGGBH8NdR_We RJDjXpBQ87AJ2eHV0hpKqskVvMksHFpQwXx5gvvkHygOJlQ8KPeYs1PfS_RkhMC7QDX6wOAy0Qio - Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Tue, 5 Jun 2018 13:03:28 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp428.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4665a50153fda4a205eb0a1965971aa6; Tue, 05 Jun 2018 13:03:24 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334647 - in head: . . . [this broke ci.freebsd.org's FreeBSD-head-amd64-gcc build but via an include/c++/v1/ problem] Message-Id: <5D1C2920-2206-4602-BD2D-D1298E5D62EE@yahoo.com> Date: Tue, 5 Jun 2018 06:03:22 -0700 Cc: mmacy@FreeBSD.org To: svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:03:34 -0000 https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/5974/consoleText = shows: --- all_subdir_usr.sbin/pmc --- In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216:0,= from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale: = At global scope: = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 237:40: error: redundant redeclaration of 'void = std::__1::__throw_runtime_error(const char*)' in same scope = [-Werror=3Dredundant-decls] _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); ^~~~~~~~~~~~~~~~~~~~~ In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/memory:663= :0, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/algorithm:= 643, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__string:5= 6, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string_vie= w:176, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string:477= , from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 5, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216, from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/stdexcept:= 186:40: note: previous declaration of 'void = std::__1::__throw_runtime_error(const char*)' _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); ^~~~~~~~~~~~~~~~~~~~~ It looks like the new #include of iostream brings in code that gcc = rejected above: --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 23:17:18 2018 = (r334645, copy source) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Tue Jun 5 04:26:40 2018 = (r334647) @@ -68,11 +68,22 @@ __FBSDID("$FreeBSD$"); #include #include "cmd_pmc.h" =20 +#include . . . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jun 5 13:06:07 2018 Return-Path: Delivered-To: svn-src-head@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 478B3FD09A6; Tue, 5 Jun 2018 13:06:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F129B76AAB; Tue, 5 Jun 2018 13:06:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDE5C1CD50; Tue, 5 Jun 2018 13:06:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55D66ol061878; Tue, 5 Jun 2018 13:06:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55D6658061877; Tue, 5 Jun 2018 13:06:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806051306.w55D6658061877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 5 Jun 2018 13:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334653 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 334653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:06:07 -0000 Author: markj Date: Tue Jun 5 13:06:06 2018 New Revision: 334653 URL: https://svnweb.freebsd.org/changeset/base/334653 Log: Don't build brk_test on platforms that don't support brk(). X-MFC with: r334626 Modified: head/lib/libc/tests/sys/Makefile Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Tue Jun 5 12:00:55 2018 (r334652) +++ head/lib/libc/tests/sys/Makefile Tue Jun 5 13:06:06 2018 (r334653) @@ -4,7 +4,9 @@ PACKAGE= tests .include +.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv" ATF_TESTS_C+= brk_test +.endif ATF_TESTS_C+= queue_test # TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, From owner-svn-src-head@freebsd.org Tue Jun 5 13:07:07 2018 Return-Path: Delivered-To: svn-src-head@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 7B9C4FD0C3B; Tue, 5 Jun 2018 13:07:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (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 EE57F76C55; Tue, 5 Jun 2018 13:07:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x241.google.com with SMTP id f1-v6so1484614plt.6; Tue, 05 Jun 2018 06:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jeZ0DxM2P4AKmhWV3bVptXbRwU8js5z9C8iEQ7HpD8Y=; b=gSKPyK5rRo7hTW0xz6M1FViyfetmvz97I2gwFU6t2/94Yg2gCxQ6lf0yAB+BAvCW4Y gxMvDD5tbb4R7Mtay1xKdwgZzdcYF9R8U8/uO62+eMoCQHdVA8+J+fB8jq9qu07xz2J5 Op79P4lHc5MaSp/HcRDvdeDkOdf/UPDmCkN0jVgePsX9hJdozMiakJiRcDe1XzWD4RGR iBPmOcNTZtw/6lHKPMdToC17ZHNzZ/pAyZzyn/ilyoajTpoLrIVF6jWDk2afb1xSzuvK jJ7OcMb3mNjO+NqI9fS9g5il2+ctIfnzfYckfXYPm87KfnvmCBntNDqVMjyZ6/j2fZF9 MFxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=jeZ0DxM2P4AKmhWV3bVptXbRwU8js5z9C8iEQ7HpD8Y=; b=VesN+wU6jo1nSwOMFsxhNH6NxTLK+g0cm+J7pj+HkAUwEmycpHkOATTAQdtqxLrVsH 1D8pz6Z0eBS/O3uj0/OpFUdNELXhDCpNui3Lbu8woDTGIF4xj4NpGSwiBqJYzGO8rA85 SrfVSr2008gbhSj4Yq88lA5qpuv+0crjxRxIgDynVawNAhIM6bGtbTaQVGgtmB943L3u F3US6UXwHOV1TIaMC25wT+oxhUGQr8NuoKvAOoF/Pb6uu7R18/YVTVRJssdaTTeErUh6 RqnMLce1L5ZE1cFVdBHtxzsKn0H4tLMgGv/ir3/wf/Ph973M1FcehQ1N6ATRHNWqa0rN I6+A== X-Gm-Message-State: ALKqPwcJP5Zpa0PoTvZ4LJggaOyTc+fZoMelUKINkmRR7SxsUOujJye0 uMbFhh59AKU77EN2KwnAc4E= X-Google-Smtp-Source: ADUXVKLxDqmtN5TGAZQib1r//WOmjwfuxCvDQk8m/tk0s1CIDY8uhYGqCab6uLfZ0VIQHKb9cYg2Uw== X-Received: by 2002:a17:902:b588:: with SMTP id a8-v6mr25828740pls.308.1528204026042; Tue, 05 Jun 2018 06:07:06 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-156.dsl.bell.ca. [70.49.169.156]) by smtp.gmail.com with ESMTPSA id p2-v6sm45637656pgq.14.2018.06.05.06.07.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 06:07:05 -0700 (PDT) Sender: Mark Johnston Date: Tue, 5 Jun 2018 09:07:02 -0400 From: Mark Johnston To: Ganbold Tsagaankhuu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ... Message-ID: <20180605130702.GB87893@raichu> References: <201806041935.w54JZFsF020741@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:07:07 -0000 On Tue, Jun 05, 2018 at 03:50:12PM +0800, Ganbold Tsagaankhuu wrote: > On Tue, Jun 5, 2018 at 3:35 AM, Mark Johnston wrote: > > > Author: markj > > Date: Mon Jun 4 19:35:15 2018 > > New Revision: 334626 > > URL: https://svnweb.freebsd.org/changeset/base/334626 > > > > Log: > > Reimplement brk() and sbrk() to avoid the use of _end. > > > > Previously, libc.so would initialize its notion of the break address > > using _end, a special symbol emitted by the static linker following > > the bss section. Compatibility issues between lld and ld.bfd could > > cause the wrong definition of _end (libc.so's definition rather than > > that of the executable) to be used, breaking the brk()/sbrk() > > interface. > > > > Avoid this problem and future interoperability issues by simply not > > relying on _end. Instead, modify the break() system call to return > > the kernel's view of the current break address, and have libc > > initialize its state using an extra syscall upon the first use of the > > interface. As a side effect, this appears to fix brk()/sbrk() usage > > in executables run with rtld direct exec, since the kernel and libc.so > > no longer maintain separate views of the process' break address. > > > > > Maybe it is not really related, or I'm doing something wrong, but when I > try to run release.sh script on FreeBSD 11.0-RELEASE-p9 to build pine64 > image, it stops with error: r334653 should fix that, sorry. From owner-svn-src-head@freebsd.org Tue Jun 5 13:38:42 2018 Return-Path: Delivered-To: svn-src-head@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 49C7BFDC0A8 for ; Tue, 5 Jun 2018 13:38:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-34.consmr.mail.ne1.yahoo.com (sonic317-34.consmr.mail.ne1.yahoo.com [66.163.184.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8FA78A2E for ; Tue, 5 Jun 2018 13:38:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: N59zs8gVM1nURnJdJpRLaXmGLLuvMbDR_HuduC.8uSq.6bKIX1gUisH_xN6ZSyx QEI5nlPA5a2mIWLCZkEbrsHLpej543Ct4l7q.pb1XLUjzgmKFu0i_Mrpv0Xb7vezrGn9G0OOUmwQ m7d4zT0iIiO0OMUHubictKa95JcTd10Lupp221Noa0xMEe3ZwPOwH_opisX7RCTXiPMFl.pB22uj aPGr5IAv._VwJBeeD1j3CvMaVt5zMgCpEi.UdBYSOhj9tnqjwUBw.18_1Y7pY86a.3wQTU.uHP1g Zep1OJYetY34UlCs7dGQ_Q2O1T7Wz6zKqLQ.dULxZOqQphcYUQ1akhsKtiSs5vcz3LF_ZcuRUeGX eKTFihXM61iFiaHgIKsrfzgbnTAInamBQj6WJeo3UgpAyVrCWcnAj8mUT34MRvZ7Wm418DVuIQdN r8CqwP161jw16_bicyZySvV0RtWj93qoz838fJzy294UpTPWJ19fobaNOuziVmuRZjEpJG_7qL7x RGixWjHwnxJ2YzQYxVihCTmJRsc39Ynntl_355quBw7chZqnMM0H9vWdXQ_7NWWWzMkFuE0bFH30 DhfqA2UlD4Yxpx9PjXUENowahOkaWmW5rwi8cEM8gC0loxf37Xs5Hpry8ZB_W5M33uxsK3DWWa_N Zilhg0OVpVjxxteiSpIytXIxLkvG_X8oDGmgwVTZAtQcMEEEhAcrAGYVeULHCRJ.uPHFK0LOdq1L qUNnRvJCaTptFlP_1qTg4y7nQESnGszn_IJ18S_wAkHJqDqXECGzolcA.Q40CpLyVNTBavH2hwT5 wVK2PSnTaLb6u7Kv204PR_MyykC6PP6gynFxwRLd6yHXNTLDtWkyKiPdE0pGhrwtqTe2.Xj1lOw2 qnr_8g._XwrQBBC8C9jv0Ls.QLeA.B1dAWun4S9_xTcB6Trb7xxH0XziUVR0jJVbFU1o5_eNeoQ- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 5 Jun 2018 13:38:40 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp401.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e0b623ca98c1dff49e711baa47647ff6; Tue, 05 Jun 2018 13:38:38 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334617 - in head: . etc Message-Id: <884D96DA-C1A7-4EC5-B6D8-78CD59BA307E@yahoo.com> Date: Tue, 5 Jun 2018 06:38:36 -0700 To: brd@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:38:42 -0000 Brad Davis brd at FreeBSD.org wrote on Mon Jun 4 18:41:03 UTC 2018 : > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: . . . > > Iirc some of the make release stuff calls into here, but that > > may of changed to use src/Makefile targets. distrib-dirs comes > > to mind. >=20 > Sure, but those can go away or be updated as needed.. Just for reference . . . Using: # uname -apKU FreeBSD FBSDUSSD 12.0-CURRENT FreeBSD 12.0-CURRENT r334014M amd64 = amd64 1200063 1200063 as a context for reference shows that: /usr/src/release/scripts/mm-mtree.sh /usr/src/targets/pseudo/bootstrap-tools/Makefile /usr/src/targets/pseudo/stage/Makefile /usr/src/usr.sbin/etcupdate/etcupdate.sh /usr/src/usr.sbin/mergemaster/mergemaster.sh all reference the text "distrib-dirs" as a command line argument to a make command: # grep -r distrib-dirs /usr/src/* | more /usr/src/Makefile: distributeworld distrib-dirs distribution = doxygen \ /usr/src/Makefile:.ORDER: buildworld distrib-dirs /usr/src/Makefile:.ORDER: distrib-dirs distribute /usr/src/Makefile:.ORDER: distrib-dirs distributeworld /usr/src/Makefile:.ORDER: distrib-dirs installworld /usr/src/Makefile.inc1: LOCAL_MTREE=3D${LOCAL_MTREE:Q} distrib-dirs /usr/src/Makefile.inc1:distrib-dirs distribution: .MAKE .PHONY /usr/src/Makefile.inc1: ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs /usr/src/etc/Makefile:distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY /usr/src/release/scripts/mm-mtree.sh: ${MM_MAKE} DESTDIR=3D${DESTDIR} = distrib-dirs /usr/src/release/scripts/mm-mtree.sh: ${MM_MAKE} DESTDIR=3D${TEMPROOT} = distrib-dirs && /usr/src/targets/pseudo/bootstrap-tools/Makefile: ${DISTRIB_ENV} = ${MAKE} -C ${SRCTOP}/etc distrib-dirs \ /usr/src/targets/pseudo/bootstrap-tools/Makefile: = DESTDIR=3D${BTOOLSDIR} > $@.distrib-dirs_btoolsdir /usr/src/targets/pseudo/bootstrap-tools/Makefile: ${DISTRIB_ENV} = ${MAKE} -C ${SRCTOP}/etc distrib-dirs \ /usr/src/targets/pseudo/bootstrap-tools/Makefile: = DESTDIR=3D${LEGACY_TOOLS} > $@.distrib-dirs_legacy_tools /usr/src/targets/pseudo/stage/Makefile:# distrib-dirs can be done in = STAGE_OBJTOP /usr/src/targets/pseudo/stage/Makefile:stage-distrib-dirs: .META = ${META_DEPS} /usr/src/targets/pseudo/stage/Makefile: distrib-dirs -DNO_FSCHG = -DWITH_TESTS DESTDIR=3D${STAGE_OBJTOP} /usr/src/targets/pseudo/stage/Makefile:all: stage-distrib-dirs /usr/src/usr.sbin/etcupdate/etcupdate.sh: (cd $SRCDIR; = $make DESTDIR=3D$destdir distrib-dirs && /usr/src/usr.sbin/etcupdate/etcupdate.sh: (cd $SRCDIR; = $make DESTDIR=3D$destdir distrib-dirs && /usr/src/usr.sbin/mergemaster/mergemaster.sh: ${MM_MAKE} = DESTDIR=3D${DESTDIR} distrib-dirs >/dev/null /usr/src/usr.sbin/mergemaster/mergemaster.sh: ${MM_MAKE} = DESTDIR=3D${TEMPROOT} distrib-dirs >/dev/null && =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jun 5 14:03:20 2018 Return-Path: Delivered-To: svn-src-head@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 CB9D7FDFCED; Tue, 5 Jun 2018 14:03:20 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 638DC7A73E; Tue, 5 Jun 2018 14:03:19 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.15.2/8.15.2) with ESMTPS id w55E1uhJ094122 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Jun 2018 22:01:57 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.15.2/8.15.2/Submit) id w55E1uE1094121; Tue, 5 Jun 2018 22:01:56 +0800 (CST) (envelope-from kevlo) Date: Tue, 5 Jun 2018 22:01:56 +0800 From: Kevin Lo To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334650 - head/sys/dev/usb Message-ID: <20180605140156.GA93953@ns.kevlo.org> References: <201806050952.w559qc3l066480@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806050952.w559qc3l066480@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 14:03:21 -0000 On Tue, Jun 05, 2018 at 09:52:38AM +0000, Eitan Adler wrote: > Author: eadler > Date: Tue Jun 5 09:52:38 2018 > New Revision: 334650 > URL: https://svnweb.freebsd.org/changeset/base/334650 > > Log: > usbdevs: sync from NetBSD > > This adds several vendors from NetBSD's copy of the same file (r1.749). > Prefer longer more "canonical" names where the names differed. > > Sort while here. > > Modified: > head/sys/dev/usb/usbdevs > > Modified: head/sys/dev/usb/usbdevs > ============================================================================== > --- head/sys/dev/usb/usbdevs Tue Jun 5 05:24:42 2018 (r334649) > +++ head/sys/dev/usb/usbdevs Tue Jun 5 09:52:38 2018 (r334650) > @@ -60,7 +60,7 @@ vendor UNKNOWN2 0x0105 Unknown vendor > vendor EGALAX2 0x0123 eGalax, Inc. > vendor CHIPSBANK 0x0204 Chipsbank Microelectronics Co. > vendor HUMAX 0x02ad HUMAX > -vendor INTENSO 0x2109 INTENSO > +vendor QUAN 0x01e1 Quan Doesn't sort. [snip] > +vendor INTENSO 0x2109 INTENSO > vendor VIALABS 0x2109 VIA Labs INTENSO has the same vendor id as VIALABS? This doesn't look right. From owner-svn-src-head@freebsd.org Tue Jun 5 14:47:14 2018 Return-Path: Delivered-To: svn-src-head@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 56624FE6201; Tue, 5 Jun 2018 14:47:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08DE57C9C6; Tue, 5 Jun 2018 14:47:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD7351DD5E; Tue, 5 Jun 2018 14:47:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55ElDdo013520; Tue, 5 Jun 2018 14:47:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55ElDIt013519; Tue, 5 Jun 2018 14:47:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806051447.w55ElDIt013519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jun 2018 14:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334656 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 334656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 14:47:14 -0000 Author: ian Date: Tue Jun 5 14:47:13 2018 New Revision: 334656 URL: https://svnweb.freebsd.org/changeset/base/334656 Log: Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h. I'm not sure why the v*printf() functions in libsa return void instead of int, but this maintains that convention for the new function. Modified: head/stand/libsa/printf.c head/stand/libsa/stand.h Modified: head/stand/libsa/printf.c ============================================================================== --- head/stand/libsa/printf.c Tue Jun 5 13:53:37 2018 (r334655) +++ head/stand/libsa/printf.c Tue Jun 5 14:47:13 2018 (r334656) @@ -141,6 +141,20 @@ snprintf(char *buf, size_t size, const char *cfmt, ... } void +vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) +{ + struct print_buf arg; + + arg.buf = buf; + arg.size = size; + + kvprintf(cfmt, &snprint_func, &arg, 10, ap); + + if (arg.size >= 1) + *(arg.buf)++ = 0; +} + +void vsprintf(char *buf, const char *cfmt, va_list ap) { int retval; Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Jun 5 13:53:37 2018 (r334655) +++ head/stand/libsa/stand.h Tue Jun 5 14:47:13 2018 (r334656) @@ -268,10 +268,11 @@ extern void *reallocf(void *ptr, size_t size); extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); -extern void vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); +extern void vprintf(const char *fmt, __va_list); extern void vsprintf(char *buf, const char *cfmt, __va_list); +extern void vsnprintf(char *buf, size_t size, const char *cfmt, __va_list); extern void twiddle(u_int callerdiv); extern void twiddle_divisor(u_int globaldiv); From owner-svn-src-head@freebsd.org Tue Jun 5 15:05:27 2018 Return-Path: Delivered-To: svn-src-head@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 07AA6FE9AC6; Tue, 5 Jun 2018 15:05:27 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABD617DBF3; Tue, 5 Jun 2018 15:05:26 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D84A1E07A; Tue, 5 Jun 2018 15:05:26 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55F5QNK023704; Tue, 5 Jun 2018 15:05:26 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55F5QHX023703; Tue, 5 Jun 2018 15:05:26 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201806051505.w55F5QHX023703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Tue, 5 Jun 2018 15:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334657 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 334657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:05:27 -0000 Author: ram Date: Tue Jun 5 15:05:26 2018 New Revision: 334657 URL: https://svnweb.freebsd.org/changeset/base/334657 Log: Issue: Utility hangs when OCS_IOCTL_CMD_MGMT_GET_ALL called in parallel on port 0 and port 1. Fix: Using static structure for results is corrupting the second ioctl request. Removed static for results structure. Approved by: ken MFC after: 3 days Modified: head/sys/dev/ocs_fc/ocs_mgmt.c Modified: head/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_mgmt.c Tue Jun 5 14:47:13 2018 (r334656) +++ head/sys/dev/ocs_fc/ocs_mgmt.c Tue Jun 5 15:05:26 2018 (r334657) @@ -2373,7 +2373,7 @@ static void get_nv_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) { char result_string[24]; - static ocs_mgmt_get_nvparms_result_t result; + ocs_mgmt_get_nvparms_result_t result; ocs_sem_init(&(result.semaphore), 0, "get_nv_wwpn"); @@ -2411,7 +2411,7 @@ static void get_nv_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) { char result_string[24]; - static ocs_mgmt_get_nvparms_result_t result; + ocs_mgmt_get_nvparms_result_t result; ocs_sem_init(&(result.semaphore), 0, "get_nv_wwnn"); From owner-svn-src-head@freebsd.org Tue Jun 5 15:20:21 2018 Return-Path: Delivered-To: svn-src-head@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 964D0FEC9AB; Tue, 5 Jun 2018 15:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47A147E6F2; Tue, 5 Jun 2018 15:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2486C1E20B; Tue, 5 Jun 2018 15:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FKKQY028713; Tue, 5 Jun 2018 15:20:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FKKPh028712; Tue, 5 Jun 2018 15:20:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051520.w55FKKPh028712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334658 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:20:21 -0000 Author: hselasky Date: Tue Jun 5 15:20:20 2018 New Revision: 334658 URL: https://svnweb.freebsd.org/changeset/base/334658 Log: Implement timer_setup() and from_timer() function macros in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h Tue Jun 5 15:05:26 2018 (r334657) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Tue Jun 5 15:20:20 2018 (r334658) @@ -39,7 +39,10 @@ struct timer_list { struct callout callout; - void (*function) (unsigned long); + union { + void (*function) (unsigned long); /* < v4.15 */ + void (*function_415) (struct timer_list *); + }; unsigned long data; int expires; }; @@ -47,6 +50,16 @@ struct timer_list { extern unsigned long linux_timer_hz_mask; #define TIMER_IRQSAFE 0x0001 + +#define from_timer(var, arg, field) \ + container_of(arg, typeof(*(var)), field) + +#define timer_setup(timer, func, flags) do { \ + CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \ + (timer)->function_415 = (func); \ + (timer)->data = (unsigned long)(timer); \ + callout_init(&(timer)->callout, 1); \ +} while (0) #define setup_timer(timer, func, dat) do { \ (timer)->function = (func); \ From owner-svn-src-head@freebsd.org Tue Jun 5 15:24:04 2018 Return-Path: Delivered-To: svn-src-head@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 7C299FED6B3; Tue, 5 Jun 2018 15:24:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 14DF87EC4A; Tue, 5 Jun 2018 15:24:03 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 296ED21C39; Tue, 5 Jun 2018 11:24:03 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Tue, 05 Jun 2018 11:24:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=BnjpM5 KEJFaGUjs2zJldn1XccxZUOLolMx503hZrDig=; b=QcajQ1/ykeUIw04HVBPTox 0twNs5lJEgVhsyiCRkjIuftKvv1HykQa3e30D7xth+88ZSc33Sw04LJWXIF+E2s9 ycrLwV5fn4nm8d3QqcwM+jg6ql8acYIj16zIElMtK5pkxBKuH6SEXuTPkCo9/qzF RF+Uq5DoPYG2YWheGDcRBz0AKZqyjg3Eq/mm8Nr5nASTycjBdGZ32u3nIl0TvGmr 4rLD2wzvsbCGSrLS8L+9b9miU773YwtPGRFFCL9do7M+eo3FyWJDEyyrVY782Zkk Hpj7BnpR0cupF/7tZGdwsKJSJ9MQzGrROowmhvCbWX0imt39tKdT7TBfUCXaD7Qg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 00CDA9E3AC; Tue, 5 Jun 2018 11:24:02 -0400 (EDT) Message-Id: <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> From: Brad Davis To: Alexander Leidinger Cc: rgrimes@freebsd.org, Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> In-Reply-To: <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> Subject: Re: svn commit: r334617 - in head: . etc Date: Tue, 05 Jun 2018 09:24:02 -0600 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:24:04 -0000 On Tue, Jun 5, 2018, at 7:00 AM, Alexander Leidinger wrote: > > Quoting Brad Davis (from Mon, 04 Jun 2018 12:55:50 -0600): > > > On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote: > >> [ Charset UTF-8 unsupported, converting... ] > >> > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > >> > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > >> > > > > I believe there are also other external consumers of this. > >> > > > > >> > > > Such as? > >> > > > >> > > Iirc some of the make release stuff calls into here, but that > >> > > may of changed to use src/Makefile targets. distrib-dirs comes > >> > > to mind. > >> > > >> > Sure, but those can go away or be updated as needed.. > >> > >> So again, no plan yet? > > > > Most of them are gone, I am still in progress on some of it. See > > the github branch above. > > > > My testing is all done by building release VMs and comparing them > > against a VM built from the last merge from HEAD. So I will update > > the release stuff as I go. It is my responsibility to keep the > > release stuff working as I change these. > > Have you checked mergemaster? IIRC it uses the distribution target. Yup, this does not affect the distribution target. Regards, Brad Davis From owner-svn-src-head@freebsd.org Tue Jun 5 15:30:37 2018 Return-Path: Delivered-To: svn-src-head@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 1D895FEEA2B; Tue, 5 Jun 2018 15:30:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF0CE7F020; Tue, 5 Jun 2018 15:30:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A03581E3B0; Tue, 5 Jun 2018 15:30:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FUaeG033850; Tue, 5 Jun 2018 15:30:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FUaur033849; Tue, 5 Jun 2018 15:30:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051530.w55FUaur033849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334659 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:30:37 -0000 Author: hselasky Date: Tue Jun 5 15:30:36 2018 New Revision: 334659 URL: https://svnweb.freebsd.org/changeset/base/334659 Log: Implement mul_u32_u32() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/math64.h Tue Jun 5 15:20:20 2018 (r334658) +++ head/sys/compat/linuxkpi/common/include/linux/math64.h Tue Jun 5 15:30:36 2018 (r334659) @@ -84,4 +84,11 @@ div_u64(uint64_t dividend, uint32_t divisor) return (dividend / divisor); } +static inline uint64_t +mul_u32_u32(uint32_t a, uint32_t b) +{ + + return ((uint64_t)a * b); +} + #endif /* _LINUX_MATH64_H */ From owner-svn-src-head@freebsd.org Tue Jun 5 15:37:30 2018 Return-Path: Delivered-To: svn-src-head@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 ECA24FF0075; Tue, 5 Jun 2018 15:37:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99EBB7F6F4; Tue, 5 Jun 2018 15:37:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AF4C1E538; Tue, 5 Jun 2018 15:37:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FbTSq038973; Tue, 5 Jun 2018 15:37:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FbTTS038972; Tue, 5 Jun 2018 15:37:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051537.w55FbTTS038972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334660 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:37:30 -0000 Author: hselasky Date: Tue Jun 5 15:37:28 2018 New Revision: 334660 URL: https://svnweb.freebsd.org/changeset/base/334660 Log: Add "access" function pointer to the "vm_operations_struct" structure in the LinuxKPI. While at it document when to use the "virtual_address" or the "address" field in the "vm_fault" structure. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Jun 5 15:30:36 2018 (r334659) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Tue Jun 5 15:37:28 2018 (r334660) @@ -120,8 +120,8 @@ struct vm_fault { pgoff_t pgoff; union { /* user-space address */ - void *virtual_address; - unsigned long address; + void *virtual_address; /* < 4.11 */ + unsigned long address; /* >= 4.11 */ }; struct page *page; struct vm_area_struct *vma; @@ -131,6 +131,7 @@ struct vm_operations_struct { void (*open) (struct vm_area_struct *); void (*close) (struct vm_area_struct *); int (*fault) (struct vm_area_struct *, struct vm_fault *); + int (*access) (struct vm_area_struct *, unsigned long, void *, int, int); }; /* From owner-svn-src-head@freebsd.org Tue Jun 5 15:38:36 2018 Return-Path: Delivered-To: svn-src-head@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 91CEDFF0478; Tue, 5 Jun 2018 15:38:36 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id BA4947F8AF; Tue, 5 Jun 2018 15:38:34 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 9F7D05646B; Tue, 5 Jun 2018 10:38:27 -0500 (CDT) Subject: Re: svn commit: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806022220.w52MK9TT026244@repo.freebsd.org> From: Eric van Gyzen Openpgp: preference=signencrypt Message-ID: <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> Date: Tue, 5 Jun 2018 10:38:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201806022220.w52MK9TT026244@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:38:36 -0000 On 06/02/2018 17:20, Mateusz Guzik wrote: > +#ifdef _KERNEL > +#define malloc(size, type, flags) ({ \ > + void *_malloc_item; \ > + size_t _size = (size); \ > + if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ > + ((flags) & M_ZERO)) { \ > + _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ > + if (((flags) & M_WAITOK) || _malloc_item != NULL) \ > + bzero(_malloc_item, _size); \ > + } else { \ > + _malloc_item = malloc(_size, type, flags); \ > + } \ > + _malloc_item; \ > +}) > +#endif Mateusz, Thank you for this and for all of your performance work. It is all very interesting stuff. Coverity complains about this line: if (((flags) & M_WAITOK) || _malloc_item != NULL) saying: The expression 1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL is suspicious because it performs a Boolean operation on a constant other than 0 or 1. Would you mind adding != 0 to appease Coverity? Thanks, Eric From owner-svn-src-head@freebsd.org Tue Jun 5 15:40:10 2018 Return-Path: Delivered-To: svn-src-head@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 A57F1FF095B; Tue, 5 Jun 2018 15:40:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B25F7FAA8; Tue, 5 Jun 2018 15:40:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 398C01E53C; Tue, 5 Jun 2018 15:40:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FeAUh039168; Tue, 5 Jun 2018 15:40:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FeA0u039167; Tue, 5 Jun 2018 15:40:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051540.w55FeA0u039167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334661 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:40:10 -0000 Author: hselasky Date: Tue Jun 5 15:40:09 2018 New Revision: 334661 URL: https://svnweb.freebsd.org/changeset/base/334661 Log: Implement the task_pid_vnr() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Tue Jun 5 15:37:28 2018 (r334660) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Tue Jun 5 15:40:09 2018 (r334661) @@ -89,6 +89,7 @@ struct task_struct { #define task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid #define task_pid(task) ((task)->pid) #define task_pid_nr(task) ((task)->pid) +#define task_pid_vnr(task) ((task)->pid) #define get_pid(x) (x) #define put_pid(x) do { } while (0) #define current_euid() (curthread->td_ucred->cr_uid) From owner-svn-src-head@freebsd.org Tue Jun 5 15:42:36 2018 Return-Path: Delivered-To: svn-src-head@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 7759EFF1250; Tue, 5 Jun 2018 15:42:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB627FF5E; Tue, 5 Jun 2018 15:42:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E3F61E6C3; Tue, 5 Jun 2018 15:42:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FgZBW043686; Tue, 5 Jun 2018 15:42:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FgZj1043685; Tue, 5 Jun 2018 15:42:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051542.w55FgZj1043685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334662 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:42:36 -0000 Author: hselasky Date: Tue Jun 5 15:42:35 2018 New Revision: 334662 URL: https://svnweb.freebsd.org/changeset/base/334662 Log: Define the __kernel_size_t type in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Tue Jun 5 15:40:09 2018 (r334661) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Tue Jun 5 15:42:35 2018 (r334662) @@ -62,6 +62,8 @@ typedef unsigned long pgoff_t; typedef u64 phys_addr_t; +typedef size_t __kernel_size_t; + #define DECLARE_BITMAP(n, bits) \ unsigned long n[howmany(bits, sizeof(long) * 8)] From owner-svn-src-head@freebsd.org Tue Jun 5 15:46:17 2018 Return-Path: Delivered-To: svn-src-head@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 95AA0FF1D5E; Tue, 5 Jun 2018 15:46:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B1A80300; Tue, 5 Jun 2018 15:46:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0941E6C7; Tue, 5 Jun 2018 15:46:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55FkGMM044039; Tue, 5 Jun 2018 15:46:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FkG4S044038; Tue, 5 Jun 2018 15:46:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051546.w55FkG4S044038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334663 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:46:17 -0000 Author: hselasky Date: Tue Jun 5 15:46:16 2018 New Revision: 334663 URL: https://svnweb.freebsd.org/changeset/base/334663 Log: Implement the INIT_DELAYED_WORK_ONSTACK() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Tue Jun 5 15:42:35 2018 (r334662) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Tue Jun 5 15:46:16 2018 (r334663) @@ -117,6 +117,9 @@ do { \ #define INIT_DELAYED_WORK(dwork, fn) \ linux_init_delayed_work(dwork, fn) +#define INIT_DELAYED_WORK_ONSTACK(dwork, fn) \ + linux_init_delayed_work(dwork, fn) + #define INIT_DEFERRABLE_WORK(dwork, fn) \ INIT_DELAYED_WORK(dwork, fn) From owner-svn-src-head@freebsd.org Tue Jun 5 15:49:36 2018 Return-Path: Delivered-To: svn-src-head@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 BA540FF276D; Tue, 5 Jun 2018 15:49:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D72805A3; Tue, 5 Jun 2018 15:49:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4617E1E6C8; Tue, 5 Jun 2018 15:49:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55Fnab8044247; Tue, 5 Jun 2018 15:49:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55FnZ0C044246; Tue, 5 Jun 2018 15:49:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806051549.w55FnZ0C044246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jun 2018 15:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334664 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 334664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 15:49:37 -0000 Author: hselasky Date: Tue Jun 5 15:49:35 2018 New Revision: 334664 URL: https://svnweb.freebsd.org/changeset/base/334664 Log: Declare and set the global "system_highpri_wq" workqueue structure pointer in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Tue Jun 5 15:46:16 2018 (r334663) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Tue Jun 5 15:49:35 2018 (r334664) @@ -214,6 +214,7 @@ do { \ extern struct workqueue_struct *system_wq; extern struct workqueue_struct *system_long_wq; extern struct workqueue_struct *system_unbound_wq; +extern struct workqueue_struct *system_highpri_wq; extern struct workqueue_struct *system_power_efficient_wq; extern void linux_init_delayed_work(struct delayed_work *, work_func_t); Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Tue Jun 5 15:46:16 2018 (r334663) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Tue Jun 5 15:49:35 2018 (r334664) @@ -55,6 +55,7 @@ static struct workqueue_struct *linux_system_long_wq; struct workqueue_struct *system_wq; struct workqueue_struct *system_long_wq; struct workqueue_struct *system_unbound_wq; +struct workqueue_struct *system_highpri_wq; struct workqueue_struct *system_power_efficient_wq; static int linux_default_wq_cpus = 4; @@ -598,6 +599,7 @@ linux_work_init(void *arg) system_wq = linux_system_short_wq; system_power_efficient_wq = linux_system_short_wq; system_unbound_wq = linux_system_short_wq; + system_highpri_wq = linux_system_short_wq; } SYSINIT(linux_work_init, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_init, NULL); @@ -612,5 +614,6 @@ linux_work_uninit(void *arg) system_wq = NULL; system_power_efficient_wq = NULL; system_unbound_wq = NULL; + system_highpri_wq = NULL; } SYSUNINIT(linux_work_uninit, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_uninit, NULL); From owner-svn-src-head@freebsd.org Tue Jun 5 16:18:38 2018 Return-Path: Delivered-To: svn-src-head@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 E3B99FF8D01; Tue, 5 Jun 2018 16:18:37 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44A818214C; Tue, 5 Jun 2018 16:18:37 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.0.242.29]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MgsVY-1fdUBh1xlA-00M7iX; Tue, 05 Jun 2018 18:18:29 +0200 Date: Tue, 5 Jun 2018 18:17:55 +0200 From: "O. Hartmann" To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334656 - head/stand/libsa Message-ID: <20180605181822.661e5cf0@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201806051447.w55ElDIt013519@repo.freebsd.org> References: <201806051447.w55ElDIt013519@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:JYTSVxuqtTYJDakLdbduowQmTZArvjxeQSNtmlPlI6buQrg2b4+ bcOGSWNZhJP4KaksXmorOy6ZdUxvVmpkoqJaH6Df0plZJb2oJrAub+vzwZMUrLfzy2bKpCb eC+npDyOuA4vep66bcFXxy7Qi1I48oNmHOAF5DvZVfDMXb2A5wQyYjbEUwoY1qDm+seMIke 3ww3LCmNENvcXYASiUgCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:KL/AFhzR0MI=:fdeg+LNRxxODroMGAVcwRJ CSe3gUSM+Zi2QS/NGmMwBmCNTu5alUwArd36UUhCM7HZ+r6eOjMQkd/WpqyUM/ZGLWDoc3S5A H1nK2nEc0TNsVTXXJhFL/RZpr+VBEEnKzSDisGHd1Um+vQwI7V6u3K2235b0BPCZQepUsgazW CzgC3O/0y9TdB1OyqOU82rDw0gSHKdq+TG0DV3KTt5hVM8qQFU3LBT0uhYkY6Z3ZLfb00Eu0X ZekOl0z3VX8EGP5ssxu3Mn5cpMlZA/WF07iTMDvsI98i/GJ4O9x8Z8cff0vmM8INJ2KM/8dI4 XbpcFxX0bS7bVMFLcay6zgFldNaaxqsov+yC44HBeEDt6W5Z0plgHTRxyixHq/50Eg5csOOL+ qkan1/Z9NjaQJrRb/iFOSd1LRSmjGm2RLxzr8F6pteA27cgJQInfdRkodpyUkXSdYsng+6HZB 002ZYBsz2ANO/KbE/3WcUgcYEr7yZ/ufHdYVwjROoWPMYCVHR8uMn5MSnkGMLjriSCakZBCqm wGVetIyHTaONrS//lI1Wvxzfp0Rulde25hC5vzUcrzva/dRLWEl0DHD3Oj9mGrM8uYgYJfiXS Nz97haVtvvCOCYxvkGO/zqnopvNadhEumo5rT3aiqRKkOdO3olH/LpFmk4n82fS/U+r4Utkz4 xUJW7+qba4xVzwf+X5zkUQNGLlXKKaRIuFY1l5EgET+erGHsqd3JU35I49HSG6hQX+68u1r7g LlCJG869RZDyrHwGR0t9wU9z6z4ak/QWGROmvchpUIPc3PUvwV8TZecvvlAZpyR9ziiLlF/Xr 1r49YJ9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 16:18:38 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFR1 ZSwgNSBKdW4gMjAxOCAxNDo0NzoxMyArMDAwMCAoVVRDKQ0KSWFuIExlcG9yZSA8aWFuQEZyZWVC U0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogaWFuDQo+IERhdGU6IFR1ZSBKdW4gIDUgMTQ6 NDc6MTMgMjAxOA0KPiBOZXcgUmV2aXNpb246IDMzNDY1Ng0KPiBVUkw6IGh0dHBzOi8vc3Zud2Vi LmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzMzNDY1Ng0KPiANCj4gTG9nOg0KPiAgIEFkZCB2 c25wcmludGYoKSB0byBsaWJzYS4gIEFscGhhLXNvcnQgdGhlIHByaW50ZiBwcm90b3R5cGVzIGlu IHN0YW5kLmguDQo+ICAgDQo+ICAgSSdtIG5vdCBzdXJlIHdoeSB0aGUgdipwcmludGYoKSBmdW5j dGlvbnMgaW4gbGlic2EgcmV0dXJuIHZvaWQgaW5zdGVhZCBvZg0KPiAgIGludCwgYnV0IHRoaXMg bWFpbnRhaW5zIHRoYXQgY29udmVudGlvbiBmb3IgdGhlIG5ldyBmdW5jdGlvbi4NCj4gDQo+IE1v ZGlmaWVkOg0KPiAgIGhlYWQvc3RhbmQvbGlic2EvcHJpbnRmLmMNCj4gICBoZWFkL3N0YW5kL2xp YnNhL3N0YW5kLmgNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N0YW5kL2xpYnNhL3ByaW50Zi5jDQo+ ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zdGFuZC9saWJzYS9wcmludGYuYwlU dWUgSnVuICA1IDEzOjUzOjM3IDIwMTgJKHIzMzQ2NTUpDQo+ICsrKyBoZWFkL3N0YW5kL2xpYnNh L3ByaW50Zi5jCVR1ZSBKdW4gIDUgMTQ6NDc6MTMgMjAxOAkocjMzNDY1NikNCj4gQEAgLTE0MSw2 ICsxNDEsMjAgQEAgc25wcmludGYoY2hhciAqYnVmLCBzaXplX3Qgc2l6ZSwgY29uc3QgY2hhciAq Y2ZtdCwgLi4uDQo+ICB9DQo+ICANCj4gIHZvaWQNCj4gK3ZzbnByaW50ZihjaGFyICpidWYsIHNp emVfdCBzaXplLCBjb25zdCBjaGFyICpjZm10LCB2YV9saXN0IGFwKQ0KPiArew0KPiArCXN0cnVj dCBwcmludF9idWYgYXJnOw0KPiArDQo+ICsJYXJnLmJ1ZiA9IGJ1ZjsNCj4gKwlhcmcuc2l6ZSA9 IHNpemU7DQo+ICsNCj4gKwlrdnByaW50ZihjZm10LCAmc25wcmludF9mdW5jLCAmYXJnLCAxMCwg YXApOw0KPiArDQo+ICsJaWYgKGFyZy5zaXplID49IDEpDQo+ICsJCSooYXJnLmJ1ZikrKyA9IDA7 DQo+ICt9DQo+ICsNCj4gK3ZvaWQNCj4gIHZzcHJpbnRmKGNoYXIgKmJ1ZiwgY29uc3QgY2hhciAq Y2ZtdCwgdmFfbGlzdCBhcCkNCj4gIHsNCj4gIAlpbnQJcmV0dmFsOw0KPiANCj4gTW9kaWZpZWQ6 IGhlYWQvc3RhbmQvbGlic2Evc3RhbmQuaA0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0t IGhlYWQvc3RhbmQvbGlic2Evc3RhbmQuaAlUdWUgSnVuICA1IDEzOjUzOjM3IDIwMTgJKHIzMzQ2 NTUpDQo+ICsrKyBoZWFkL3N0YW5kL2xpYnNhL3N0YW5kLmgJVHVlIEp1biAgNSAxNDo0NzoxMyAy MDE4CShyMzM0NjU2KQ0KPiBAQCAtMjY4LDEwICsyNjgsMTEgQEAgZXh0ZXJuIHZvaWQJKnJlYWxs b2NmKHZvaWQgKnB0ciwgc2l6ZV90IHNpemUpOw0KPiAgZXh0ZXJuIHZvaWQJbWFsbG9jc3RhdHMo dm9pZCk7DQo+ICANCj4gIGV4dGVybiBpbnQJcHJpbnRmKGNvbnN0IGNoYXIgKmZtdCwgLi4uKSBf X3ByaW50Zmxpa2UoMSwgMik7DQo+IC1leHRlcm4gdm9pZAl2cHJpbnRmKGNvbnN0IGNoYXIgKmZt dCwgX192YV9saXN0KTsNCj4gIGV4dGVybiBpbnQJc3ByaW50ZihjaGFyICpidWYsIGNvbnN0IGNo YXIgKmNmbXQsIC4uLikgX19wcmludGZsaWtlKDIsIDMpOw0KPiAgZXh0ZXJuIGludAlzbnByaW50 ZihjaGFyICpidWYsIHNpemVfdCBzaXplLCBjb25zdCBjaGFyICpjZm10LCAuLi4pDQo+IF9fcHJp bnRmbGlrZSgzLCA0KTsgK2V4dGVybiB2b2lkCXZwcmludGYoY29uc3QgY2hhciAqZm10LCBfX3Zh X2xpc3QpOw0KPiAgZXh0ZXJuIHZvaWQJdnNwcmludGYoY2hhciAqYnVmLCBjb25zdCBjaGFyICpj Zm10LCBfX3ZhX2xpc3QpOw0KPiArZXh0ZXJuIHZvaWQJdnNucHJpbnRmKGNoYXIgKmJ1Ziwgc2l6 ZV90IHNpemUsIGNvbnN0IGNoYXIgKmNmbXQsIF9fdmFfbGlzdCk7DQo+ICANCj4gIGV4dGVybiB2 b2lkCXR3aWRkbGUodV9pbnQgY2FsbGVyZGl2KTsNCj4gIGV4dGVybiB2b2lkCXR3aWRkbGVfZGl2 aXNvcih1X2ludCBnbG9iYWxkaXYpOw0KPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0 DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhl YWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55IG1haWwgdG8gInN2bi1zcmMtaGVhZC11bnN1 YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KDQpCdWlsZGluZyB3b3JsZC9rZXJuZWwgZmFpbHMgbm93 IHdpdGggdGhlIGVycm9yIHNob3duIGJlbG93Og0KDQoNClsuLi5dDQpJbiBmaWxlIGluY2x1ZGVk IGZyb20gL3Vzci9zcmMvc3RhbmQvZWZpL2Jvb3QxL2Jvb3QxLmM6MzQ6DQotIC0tLSBhbGxfc3Vi ZGlyX3NoYXJlIC0tLQ0KLSAtLS0gYWxsX3N1YmRpcl9zaGFyZS9pMThuL2VzZGIvS0FaQUtIIC0t LQ0KPT09PiBzaGFyZS9pMThuL2VzZGIvS0FaQUtIIChhbGwpDQotIC0tLSBhbGxfc3ViZGlyX3N0 YW5kIC0tLQ0KL3Vzci9zcmMvc3RhbmQvZWZpL2Jvb3QxL2Jvb3RfbW9kdWxlLmg6MTA5OjEyOiBl cnJvcjogY29uZmxpY3RpbmcgdHlwZXMgZm9yICd2c25wcmludGYnDQpleHRlcm4gaW50IHZzbnBy aW50ZihjaGFyICpzdHIsIHNpemVfdCBzeiwgY29uc3QgY2hhciAqZm10LCB2YV9saXN0IGFwKTsN CiAgICAgICAgICAgXg0KL3Vzci9zcmMvc3RhbmQvbGlic2Evc3RhbmQuaDoyNzU6MTM6IG5vdGU6 IHByZXZpb3VzIGRlY2xhcmF0aW9uIGlzIGhlcmUNCmV4dGVybiB2b2lkICAgICB2c25wcmludGYo Y2hhciAqYnVmLCBzaXplX3Qgc2l6ZSwgY29uc3QgY2hhciAqY2ZtdCwgX192YV9saXN0KTsNCiAg ICAgICAgICAgICAgICBeDQoxIGVycm9yIGdlbmVyYXRlZC4NCi0gLS0tIGFsbF9zdWJkaXJfcmVz Y3VlIC0tLQ0KLSAtLS0gZGVwZW5kX3N1YmRpcl9yZXNjdWUvcmVzY3VlL3JvdXRlZC9ydHF1ZXJ5 IC0tLQ0KPT09PiByZXNjdWUvcmVzY3VlL3JvdXRlZC9ydHF1ZXJ5IChkZXBlbmQpDQotIC0tLSBh bGxfc3ViZGlyX3N0YW5kIC0tLQ0KKioqIFtib290MS5vXSBFcnJvciBjb2RlIDENCg0KbWFrZVs1 XTogc3RvcHBlZCBpbiAvdXNyL3NyYy9zdGFuZC9lZmkvYm9vdDENCi5FUlJPUl9UQVJHRVQ9J2Jv b3QxLm8nDQouRVJST1JfTUVUQV9GSUxFPScvdXNyL29iai91c3Ivc3JjL2FtZDY0LmFtZDY0L3N0 YW5kL2VmaS9ib290MS9ib290MS5vLm1ldGEnDQouTUFLRS5MRVZFTD0nNScNCk1BS0VGSUxFPScn DQouTUFLRS5NT0RFPSdtZXRhIG1pc3NpbmctZmlsZW1vbj15ZXMgbWlzc2luZy1tZXRhPXllcyBz aWxlbnQ9eWVzIHZlcmJvc2UnDQpfRVJST1JfQ01EPSdjYyAtdGFyZ2V0IHg4Nl82NC11bmtub3du LWZyZWVic2QxMi4wDQotIC0tc3lzcm9vdD0vdXNyL29iai91c3Ivc3JjL2FtZDY0LmFtZDY0L3Rt cCAtQi91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL3Vzci9iaW4NCi0gLU8yIC1waXBl IC1PMyAtbWFyY2g9bmF0aXZlICAtV2Zvcm1hdCAtZnNob3J0LXdjaGFyIC1tbm8tcmVkLXpvbmUg LW5vc3RkaW5jDQotIC1JL3Vzci9vYmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC9zdGFuZC9saWJzYSAt SS91c3Ivc3JjL3N0YW5kL2xpYnNhIC1EX1NUQU5EQUxPTkUNCi0gLUkvdXNyL3NyYy9zeXMgLURk b3VibGU9amFnZ2VkLWxpdHRsZS1waWxsIC1EZmxvYXQ9ZmxvYXR5LW1jZmxvYXRmYWNlDQotIC1E TE9BREVSX0RJU0tfU1VQUE9SVCAtZmZyZWVzdGFuZGluZyAtbW5vLW1teCAtbW5vLXNzZSAtbW5v LWF2eCAtbW5vLWF2eDIgLW1zb2Z0LWZsb2F0DQotIC1mUElDIC1tbm8tcmVkLXpvbmUgLUkuIC1E RUZJX1pGU19CT09UIC1JL3Vzci9zcmMvc3RhbmQvZWZpL2luY2x1ZGUNCi0gLUkvdXNyL3NyYy9z dGFuZC9lZmkvaW5jbHVkZS9hbWQ2NCAtSS91c3Ivc3JjL3N5cy9jb250cmliL2Rldi9hY3BpY2Ev aW5jbHVkZQ0KLSAtREVGSV9VRlNfQk9PVCAtSS91c3Ivc3JjL3N0YW5kL2NvbW1vbiAtZlBJQyAt RE5ERUJVRyAtc3RkPWdudTk5IC1Xc3lzdGVtLWhlYWRlcnMNCi0gLVduby1wb2ludGVyLXNpZ24g LVduby1lbXB0eS1ib2R5IC1Xbm8tc3RyaW5nLXBsdXMtaW50IC1Xbm8tdW51c2VkLWNvbnN0LXZh cmlhYmxlDQotIC1Xbm8tdGF1dG9sb2dpY2FsLWNvbXBhcmUgLVduby11bnVzZWQtdmFsdWUgLVdu by1wYXJlbnRoZXNlcy1lcXVhbGl0eQ0KLSAtV25vLXVudXNlZC1mdW5jdGlvbiAtV25vLWVudW0t Y29udmVyc2lvbiAtV25vLXVudXNlZC1sb2NhbC10eXBlZGVmDQotIC1Xbm8tYWRkcmVzcy1vZi1w YWNrZWQtbWVtYmVyIC1Xbm8tc3dpdGNoIC1Xbm8tc3dpdGNoLWVudW0gLVduby1rbnItcHJvbW90 ZWQtcGFyYW1ldGVyDQotIC1Xbm8tcGFyZW50aGVzZXMgLVduby1mb3JtYXQgLVF1bnVzZWQtYXJn dW1lbnRzICAtYyAvdXNyL3NyYy9zdGFuZC9lZmkvYm9vdDEvYm9vdDEuYyAtbw0KYm9vdDEubzsg OycNCg0KLi4uDQoNCg0KU291cmNlcyBhcmUgYXQgcmV2aXNpb24gMzM0NjY0Lg0KDQpLaW5kIHJl Z2FyZHMsDQoNCm9oDQotIC0tIA0KTy4gSGFydG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIg TnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tl IG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4g NCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJR05BVFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lR UVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVDV3hhM3pnQUtDUkRTNTI4ZnlGaFkNCmxIQkxB Z0NQNjlWdXBLU3l3dzc3Z2ZnaEtVQlM2ZW9SNmpmNk9tdk1HV09ueGVtV0JTL0JBWXdpR0NLK1pG bWsNCjN1cjIwN3JqUm9xUi9DL2pGNHl3QTJkZFFRNVVBZ0NaN1F4Y1FENEhDbEtJbjNNdytXMFF2 dXZYUEx2L1RCak4NClZudlJmd1FmS25YVWZqTm1sbVhySHZEVGFIUzFSN1J0VFV2UXhLNUw1UGNB bU91UFFoUmoNCj1ZaXNPDQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Tue Jun 5 16:24:35 2018 Return-Path: Delivered-To: svn-src-head@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 832DDFD139F for ; Tue, 5 Jun 2018 16:24:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 13FE4828EF for ; Tue, 5 Jun 2018 16:24:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id d73-v6so4081781iog.3 for ; Tue, 05 Jun 2018 09:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q487qAduKosCKArIQeqQMB+4wZuzf3eAxqn5WPXB7jU=; b=tiMjg5dsNjvPkAxcJ1j8ImTnmbtQI3E/2IBGjnL6ls1HX0j8CKNixqSdlwTcCR6ZyV J9AbPI2dV2PhA3vmhbC+po8jrKjiuvnE5SNQDBGVotFIbw8jWd8Fp55K6Oljw2xX8MyX Nkl+v+BZge4GQ+EM1PL6EPHtYOidYAQI66FOj96T/ADMnmV6ifRQ2k0z6HWnYOyFnqf7 MdWQE4dNpFAlkQr78mxxa/xlANm2ZiCFJTisCipcg3Pbaza3nqRV2vUYLo09gscjUkCt Xek7QSMFSxxjwtkfEap+3in/kPBs3yjvnAwSmGLqJbUFpIvfAUG4dtCOtjV3gQKALegu DVHw== 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=q487qAduKosCKArIQeqQMB+4wZuzf3eAxqn5WPXB7jU=; b=UEbmMkY7Z+BRBNTsYdGUtVaPQ8tLWzYWHqjv5fFARbRFluG84ABIZpWPhx5Z4OiohN Z2kR9iqIuRn015vwTLN1sAAY4mNJf8wyJNp7PJUGzhg1bmRUQgvGm+CDknDny+nWf82k qvKNOYR+swba8Kv4gZL/ano1cSbAUf52jQ0F2570fFTPhKDLsFY2jJQKJ/owJmTzczF/ 9tmhvjqSpPhisLdWxdTSqXzlRwZCCiIyGrLyixgoCtpHY2zNfF27pWheFuFdvzM8VFvt mTy2gQ9tB+RRAA/Orc/36PjO7IBqxNfFmoMjIoA5pUNDsMpIMfr2R9ekQM1n8qmcELCd Ac7Q== X-Gm-Message-State: ALKqPweVUUsTnjW/XYDiVsx5rezc83L273rtZ7keBvMB1Xi5g3EPKqrW qumFD4QCmOEg2ol0yHrUkCuIldw0gl4ZFUYah4xqKQ== X-Google-Smtp-Source: ADUXVKK+o4t2Fg9CesWDwFHllg8SAUz1TG6sF3RTtTFIw6ccGtuTGny2Lp3oj0GfYNkpReve+EotGiHklXegylglQq0= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr25612851iof.299.1528215874275; Tue, 05 Jun 2018 09:24:34 -0700 (PDT) MIME-Version: 1.0 References: <201806051447.w55ElDIt013519@repo.freebsd.org> <20180605181822.661e5cf0@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180605181822.661e5cf0@thor.intern.walstatt.dynvpn.de> From: Warner Losh Date: Tue, 5 Jun 2018 10:24:22 -0600 Message-ID: Subject: Re: svn commit: r334656 - head/stand/libsa To: "O. Hartmann" Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 16:24:35 -0000 There is no real reason for these to be different. Especially if it causes problems... Warner On Tue, Jun 5, 2018, 10:18 AM O. Hartmann wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Am Tue, 5 Jun 2018 14:47:13 +0000 (UTC) > Ian Lepore schrieb: > > > Author: ian > > Date: Tue Jun 5 14:47:13 2018 > > New Revision: 334656 > > URL: https://svnweb.freebsd.org/changeset/base/334656 > > > > Log: > > Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.= h. > > > > I'm not sure why the v*printf() functions in libsa return void instea= d > of > > int, but this maintains that convention for the new function. > > > > Modified: > > head/stand/libsa/printf.c > > head/stand/libsa/stand.h > > > > Modified: head/stand/libsa/printf.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/stand/libsa/printf.c Tue Jun 5 13:53:37 2018 (r334655) > > +++ head/stand/libsa/printf.c Tue Jun 5 14:47:13 2018 (r334656) > > @@ -141,6 +141,20 @@ snprintf(char *buf, size_t size, const char *cfmt, > ... > > } > > > > void > > +vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) > > +{ > > + struct print_buf arg; > > + > > + arg.buf =3D buf; > > + arg.size =3D size; > > + > > + kvprintf(cfmt, &snprint_func, &arg, 10, ap); > > + > > + if (arg.size >=3D 1) > > + *(arg.buf)++ =3D 0; > > +} > > + > > +void > > vsprintf(char *buf, const char *cfmt, va_list ap) > > { > > int retval; > > > > Modified: head/stand/libsa/stand.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/stand/libsa/stand.h Tue Jun 5 13:53:37 2018 (r334655) > > +++ head/stand/libsa/stand.h Tue Jun 5 14:47:13 2018 (r334656) > > @@ -268,10 +268,11 @@ extern void *reallocf(void *ptr, size_t size)= ; > > extern void mallocstats(void); > > > > extern int printf(const char *fmt, ...) __printflike(1, 2); > > -extern void vprintf(const char *fmt, __va_list); > > extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, > 3); > > extern int snprintf(char *buf, size_t size, const char *cfmt, ...) > > __printflike(3, 4); +extern void vprintf(const char *fmt, > __va_list); > > extern void vsprintf(char *buf, const char *cfmt, __va_list); > > +extern void vsnprintf(char *buf, size_t size, const char *cfmt, > __va_list); > > > > extern void twiddle(u_int callerdiv); > > extern void twiddle_divisor(u_int globaldiv); > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > Building world/kernel fails now with the error shown below: > > > [...] > In file included from /usr/src/stand/efi/boot1/boot1.c:34: > - --- all_subdir_share --- > - --- all_subdir_share/i18n/esdb/KAZAKH --- > =3D=3D=3D> share/i18n/esdb/KAZAKH (all) > - --- all_subdir_stand --- > /usr/src/stand/efi/boot1/boot_module.h:109:12: error: conflicting types > for 'vsnprintf' > extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); > ^ > /usr/src/stand/libsa/stand.h:275:13: note: previous declaration is here > extern void vsnprintf(char *buf, size_t size, const char *cfmt, > __va_list); > ^ > 1 error generated. > - --- all_subdir_rescue --- > - --- depend_subdir_rescue/rescue/routed/rtquery --- > =3D=3D=3D> rescue/rescue/routed/rtquery (depend) > - --- all_subdir_stand --- > *** [boot1.o] Error code 1 > > make[5]: stopped in /usr/src/stand/efi/boot1 > .ERROR_TARGET=3D'boot1.o' > > .ERROR_META_FILE=3D'/usr/obj/usr/src/amd64.amd64/stand/efi/boot1/boot1.o.= meta' > .MAKE.LEVEL=3D'5' > MAKEFILE=3D'' > .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes = verbose' > _ERROR_CMD=3D'cc -target x86_64-unknown-freebsd12.0 > - --sysroot=3D/usr/obj/usr/src/amd64.amd64/tmp > -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin > - -O2 -pipe -O3 -march=3Dnative -Wformat -fshort-wchar -mno-red-zone > -nostdinc > - -I/usr/obj/usr/src/amd64.amd64/stand/libsa -I/usr/src/stand/libsa > -D_STANDALONE > - -I/usr/src/sys -Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatfa= ce > - -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx -mno-sse -mno-avx > -mno-avx2 -msoft-float > - -fPIC -mno-red-zone -I. -DEFI_ZFS_BOOT -I/usr/src/stand/efi/include > - -I/usr/src/stand/efi/include/amd64 > -I/usr/src/sys/contrib/dev/acpica/include > - -DEFI_UFS_BOOT -I/usr/src/stand/common -fPIC -DNDEBUG -std=3Dgnu99 > -Wsystem-headers > - -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable > - -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality > - -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef > - -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum > -Wno-knr-promoted-parameter > - -Wno-parentheses -Wno-format -Qunused-arguments -c > /usr/src/stand/efi/boot1/boot1.c -o > boot1.o; ;' > > ... > > > Sources are at revision 334664. > > Kind regards, > > oh > - -- > O. Hartmann > > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Ab= s. 4 BDSG). > -----BEGIN PGP SIGNATURE----- > > iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWxa3zgAKCRDS528fyFhY > lHBLAgCP69VupKSyww77gfghKUBS6eoR6jf6OmvMGWOnxemWBS/BAYwiGCK+ZFmk > 3ur207rjRoqR/C/jF4ywA2ddQQ5UAgCZ7QxcQD4HClKIn3Mw+W0QvuvXPLv/TBjN > VnvRfwQfKnXUfjNmlmXrHvDTaHS1R7RtTUvQxK5L5PcAmOuPQhRj > =3DYisO > -----END PGP SIGNATURE----- > From owner-svn-src-head@freebsd.org Tue Jun 5 16:35:39 2018 Return-Path: Delivered-To: svn-src-head@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 38AF9FD4B80; Tue, 5 Jun 2018 16:35:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (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 C974F83160; Tue, 5 Jun 2018 16:35:38 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x22c.google.com with SMTP id i18-v6so3062241qtp.12; Tue, 05 Jun 2018 09:35:38 -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=LHBLlzwwMhZsFB5SZJMJvDv5w9NOlOUQgdwWu2Si4Qk=; b=UJ4RyJm0ZE0RO0bt75pqf6hh0Pi+Hf5aqYQo+StXqJw3YxVF26lJXh+XAe4bUJdUDb HztlDL/fBPI2jVMwA7Ae4b4+3UbS3e43aDUB0A3DDR/Yv7rINEDBH5Nl6rZnG24VDVu2 inFyoOznxPthoRVILzQOor8V061lPWCNeKNheBQIJbWwLtrHUbVAJotdZi/ROaysxRwD fnyvNT/5XLMsOJWyWimvoT+R5N/nUqgWpxMdAUjrxHeJnAShLAWSpB+IkRJvVOa3f2GG Zr1Rw5x66Vx3yE8Cw5hbbzvoANX7wi/f1ofs4gTUumcmY3k2Og5Az51hg0nn4QC6xFNW KwhA== 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=LHBLlzwwMhZsFB5SZJMJvDv5w9NOlOUQgdwWu2Si4Qk=; b=ZdSp1qVOmiZWRLVUseZUSNiSPx0aScFoZkN7K/RtKw3PmL6ZyzmgNc56kkr1orbKlm vdLoKOOLC8hmbJwCSb4iaMB8WquDvzF9wOvj4i4x1IbDisYyF7gejSGcD7N3zmQOJj0i u2r9RP+KlIZCQPHbXLSxDOg76Jh6B58NpbawBRPVFYZP990HgepWK1wU7LIydDKCS4yU nm5pElHExn28LL7WPzwRQ07Bby01d69fUj+MGQw7pSRHI62ZMoZKbt1iUQPWJepSwKam VPLf+L/XfGYGWw46PlW7YXlm7HrKiX7Vqk+UO2Z3n6c1YvgrrsgU/gA2upkhPMjlnmDb rtPw== X-Gm-Message-State: APt69E0BrcF7uiOk2Ld38HdNUSTQ3lkGZ/cHJNxasukDHOqm/ufZBFO9 mgDfN44BIhB8pkozDq09v5TFpdMAF1uKkwH5rxc= X-Google-Smtp-Source: ADUXVKLFilGCb7necOOoIsuQoTpRRYMM35TaD7lMAi2WfJxKI5t/vM7YnwZPAZoPfCnKhozo2tPODbkLYHEwr7nHwaE= X-Received: by 2002:ac8:34aa:: with SMTP id w39-v6mr24442305qtb.237.1528216538401; Tue, 05 Jun 2018 09:35:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:1c4e:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 09:35:37 -0700 (PDT) In-Reply-To: <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> References: <201806022220.w52MK9TT026244@repo.freebsd.org> <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> From: Mateusz Guzik Date: Tue, 5 Jun 2018 18:35:37 +0200 Message-ID: Subject: Re: svn commit: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys To: Eric van Gyzen Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 16:35:39 -0000 On Tue, Jun 5, 2018 at 5:38 PM, Eric van Gyzen wrote: > On 06/02/2018 17:20, Mateusz Guzik wrote: > > +#ifdef _KERNEL > > +#define malloc(size, type, flags) ({ \ > > + void *_malloc_item; \ > > + size_t _size = (size); \ > > + if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ > > + ((flags) & M_ZERO)) { \ > > + _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ > > + if (((flags) & M_WAITOK) || _malloc_item != NULL) \ > > + bzero(_malloc_item, _size); \ > > + } else { \ > > + _malloc_item = malloc(_size, type, flags); \ > > + } \ > > + _malloc_item; \ > > +}) > > +#endif > > Mateusz, > > Thank you for this and for all of your performance work. It is all very > interesting stuff. > > Thank you for the kind words. It is positive feedback like this which keeps me going! > Coverity complains about this line: > > if (((flags) & M_WAITOK) || _malloc_item != NULL) > > saying: > > The expression > 1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL > is suspicious because it performs a Boolean operation > on a constant other than 0 or 1. > > Would you mind adding != 0 to appease Coverity? > Please go ahead. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Jun 5 16:46:39 2018 Return-Path: Delivered-To: svn-src-head@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 6AA99FDC4FC; Tue, 5 Jun 2018 16:46:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 BD22B83AD5; Tue, 5 Jun 2018 16:46:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w55GkR45036436; Tue, 5 Jun 2018 19:46:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w55GkR45036436 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w55GkRa9036435; Tue, 5 Jun 2018 19:46:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jun 2018 19:46:27 +0300 From: Konstantin Belousov To: Brad Davis Cc: Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180605164627.GM2450@kib.kiev.ua> References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 16:46:39 -0000 On Tue, Jun 05, 2018 at 09:24:02AM -0600, Brad Davis wrote: > On Tue, Jun 5, 2018, at 7:00 AM, Alexander Leidinger wrote: > > > > Quoting Brad Davis (from Mon, 04 Jun 2018 12:55:50 -0600): > > > > > On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote: > > >> [ Charset UTF-8 unsupported, converting... ] > > >> > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > > >> > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > > > >> > > > > I believe there are also other external consumers of this. > > >> > > > > > >> > > > Such as? > > >> > > > > >> > > Iirc some of the make release stuff calls into here, but that > > >> > > may of changed to use src/Makefile targets. distrib-dirs comes > > >> > > to mind. > > >> > > > >> > Sure, but those can go away or be updated as needed.. > > >> > > >> So again, no plan yet? > > > > > > Most of them are gone, I am still in progress on some of it. See > > > the github branch above. > > > > > > My testing is all done by building release VMs and comparing them > > > against a VM built from the last merge from HEAD. So I will update > > > the release stuff as I go. It is my responsibility to keep the > > > release stuff working as I change these. > > > > Have you checked mergemaster? IIRC it uses the distribution target. > > Yup, this does not affect the distribution target. I find it often very useful to do (cd src/etc/rc.d && make install) Same for defaults and several other directories which in fact contains non-editable content. Is this planned to keep working ? From owner-svn-src-head@freebsd.org Tue Jun 5 16:47:18 2018 Return-Path: Delivered-To: svn-src-head@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 09B14FDC76A for ; Tue, 5 Jun 2018 16:47:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 8403783C3C for ; Tue, 5 Jun 2018 16:47:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 159b46d6-68e0-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 159b46d6-68e0-11e8-b829-b3adae557cda; Tue, 05 Jun 2018 16:47:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w55Gl7r9038253; Tue, 5 Jun 2018 10:47:07 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528217227.63685.0.camel@freebsd.org> Subject: Re: svn commit: r334656 - head/stand/libsa From: Ian Lepore To: Warner Losh , "O. Hartmann" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jun 2018 10:47:07 -0600 In-Reply-To: References: <201806051447.w55ElDIt013519@repo.freebsd.org> <20180605181822.661e5cf0@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 16:47:18 -0000 On Tue, 2018-06-05 at 10:24 -0600, Warner Losh wrote: > There is no real reason for these to be different. Especially if it > causes > problems... > > Warner > I'm working on a fix. -- Ian > On Tue, Jun 5, 2018, 10:18 AM O. Hartmann > wrote: > > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA512 > > > > Am Tue, 5 Jun 2018 14:47:13 +0000 (UTC) > > Ian Lepore schrieb: > > > > > > > > Author: ian > > > Date: Tue Jun  5 14:47:13 2018 > > > New Revision: 334656 > > > URL: https://svnweb.freebsd.org/changeset/base/334656 > > > > > > Log: > > >   Add vsnprintf() to libsa.  Alpha-sort the printf prototypes in > > > stand.h. > > > > > >   I'm not sure why the v*printf() functions in libsa return void > > > instead > > of > > > > > >   int, but this maintains that convention for the new function. > > > > > > Modified: > > >   head/stand/libsa/printf.c > > >   head/stand/libsa/stand.h > > > > > > Modified: head/stand/libsa/printf.c > > > > > =================================================================== > > =========== > > > > > > --- head/stand/libsa/printf.c Tue Jun  5 13:53:37 > > > 2018        (r334655) > > > +++ head/stand/libsa/printf.c Tue Jun  5 14:47:13 > > > 2018        (r334656) > > > @@ -141,6 +141,20 @@ snprintf(char *buf, size_t size, const char > > > *cfmt, > > ... > > > > > >  } > > > > > >  void > > > +vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) > > > +{ > > > +     struct print_buf arg; > > > + > > > +     arg.buf = buf; > > > +     arg.size = size; > > > + > > > +     kvprintf(cfmt, &snprint_func, &arg, 10, ap); > > > + > > > +     if (arg.size >= 1) > > > +             *(arg.buf)++ = 0; > > > +} > > > + > > > +void > > >  vsprintf(char *buf, const char *cfmt, va_list ap) > > >  { > > >       int     retval; > > > > > > Modified: head/stand/libsa/stand.h > > > > > =================================================================== > > =========== > > > > > > --- head/stand/libsa/stand.h  Tue Jun  5 13:53:37 > > > 2018        (r334655) > > > +++ head/stand/libsa/stand.h  Tue Jun  5 14:47:13 > > > 2018        (r334656) > > > @@ -268,10 +268,11 @@ extern void     *reallocf(void *ptr, size_t > > > size); > > >  extern void  mallocstats(void); > > > > > >  extern int   printf(const char *fmt, ...) __printflike(1, 2); > > > -extern void  vprintf(const char *fmt, __va_list); > > >  extern int   sprintf(char *buf, const char *cfmt, ...) > > > __printflike(2, > > 3); > > > > > >  extern int   snprintf(char *buf, size_t size, const char *cfmt, > > > ...) > > > __printflike(3, 4); +extern void      vprintf(const char *fmt, > > __va_list); > > > > > >  extern void  vsprintf(char *buf, const char *cfmt, __va_list); > > > +extern void  vsnprintf(char *buf, size_t size, const char *cfmt, > > __va_list); > > > > > > > > >  extern void  twiddle(u_int callerdiv); > > >  extern void  twiddle_divisor(u_int globaldiv); > > > _______________________________________________ > > > svn-src-head@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebs > > > d.org" > > > > Building world/kernel fails now with the error shown below: > > > > > > [...] > > In file included from /usr/src/stand/efi/boot1/boot1.c:34: > > - --- all_subdir_share --- > > - --- all_subdir_share/i18n/esdb/KAZAKH --- > > ===> share/i18n/esdb/KAZAKH (all) > > - --- all_subdir_stand --- > > /usr/src/stand/efi/boot1/boot_module.h:109:12: error: conflicting > > types > > for 'vsnprintf' > > extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list > > ap); > >            ^ > > /usr/src/stand/libsa/stand.h:275:13: note: previous declaration is > > here > > extern void     vsnprintf(char *buf, size_t size, const char *cfmt, > > __va_list); > >                 ^ > > 1 error generated. > > - --- all_subdir_rescue --- > > - --- depend_subdir_rescue/rescue/routed/rtquery --- > > ===> rescue/rescue/routed/rtquery (depend) > > - --- all_subdir_stand --- > > *** [boot1.o] Error code 1 > > > > make[5]: stopped in /usr/src/stand/efi/boot1 > > .ERROR_TARGET='boot1.o' > > > > .ERROR_META_FILE='/usr/obj/usr/src/amd64.amd64/stand/efi/boot1/boot > > 1.o.meta' > > .MAKE.LEVEL='5' > > MAKEFILE='' > > .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes > > verbose' > > _ERROR_CMD='cc -target x86_64-unknown-freebsd12.0 > > - --sysroot=/usr/obj/usr/src/amd64.amd64/tmp > > -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin > > - -O2 -pipe -O3 -march=native  -Wformat -fshort-wchar -mno-red-zone > > -nostdinc > > - -I/usr/obj/usr/src/amd64.amd64/stand/libsa -I/usr/src/stand/libsa > > -D_STANDALONE > > - -I/usr/src/sys -Ddouble=jagged-little-pill -Dfloat=floaty- > > mcfloatface > > - -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx -mno-sse -mno-avx > > -mno-avx2 -msoft-float > > - -fPIC -mno-red-zone -I. -DEFI_ZFS_BOOT > > -I/usr/src/stand/efi/include > > - -I/usr/src/stand/efi/include/amd64 > > -I/usr/src/sys/contrib/dev/acpica/include > > - -DEFI_UFS_BOOT -I/usr/src/stand/common -fPIC -DNDEBUG -std=gnu99 > > -Wsystem-headers > > - -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > > -Wno-unused-const-variable > > - -Wno-tautological-compare -Wno-unused-value -Wno-parentheses- > > equality > > - -Wno-unused-function -Wno-enum-conversion -Wno-unused-local- > > typedef > > - -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum > > -Wno-knr-promoted-parameter > > - -Wno-parentheses -Wno-format -Qunused-arguments  -c > > /usr/src/stand/efi/boot1/boot1.c -o > > boot1.o; ;' > > > > ... > > > > > > Sources are at revision 334664. > > > > Kind regards, > > > > oh > > - -- > > O. Hartmann > > > > Ich widerspreche der Nutzung oder Übermittlung meiner Daten für > > Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 > > BDSG). > > -----BEGIN PGP SIGNATURE----- > > > > iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWxa3zgAKCRDS528fyFhY > > lHBLAgCP69VupKSyww77gfghKUBS6eoR6jf6OmvMGWOnxemWBS/BAYwiGCK+ZFmk > > 3ur207rjRoqR/C/jF4ywA2ddQQ5UAgCZ7QxcQD4HClKIn3Mw+W0QvuvXPLv/TBjN > > VnvRfwQfKnXUfjNmlmXrHvDTaHS1R7RtTUvQxK5L5PcAmOuPQhRj > > =YisO > > -----END PGP SIGNATURE----- > > From owner-svn-src-head@freebsd.org Tue Jun 5 17:18:11 2018 Return-Path: Delivered-To: svn-src-head@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 81828FE332F; Tue, 5 Jun 2018 17:18:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFA5856E9; Tue, 5 Jun 2018 17:18:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEF251F535; Tue, 5 Jun 2018 17:18:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55HIAv4089948; Tue, 5 Jun 2018 17:18:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55HIABO089947; Tue, 5 Jun 2018 17:18:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806051718.w55HIABO089947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jun 2018 17:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334665 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 334665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 17:18:11 -0000 Author: ian Date: Tue Jun 5 17:18:10 2018 New Revision: 334665 URL: https://svnweb.freebsd.org/changeset/base/334665 Log: Make the v*printf() functions in libsa return int instead of void. This makes them compatible with the C standard signatures, avoiding spurious mismatch errors in the places where the oddball requirements of standalone code end up putting two declarations of the same function in play. Modified: head/stand/libsa/printf.c head/stand/libsa/stand.h Modified: head/stand/libsa/printf.c ============================================================================== --- head/stand/libsa/printf.c Tue Jun 5 15:49:35 2018 (r334664) +++ head/stand/libsa/printf.c Tue Jun 5 17:18:10 2018 (r334665) @@ -80,11 +80,11 @@ printf(const char *fmt, ...) return retval; } -void +int vprintf(const char *fmt, va_list ap) { - kvprintf(fmt, putchar_wrapper, NULL, 10, ap); + return (kvprintf(fmt, putchar_wrapper, NULL, 10, ap)); } int @@ -140,27 +140,32 @@ snprintf(char *buf, size_t size, const char *cfmt, ... return retval; } -void +int vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) { struct print_buf arg; + int retval; arg.buf = buf; arg.size = size; - kvprintf(cfmt, &snprint_func, &arg, 10, ap); + retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap); if (arg.size >= 1) *(arg.buf)++ = 0; + + return (retval); } -void +int vsprintf(char *buf, const char *cfmt, va_list ap) { int retval; retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap); buf[retval] = '\0'; + + return (retval); } /* Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Jun 5 15:49:35 2018 (r334664) +++ head/stand/libsa/stand.h Tue Jun 5 17:18:10 2018 (r334665) @@ -270,9 +270,9 @@ extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); -extern void vprintf(const char *fmt, __va_list); -extern void vsprintf(char *buf, const char *cfmt, __va_list); -extern void vsnprintf(char *buf, size_t size, const char *cfmt, __va_list); +extern int vprintf(const char *fmt, __va_list); +extern int vsprintf(char *buf, const char *cfmt, __va_list); +extern int vsnprintf(char *buf, size_t size, const char *cfmt, __va_list); extern void twiddle(u_int callerdiv); extern void twiddle_divisor(u_int globaldiv); From owner-svn-src-head@freebsd.org Tue Jun 5 17:27:13 2018 Return-Path: Delivered-To: svn-src-head@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 113E0FE510E for ; Tue, 5 Jun 2018 17:27:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 3827786078 for ; Tue, 5 Jun 2018 17:27:12 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: a6aec812-68e5-11e8-afd2-4ddcc8249dd4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id a6aec812-68e5-11e8-afd2-4ddcc8249dd4; Tue, 05 Jun 2018 17:27:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w55HQw6s038342; Tue, 5 Jun 2018 11:26:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528219618.63685.1.camel@freebsd.org> Subject: Re: svn commit: r334656 - head/stand/libsa From: Ian Lepore To: Warner Losh , "O. Hartmann" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jun 2018 11:26:58 -0600 In-Reply-To: References: <201806051447.w55ElDIt013519@repo.freebsd.org> <20180605181822.661e5cf0@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 17:27:13 -0000 (Should be) Fixed in r334665, sorry for the breakage. -- Ian On Tue, 2018-06-05 at 10:24 -0600, Warner Losh wrote: > There is no real reason for these to be different. Especially if it > causes > problems... > > Warner > > On Tue, Jun 5, 2018, 10:18 AM O. Hartmann > wrote: > > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA512 > > > > Am Tue, 5 Jun 2018 14:47:13 +0000 (UTC) > > Ian Lepore schrieb: > > > > > > > > Author: ian > > > Date: Tue Jun  5 14:47:13 2018 > > > New Revision: 334656 > > > URL: https://svnweb.freebsd.org/changeset/base/334656 > > > > > > Log: > > >   Add vsnprintf() to libsa.  Alpha-sort the printf prototypes in > > > stand.h. > > > > > >   I'm not sure why the v*printf() functions in libsa return void > > > instead > > of > > > > > >   int, but this maintains that convention for the new function. > > > > > > Modified: > > >   head/stand/libsa/printf.c > > >   head/stand/libsa/stand.h > > > > > > Modified: head/stand/libsa/printf.c > > > > > =================================================================== > > =========== > > > > > > --- head/stand/libsa/printf.c Tue Jun  5 13:53:37 > > > 2018        (r334655) > > > +++ head/stand/libsa/printf.c Tue Jun  5 14:47:13 > > > 2018        (r334656) > > > @@ -141,6 +141,20 @@ snprintf(char *buf, size_t size, const char > > > *cfmt, > > ... > > > > > >  } > > > > > >  void > > > +vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) > > > +{ > > > +     struct print_buf arg; > > > + > > > +     arg.buf = buf; > > > +     arg.size = size; > > > + > > > +     kvprintf(cfmt, &snprint_func, &arg, 10, ap); > > > + > > > +     if (arg.size >= 1) > > > +             *(arg.buf)++ = 0; > > > +} > > > + > > > +void > > >  vsprintf(char *buf, const char *cfmt, va_list ap) > > >  { > > >       int     retval; > > > > > > Modified: head/stand/libsa/stand.h > > > > > =================================================================== > > =========== > > > > > > --- head/stand/libsa/stand.h  Tue Jun  5 13:53:37 > > > 2018        (r334655) > > > +++ head/stand/libsa/stand.h  Tue Jun  5 14:47:13 > > > 2018        (r334656) > > > @@ -268,10 +268,11 @@ extern void     *reallocf(void *ptr, size_t > > > size); > > >  extern void  mallocstats(void); > > > > > >  extern int   printf(const char *fmt, ...) __printflike(1, 2); > > > -extern void  vprintf(const char *fmt, __va_list); > > >  extern int   sprintf(char *buf, const char *cfmt, ...) > > > __printflike(2, > > 3); > > > > > >  extern int   snprintf(char *buf, size_t size, const char *cfmt, > > > ...) > > > __printflike(3, 4); +extern void      vprintf(const char *fmt, > > __va_list); > > > > > >  extern void  vsprintf(char *buf, const char *cfmt, __va_list); > > > +extern void  vsnprintf(char *buf, size_t size, const char *cfmt, > > __va_list); > > > > > > > > >  extern void  twiddle(u_int callerdiv); > > >  extern void  twiddle_divisor(u_int globaldiv); > > > _______________________________________________ > > > svn-src-head@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebs > > > d.org" > > > > Building world/kernel fails now with the error shown below: > > > > > > [...] > > In file included from /usr/src/stand/efi/boot1/boot1.c:34: > > - --- all_subdir_share --- > > - --- all_subdir_share/i18n/esdb/KAZAKH --- > > ===> share/i18n/esdb/KAZAKH (all) > > - --- all_subdir_stand --- > > /usr/src/stand/efi/boot1/boot_module.h:109:12: error: conflicting > > types > > for 'vsnprintf' > > extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list > > ap); > >            ^ > > /usr/src/stand/libsa/stand.h:275:13: note: previous declaration is > > here > > extern void     vsnprintf(char *buf, size_t size, const char *cfmt, > > __va_list); > >                 ^ > > 1 error generated. > > - --- all_subdir_rescue --- > > - --- depend_subdir_rescue/rescue/routed/rtquery --- > > ===> rescue/rescue/routed/rtquery (depend) > > - --- all_subdir_stand --- > > *** [boot1.o] Error code 1 > > > > make[5]: stopped in /usr/src/stand/efi/boot1 > > .ERROR_TARGET='boot1.o' > > > > .ERROR_META_FILE='/usr/obj/usr/src/amd64.amd64/stand/efi/boot1/boot > > 1.o.meta' > > .MAKE.LEVEL='5' > > MAKEFILE='' > > .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes > > verbose' > > _ERROR_CMD='cc -target x86_64-unknown-freebsd12.0 > > - --sysroot=/usr/obj/usr/src/amd64.amd64/tmp > > -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin > > - -O2 -pipe -O3 -march=native  -Wformat -fshort-wchar -mno-red-zone > > -nostdinc > > - -I/usr/obj/usr/src/amd64.amd64/stand/libsa -I/usr/src/stand/libsa > > -D_STANDALONE > > - -I/usr/src/sys -Ddouble=jagged-little-pill -Dfloat=floaty- > > mcfloatface > > - -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx -mno-sse -mno-avx > > -mno-avx2 -msoft-float > > - -fPIC -mno-red-zone -I. -DEFI_ZFS_BOOT > > -I/usr/src/stand/efi/include > > - -I/usr/src/stand/efi/include/amd64 > > -I/usr/src/sys/contrib/dev/acpica/include > > - -DEFI_UFS_BOOT -I/usr/src/stand/common -fPIC -DNDEBUG -std=gnu99 > > -Wsystem-headers > > - -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > > -Wno-unused-const-variable > > - -Wno-tautological-compare -Wno-unused-value -Wno-parentheses- > > equality > > - -Wno-unused-function -Wno-enum-conversion -Wno-unused-local- > > typedef > > - -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum > > -Wno-knr-promoted-parameter > > - -Wno-parentheses -Wno-format -Qunused-arguments  -c > > /usr/src/stand/efi/boot1/boot1.c -o > > boot1.o; ;' > > > > ... > > > > > > Sources are at revision 334664. > > > > Kind regards, > > > > oh > > - -- > > O. Hartmann > > > > Ich widerspreche der Nutzung oder Übermittlung meiner Daten für > > Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 > > BDSG). > > -----BEGIN PGP SIGNATURE----- > > > > iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWxa3zgAKCRDS528fyFhY > > lHBLAgCP69VupKSyww77gfghKUBS6eoR6jf6OmvMGWOnxemWBS/BAYwiGCK+ZFmk > > 3ur207rjRoqR/C/jF4ywA2ddQQ5UAgCZ7QxcQD4HClKIn3Mw+W0QvuvXPLv/TBjN > > VnvRfwQfKnXUfjNmlmXrHvDTaHS1R7RtTUvQxK5L5PcAmOuPQhRj > > =YisO > > -----END PGP SIGNATURE----- > > From owner-svn-src-head@freebsd.org Tue Jun 5 17:49:37 2018 Return-Path: Delivered-To: svn-src-head@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 CA4A6FE97C0; Tue, 5 Jun 2018 17:49:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD5687226; Tue, 5 Jun 2018 17:49:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [10.10.154.196] (unknown [185.93.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id ECE2D43E44; Tue, 5 Jun 2018 19:49:35 +0200 (CEST) From: Dimitry Andric Message-Id: <39385E73-A75B-4E61-91D3-4CA86252AEDA@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_53FC7137-D105-48D6-AB2F-F42056CA88D3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334647 - in head: . . . [this broke ci.freebsd.org's FreeBSD-head-amd64-gcc build but via an include/c++/v1/ problem] Date: Tue, 5 Jun 2018 19:49:31 +0200 In-Reply-To: <5D1C2920-2206-4602-BD2D-D1298E5D62EE@yahoo.com> Cc: svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org, mmacy@FreeBSD.org To: Mark Millard References: <5D1C2920-2206-4602-BD2D-D1298E5D62EE@yahoo.com> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 17:49:38 -0000 --Apple-Mail=_53FC7137-D105-48D6-AB2F-F42056CA88D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 5 Jun 2018, at 15:03, Mark Millard via freebsd-toolchain = wrote: >=20 > https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/5974/consoleText = shows: >=20 > --- all_subdir_usr.sbin/pmc --- > In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216:0,= > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, > from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: > = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale: = At global scope: > = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 237:40: error: redundant redeclaration of 'void = std::__1::__throw_runtime_error(const char*)' in same scope = [-Werror=3Dredundant-decls] > _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); > ^~~~~~~~~~~~~~~~~~~~~ > In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/memory:663= :0, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/algorithm:= 643, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__string:5= 6, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string_vie= w:176, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string:477= , > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 5, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216, > from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, > from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: > = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/stdexcept:= 186:40: note: previous declaration of 'void = std::__1::__throw_runtime_error(const char*)' > _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); > ^~~~~~~~~~~~~~~~~~~~~ >=20 >=20 > It looks like the new #include of iostream brings in code that gcc = rejected above: >=20 > --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 23:17:18 2018 = (r334645, copy source) > +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Tue Jun 5 04:26:40 2018 = (r334647) > @@ -68,11 +68,22 @@ __FBSDID("$FreeBSD$"); > #include > #include "cmd_pmc.h" >=20 > +#include > . . . I don't think anybody has yet tested building libc++ headers with the combination of recent gcc, -Wsystem-headers, and -Werror. :) For now, try disabling -Wredundant-decls. -Dimitry --Apple-Mail=_53FC7137-D105-48D6-AB2F-F42056CA88D3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWxbNKwAKCRCwXqMKLiCW o4H2AKDqCHPXYzdhSl1mwKRaofQ1jHb64ACfSzBkig7ze8tWy/sRWBt8hkL1B88= =qbEF -----END PGP SIGNATURE----- --Apple-Mail=_53FC7137-D105-48D6-AB2F-F42056CA88D3-- From owner-svn-src-head@freebsd.org Tue Jun 5 18:13:07 2018 Return-Path: Delivered-To: svn-src-head@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 0EF8EFEE495; Tue, 5 Jun 2018 18:13:07 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 A324E689DF; Tue, 5 Jun 2018 18:13:06 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3A4FB21138; Tue, 5 Jun 2018 14:13:06 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute5.internal (MEProxy); Tue, 05 Jun 2018 14:13:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Hbhh/7 Q/rPrm4MQINSPtQO01T6Dvb69eclZzJhnehkg=; b=e1qAuqjaha0CP9xoXrT7G0 zh+zJVp+Omq5y8aEJOCb1ltLlAXS4/9PRGi8DsCLCZ1YpVILMEPDSjoqp6ydwsf8 WA89l303b8EB20WRl4rSw0d9aFUlHeKG9mVvW19gqAJ80IqpeUvx/P3DCfuleEgZ Y+57wcEFpgxqEjbEJdHJZ6f8mzu6YTcIuaJJWsMFfZ2c2jbmI7Wq6sx5WsI7MBQA k3+PUjN593SO7mBx5TAtTfvB1CcyE8mi+yjsE6Yg0Ms7zVfGrzsJXmcvhMRs0Lib mFIQ3XGyGqvlHyIi0vyqur0QJQsuTUrQeE5ydi1eGsgTiH3rBa6LIZghBOLzj5Vw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id E6389940D4; Tue, 5 Jun 2018 14:13:05 -0400 (EDT) Message-Id: <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> From: Brad Davis To: Konstantin Belousov Cc: Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea In-Reply-To: <20180605164627.GM2450@kib.kiev.ua> Date: Tue, 05 Jun 2018 12:13:05 -0600 Subject: Re: svn commit: r334617 - in head: . etc References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 18:13:07 -0000 On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > On Tue, Jun 05, 2018 at 09:24:02AM -0600, Brad Davis wrote: > > On Tue, Jun 5, 2018, at 7:00 AM, Alexander Leidinger wrote: > > > > > > Quoting Brad Davis (from Mon, 04 Jun 2018 12:55:50 -0600): > > > > > > > On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote: > > > >> [ Charset UTF-8 unsupported, converting... ] > > > >> > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote: > > > >> > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote: > > > > > > >> > > > > I believe there are also other external consumers of this. > > > >> > > > > > > >> > > > Such as? > > > >> > > > > > >> > > Iirc some of the make release stuff calls into here, but that > > > >> > > may of changed to use src/Makefile targets. distrib-dirs comes > > > >> > > to mind. > > > >> > > > > >> > Sure, but those can go away or be updated as needed.. > > > >> > > > >> So again, no plan yet? > > > > > > > > Most of them are gone, I am still in progress on some of it. See > > > > the github branch above. > > > > > > > > My testing is all done by building release VMs and comparing them > > > > against a VM built from the last merge from HEAD. So I will update > > > > the release stuff as I go. It is my responsibility to keep the > > > > release stuff working as I change these. > > > > > > Have you checked mergemaster? IIRC it uses the distribution target. > > > > Yup, this does not affect the distribution target. > > I find it often very useful to do > (cd src/etc/rc.d && make install) > Same for defaults and several other directories which in fact contains > non-editable content. Is this planned to keep working ? The short answer is, no. All rc.d scripts get moved to the src of the program they start. That said, if there is a big need for this, we can see about options to keep them working. What are you trying to accomplish when you do this? Just verify the rc.d scripts match your src tree? Regards, Brad Davis From owner-svn-src-head@freebsd.org Tue Jun 5 18:26:17 2018 Return-Path: Delivered-To: svn-src-head@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 19E04FF0D88; Tue, 5 Jun 2018 18:26:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 8EF186959F; Tue, 5 Jun 2018 18:26:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w55IQ6Wi059491; Tue, 5 Jun 2018 21:26:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w55IQ6Wi059491 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w55IQ6Bg059490; Tue, 5 Jun 2018 21:26:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jun 2018 21:26:06 +0300 From: Konstantin Belousov To: Brad Davis Cc: Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180605182605.GN2450@kib.kiev.ua> References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 18:26:17 -0000 On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: > On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > > I find it often very useful to do > > (cd src/etc/rc.d && make install) > > Same for defaults and several other directories which in fact contains > > non-editable content. Is this planned to keep working ? > > The short answer is, no. All rc.d scripts get moved to the src of the program they start. > > That said, if there is a big need for this, we can see about options to keep them working. > > What are you trying to accomplish when you do this? Just verify the rc.d scripts match your src tree? I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, /etc/rc.subr /etc/rc.network are not suitable to etc, they are binaries provided by the project not for the user editing. When upgrading the host, esp. on HEAD, i usually refresh scripts by this procedure and avoid any editing and implied conflict resolution for real configs. Not being able to easily install clean copies of these scripts would be very inconvenient and time consuming. From owner-svn-src-head@freebsd.org Tue Jun 5 18:27:10 2018 Return-Path: Delivered-To: svn-src-head@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 2E24CFF1099; Tue, 5 Jun 2018 18:27:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D05A26973A; Tue, 5 Jun 2018 18:27:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9922004A; Tue, 5 Jun 2018 18:27:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55IR9Yx024691; Tue, 5 Jun 2018 18:27:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55IR9vf024690; Tue, 5 Jun 2018 18:27:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806051827.w55IR9vf024690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jun 2018 18:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334666 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 334666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 18:27:10 -0000 Author: emaste Date: Tue Jun 5 18:27:09 2018 New Revision: 334666 URL: https://svnweb.freebsd.org/changeset/base/334666 Log: Handle -DNO_CLEAN builds across brk/sbrk rewrite in r334626 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 5 17:18:10 2018 (r334665) +++ head/Makefile.inc1 Tue Jun 5 18:27:09 2018 (r334666) @@ -810,7 +810,8 @@ _cleanobj_fast_depend_hack: .PHONY # 20180406 r332119 setlogin # 20180411 r332443 exect # 20180525 r334224 vadvise -.for f in exect fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs vadvise +# 20180604 r334626 brk sbrk +.for f in brk exect fstat fstatat fstatfs getdirentries getfsstat sbrk setlogin shmat sigreturn statfs vadvise .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-head@freebsd.org Tue Jun 5 18:39:31 2018 Return-Path: Delivered-To: svn-src-head@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 A166BFF1A5D for ; Tue, 5 Jun 2018 18:39:31 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DE28069F90 for ; Tue, 5 Jun 2018 18:39:30 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w55IdGmQ046866 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Jun 2018 20:39:17 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w55Id5pg002449 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 6 Jun 2018 01:39:05 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Konstantin Belousov , Brad Davis References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> Cc: Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B16D8C4.10809@grosbein.net> Date: Wed, 6 Jun 2018 01:39:00 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20180605182605.GN2450@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 18:39:31 -0000 06.06.2018 1:26, Konstantin Belousov wrote: >>> I find it often very useful to do >>> (cd src/etc/rc.d && make install) >>> Same for defaults and several other directories which in fact contains >>> non-editable content. Is this planned to keep working ? >> >> The short answer is, no. All rc.d scripts get moved to the src of the program they start. >> >> That said, if there is a big need for this, we can see about options to keep them working. >> >> What are you trying to accomplish when you do this? Just verify the rc.d scripts match your src tree? > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binaries > provided by the project not for the user editing. > > When upgrading the host, esp. on HEAD, i usually refresh scripts by this > procedure and avoid any editing and implied conflict resolution for real > configs. > > Not being able to easily install clean copies of these scripts would > be very inconvenient and time consuming. I found that "mergemaster -iFUP" deals with unchanged files including mentioned rc* scripts just fine. That is, it automatically refreshes unchanged files without any silly questions just for change of $FreeBSD$. From owner-svn-src-head@freebsd.org Tue Jun 5 19:07:20 2018 Return-Path: Delivered-To: svn-src-head@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 0E372FF2AC9; Tue, 5 Jun 2018 19:07:20 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::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 965286C6D6; Tue, 5 Jun 2018 19:07:19 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x233.google.com with SMTP id o9-v6so3653162qtp.3; Tue, 05 Jun 2018 12:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gmGQFKwW4Wm+iSt1F+HEkSwq58VNZGkLUx1Iw5bSIog=; b=ivMP5PQYHjSUUfgA+TUb+3WbISMtm1OqqBBDUa45KUCENpuqmY2qu3jbWYq0J0HBuc yeJ5BGawWZACtqi9l9nes/usR7IY6WGK5oMA2OuU6VQqv+FesFaoK6en0oantOEsft6D /1leCukHjGGNtoCLgvPIp+Bc5SNNd2reyRkM44s2DKdJ7M0BL5OVMHGifWRk/NonHhyG hqilydxuCL/sdILKO+lL2+G7v6JPUhWQrFPhDRoDL4DulVw0oHtyegnVqUjKrqf97K8s Nk4ADE2irBHcNTLDS/3us22a8pSPKYvGV0LT1rtI2tpQy0uD1fOvi5rNLb1I52Jf09CK ShAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gmGQFKwW4Wm+iSt1F+HEkSwq58VNZGkLUx1Iw5bSIog=; b=TJk4Vxg5aduvPlVPgN63s26LK5Wan/fKDw01I7FZuCEs1S7vW7K4535rFdw1LOz3BN YBaagVUU7hb1mzXh3L5dC4AOVMgCThKEiV6l0Vfd2CS9L58nFRHmdMyxhPj7zvM0zOrT e4ho8bRswWTEC96fc789tiR7eMi4wHONtAWE1dhv6sP5HA5sO81HXJe1z5Xn4QVFeUCQ oSPUcEE7PBuq5iuAYd867Izdo98TQGE8bibxUeEigq4WqkVOAWhQDzoO96JHUXKTqc04 cM1Od+p48O84rnql2QFmm1VmGZ3OB4mmNC863QRzsfHrCS1EzhcT+EE4lZ+0NM656w10 +GIg== X-Gm-Message-State: APt69E3R8VzwlfsOqKCnbTu9Aig/d5OoO/QRcTWn9iQyvuTNaJTMMkV0 yXm8WNran5FxiGeaod+QJMU= X-Google-Smtp-Source: ADUXVKK7pK+XS0FknVSkKjroEApGTAqkk9eP8UkjuM293lkYC/BBCLapLKbZchoDpo7Kr5pVWmA7bA== X-Received: by 2002:ac8:32f3:: with SMTP id a48-v6mr24540559qtb.404.1528225639174; Tue, 05 Jun 2018 12:07:19 -0700 (PDT) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id o58-v6sm12917806qtb.88.2018.06.05.12.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 12:07:18 -0700 (PDT) Subject: Re: svn commit: r334617 - in head: . etc To: Konstantin Belousov , Brad Davis Cc: src-committers , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> From: Renato Botelho Message-ID: Date: Tue, 5 Jun 2018 16:07:14 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180605182605.GN2450@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:07:20 -0000 On 05/06/18 15:26, Konstantin Belousov wrote: > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: >>> I find it often very useful to do >>> (cd src/etc/rc.d && make install) >>> Same for defaults and several other directories which in fact contains >>> non-editable content. Is this planned to keep working ? >> >> The short answer is, no. All rc.d scripts get moved to the src of the program they start. >> >> That said, if there is a big need for this, we can see about options to keep them working. >> >> What are you trying to accomplish when you do this? Just verify the rc.d scripts match your src tree? > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binaries > provided by the project not for the user editing. > > When upgrading the host, esp. on HEAD, i usually refresh scripts by this > procedure and avoid any editing and implied conflict resolution for real > configs. > > Not being able to easily install clean copies of these scripts would > be very inconvenient and time consuming. If I understood what Brad is saying, each rc.d script will be installed by the application it belongs to. So when it's installing SSH it will also install /etc/rc.d/sshd and you will not need to deal with rc.d files on mergemaster anymore. Is it correct, Brad? -- Renato Botelho From owner-svn-src-head@freebsd.org Tue Jun 5 19:22:34 2018 Return-Path: Delivered-To: svn-src-head@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 9DD9EFF348A for ; Tue, 5 Jun 2018 19:22:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA216DA58 for ; Tue, 5 Jun 2018 19:22:33 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: NIPrG.0VM1kIdGAKOFinYYiUZnPIlS42DrskxScFRq3hNMp8T0ELy5hzYDmAyO3 h4JtjfnhsAvqJvNqQwRFL2O65RkDaliHfjbkNU9Km6JHnAuQslkhBujf6qvZ4H7TGDQhlt_vU1Xl I1bhz53AY0.zfO77HoL5egPKarDEgvl0Eb9D1S9ZuPaXLuWZL2tyrQRYmUNOXTTnAvyCYWKwgMJD Nq_kE.5.9mOAwgBtBbnOoNWFdQe16c0ljNoxOHi6BrV_41mrB0G908oCX1SYESfN.Vfd_1KbGq_K mFGnS5GFVEw05YUWANdg0Kd_vCpSzKtOG_6sgcUXk1QCCoii.b8qzq7uuBmeGazmp6_aFsza3DhE fMn6uqbXUv3ZwVBIIKCcBCt9iYVcJ0UmvydwN5wZP8jEfmt0BtjhCZoFLZyPFyrsrW6i3yXwwD9Y 4JzheZrhiJ5KkLQ4Yje8Pco_4iR3RlQwKgYhpXLU1UWwTX.TNwxD0UcYizKCXpwr9vky7B.anbUW 5Z0ncN7OQR1A41nDy_Qg4bxYRs.Y23YpzEnIWEEJkJ2m8r.dWeTVGJBMNrmpzP5P_cYqx_SsUnSB imB4fZyFF0wqR_nj25JBnfQ_dsT5ld0htduZ_mg_V_CngsZqBHxb8SqqH0Q9CnVyygQ26Ye2oKUX sCbTHA2deTIvuoDYT_PJQ1CQT.XDdB93Fwx6kghpq2p4UJjcNPq4SsKSRTwsdACLJFcmcj8j8nuw O9ggyJKc7Bht04wNpvZXTtmKJurQ49xtc5gR1M0AYK7530oJttEn9DFcdPplh2hjSmBdH5jSNsWA vK15ofTjO4gvBI3ISgt2uGNZP4lLMPePLb7X17mmTDl8Dp1ZN1C0M39NBfCzuP9tFyjvib4D5lxJ N1Tyl.iBuDM5u9Td7nsnATq.vCIoub7rSdJuMIdr0lVieBKd26DLIYqCvi6GTHoZ0UqkZ9VWm8XG 6QJY- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 5 Jun 2018 19:22:27 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp410.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2d247965ef310013e7a4fd69125e4972; Tue, 05 Jun 2018 19:22:22 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334647 - in head: . . . [this broke ci.freebsd.org's FreeBSD-head-amd64-gcc build but via an include/c++/v1/ problem] From: Mark Millard In-Reply-To: <39385E73-A75B-4E61-91D3-4CA86252AEDA@FreeBSD.org> Date: Tue, 5 Jun 2018 12:22:21 -0700 Cc: svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org, mmacy@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <317A4775-F397-4C54-9DE4-2FCD5E53D5B2@yahoo.com> References: <5D1C2920-2206-4602-BD2D-D1298E5D62EE@yahoo.com> <39385E73-A75B-4E61-91D3-4CA86252AEDA@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:22:34 -0000 On 2018-Jun-5, at 10:49 AM, Dimitry Andric wrote: > On 5 Jun 2018, at 15:03, Mark Millard via freebsd-toolchain = wrote: >>=20 >> https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/5974/consoleText = shows: >>=20 >> --- all_subdir_usr.sbin/pmc --- >> In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216:0,= >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, >> from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: >> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale: = At global scope: >> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 237:40: error: redundant redeclaration of 'void = std::__1::__throw_runtime_error(const char*)' in same scope = [-Werror=3Dredundant-decls] >> _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); >> ^~~~~~~~~~~~~~~~~~~~~ >> In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/memory:663= :0, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/algorithm:= 643, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__string:5= 6, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string_vie= w:176, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string:477= , >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 5, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216, >> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, >> from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: >> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/stdexcept:= 186:40: note: previous declaration of 'void = std::__1::__throw_runtime_error(const char*)' >> _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); >> ^~~~~~~~~~~~~~~~~~~~~ >>=20 >>=20 >> It looks like the new #include of iostream brings in code that gcc = rejected above: >>=20 >> --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 23:17:18 2018 = (r334645, copy source) >> +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Tue Jun 5 04:26:40 2018 = (r334647) >> @@ -68,11 +68,22 @@ __FBSDID("$FreeBSD$"); >> #include >> #include "cmd_pmc.h" >>=20 >> +#include >> . . . >=20 > I don't think anybody has yet tested building libc++ headers with the > combination of recent gcc, -Wsystem-headers, and -Werror. :) >=20 > For now, try disabling -Wredundant-decls. >=20 ci.freebsd.org 's FreeBSD-head-amd64-gcc #5973 ( -r334645 ) is the last build that worked. #5973 ( -r334647 ) is the first that failed. Maybe pmc forces -Werror and/or -Wredundant-decls since its new use of include is what seems to matter for the failure. But, prior to that additional include, FreeBSD-head-amd64-gcc was building fine on ci.freebsd.org . (I have no control over ci.freebsd.org builds, which is the context I reported the problem for.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jun 5 19:23:24 2018 Return-Path: Delivered-To: svn-src-head@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 63EC0FF351F; Tue, 5 Jun 2018 19:23:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0055A6DAC1; Tue, 5 Jun 2018 19:23:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D596C209DC; Tue, 5 Jun 2018 19:23:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55JNNoM058985; Tue, 5 Jun 2018 19:23:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55JNNO1058984; Tue, 5 Jun 2018 19:23:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806051923.w55JNNO1058984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 Jun 2018 19:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334667 - head/sys/dev/liquidio X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/dev/liquidio X-SVN-Commit-Revision: 334667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:23:24 -0000 Author: ae Date: Tue Jun 5 19:23:23 2018 New Revision: 334667 URL: https://svnweb.freebsd.org/changeset/base/334667 Log: tcp_lro.h requires , include it directly instead of indirect inclusion trough if_gif.h Modified: head/sys/dev/liquidio/lio_bsd.h Modified: head/sys/dev/liquidio/lio_bsd.h ============================================================================== --- head/sys/dev/liquidio/lio_bsd.h Tue Jun 5 18:27:09 2018 (r334666) +++ head/sys/dev/liquidio/lio_bsd.h Tue Jun 5 19:23:23 2018 (r334667) @@ -52,6 +52,7 @@ #include #include +#include #include #include From owner-svn-src-head@freebsd.org Tue Jun 5 19:29:02 2018 Return-Path: Delivered-To: svn-src-head@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 90909FF385B for ; Tue, 5 Jun 2018 19:29:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 DD0F06DF7C; Tue, 5 Jun 2018 19:29:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w55JSi5b072816; Tue, 5 Jun 2018 22:28:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w55JSi5b072816 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w55JSiJo072815; Tue, 5 Jun 2018 22:28:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jun 2018 22:28:44 +0300 From: Konstantin Belousov To: Eugene Grosbein Cc: Brad Davis , Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180605192844.GO2450@kib.kiev.ua> References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <5B16D8C4.10809@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5B16D8C4.10809@grosbein.net> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:29:02 -0000 On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > 06.06.2018 1:26, Konstantin Belousov wrote: > > >>> I find it often very useful to do > >>> (cd src/etc/rc.d && make install) > >>> Same for defaults and several other directories which in fact contains > >>> non-editable content. Is this planned to keep working ? > >> > >> The short answer is, no. All rc.d scripts get moved to the src of the program they start. > >> > >> That said, if there is a big need for this, we can see about options to keep them working. > >> > >> What are you trying to accomplish when you do this? Just verify the rc.d scripts match your src tree? > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binaries > > provided by the project not for the user editing. > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts by this > > procedure and avoid any editing and implied conflict resolution for real > > configs. > > > > Not being able to easily install clean copies of these scripts would > > be very inconvenient and time consuming. > > I found that "mergemaster -iFUP" deals with unchanged files including mentioned rc* scripts just fine. > That is, it automatically refreshes unchanged files without any silly questions just for change of $FreeBSD$. No, you missed the point. Whatever nice is the handling of unchanged files, use of mergemaster forces me to handle changed files, which is exactly what I do not want/need to do. Yes, I update crashboxes very often, and I want to get all new code, including the startup scripts, when I update. From owner-svn-src-head@freebsd.org Tue Jun 5 19:29:42 2018 Return-Path: Delivered-To: svn-src-head@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 98039FF38C0 for ; Tue, 5 Jun 2018 19:29:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-4.consmr.mail.bf2.yahoo.com (sonic301-4.consmr.mail.bf2.yahoo.com [74.6.129.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 326816E097 for ; Tue, 5 Jun 2018 19:29:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: iq2Z5BIVM1mZTHjZlc7nJmXqYkpCG1B9XtJF5XSeRytlNheUFrYDpLxmMRH_HLV iE_3pppNpEMxIW4vtIABnMIrz.DXd88ROHzC3OXaA7RDMrM6sMP.zq_JeE.I56KzWh449ORtRINH Ja9GdlulCW9AfUOjdfYkl3AvBDR12icuXhVft0jUs2QmHSC_aTDN4O8SkHDyx7adwb6XcfWIvG.O _0mc__A.no6M72jzYz0uRkO3awFT6ka7X_evwqqP9R851seGDjVADWn7m9vTJOZjaOHhhVhEflO_ QsuBAJZ8McNKPWMvwsBjBqfi3q.VXNCKcbwVS5nY1_ob8sAtKlO3VoaIucL9L7JjG4.ULccQ3k3x p.7vzh40Lv.LUDrA_zOZj9WhdU1lNDfUVFD6UzSf.UaFLzhCQ6fGLQYpeqIyMfUmBqlKRnofThmq 47u7mQjnUVkPH9j7YL6BhInFmpC.c1G1SUuNwqx.Wi0yAGVk5OPo1LcQIXNb0Z8aDukGHjtCnnXQ sF28ouqnklDhVb3dXqY3F1xmqI1Mxpv7cCKT.959aBk5w5F04sPyCNFmyeUfmWVRVmMnDC0OJSfQ WQvtfFvZO3HLOffsxKMEbkzhyT5o8_moI.S79_uEe5P6aE5Mwc7q8FY3.8GjFyYF0VmcAd0Fdjj0 KcLcvxEoWeBjlhU6fvXJ.rAGnVlY5mpNzuhQ6R4IKmy.OdlMI_64tdidFvVzB2yYWZMj048ygfIu 3VeTlIQ45SNo4mRnvabONbnJ3ntYZWMGy_gIIRSAEx5dZg0OeHvjBzOrHNsNqi85zzxImrnZafll oMTAr7BO5FgQyA0vEIxs5f60ZgozzFTP5KPWdaanLB_5PkgSm3XZmL158zYXtPZhT.1VQ5vBLuB1 3ovMBBHADzQvd9Bldj6ZGuo7dJ2LtoKe_Ao1eZjuHFcO_s_0VA9anVcepkKcdrxW_ti8mE6gSkex xmes- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Tue, 5 Jun 2018 19:29:36 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp429.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 18a102f98ad2ecbe943be09bf0f7dd00; Tue, 05 Jun 2018 19:29:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334647 - in head: . . . [this broke ci.freebsd.org's FreeBSD-head-amd64-gcc build but via an include/c++/v1/ problem] From: Mark Millard In-Reply-To: <317A4775-F397-4C54-9DE4-2FCD5E53D5B2@yahoo.com> Date: Tue, 5 Jun 2018 12:29:24 -0700 Cc: svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org, mmacy@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <8BFF241F-84C2-4C1F-86DC-3F9118A1ED7B@yahoo.com> References: <5D1C2920-2206-4602-BD2D-D1298E5D62EE@yahoo.com> <39385E73-A75B-4E61-91D3-4CA86252AEDA@FreeBSD.org> <317A4775-F397-4C54-9DE4-2FCD5E53D5B2@yahoo.com> To: Dimitry Andric X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:29:42 -0000 [Just fixing a dumb typo in a build number.] On 2018-Jun-5, at 12:22 PM, Mark Millard wrote: > On 2018-Jun-5, at 10:49 AM, Dimitry Andric wrote: >=20 >> On 5 Jun 2018, at 15:03, Mark Millard via freebsd-toolchain = wrote: >>>=20 >>> https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/5974/consoleText = shows: >>>=20 >>> --- all_subdir_usr.sbin/pmc --- >>> In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216:0,= >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, >>> from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: >>> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale: = At global scope: >>> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 237:40: error: redundant redeclaration of 'void = std::__1::__throw_runtime_error(const char*)' in same scope = [-Werror=3Dredundant-decls] >>> _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); >>> ^~~~~~~~~~~~~~~~~~~~~ >>> In file included from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/memory:663= :0, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/algorithm:= 643, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__string:5= 6, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string_vie= w:176, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/string:477= , >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/__locale:1= 5, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/ios:216, >>> from = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/iostream:3= 8, >>> from /workspace/src/usr.sbin/pmc/cmd_pmc_filter.cc:71: >>> = /workspace/obj/workspace/src/amd64.amd64/tmp/usr/include/c++/v1/stdexcept:= 186:40: note: previous declaration of 'void = std::__1::__throw_runtime_error(const char*)' >>> _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const = char*); >>> ^~~~~~~~~~~~~~~~~~~~~ >>>=20 >>>=20 >>> It looks like the new #include of iostream brings in code that gcc = rejected above: >>>=20 >>> --- head/usr.sbin/pmc/cmd_pmc_filter.c Mon Jun 4 23:17:18 2018 = (r334645, copy source) >>> +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Tue Jun 5 04:26:40 2018 = (r334647) >>> @@ -68,11 +68,22 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include "cmd_pmc.h" >>>=20 >>> +#include >>> . . . >>=20 >> I don't think anybody has yet tested building libc++ headers with the >> combination of recent gcc, -Wsystem-headers, and -Werror. :) >>=20 >> For now, try disabling -Wredundant-decls. >>=20 >=20 > ci.freebsd.org 's FreeBSD-head-amd64-gcc #5973 ( -r334645 ) is > the last build that worked. #5973 ( -r334647 ) is the first that > failed. Fixing the repeated build number (the 2nd should have been #5974 ) . . . #5973 ( -r334645 ) and a bunch before worked #5974 ( -r334647 ) and later failed (so far) > Maybe pmc forces -Werror and/or -Wredundant-decls since its new > use of include is what seems to matter for the failure. >=20 > But, prior to that additional include, FreeBSD-head-amd64-gcc was > building fine on ci.freebsd.org . >=20 >=20 > (I have no control over ci.freebsd.org builds, which is the > context I reported the problem for.) >=20 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jun 5 19:38:22 2018 Return-Path: Delivered-To: svn-src-head@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 D1CC2FF3CF9 for ; Tue, 5 Jun 2018 19:38:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 526CB6E6D6 for ; Tue, 5 Jun 2018 19:38:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w55Jc0AV047550 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 5 Jun 2018 21:38:01 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w55JbvZ6003170 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 6 Jun 2018 02:37:57 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Konstantin Belousov References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <5B16D8C4.10809@grosbein.net> <20180605192844.GO2450@kib.kiev.ua> Cc: Brad Davis , Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <5B16E690.4060406@grosbein.net> Date: Wed, 6 Jun 2018 02:37:52 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20180605192844.GO2450@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 19:38:23 -0000 06.06.2018 2:28, Konstantin Belousov wrote: >> I found that "mergemaster -iFUP" deals with unchanged files including mentioned rc* scripts just fine. >> That is, it automatically refreshes unchanged files without any silly questions just for change of $FreeBSD$. > > No, you missed the point. Whatever nice is the handling of unchanged files, > use of mergemaster forces me to handle changed files, which is exactly > what I do not want/need to do. Yes, I update crashboxes very often, and > I want to get all new code, including the startup scripts, when I update. "Changed" means "local copy changed by hands", not "changed in the repository". "mergemaster -iFUP" installs all new changes from the repo without questions for files untouched locally since last invocation of such mergemaster, so you get what you want :-) From owner-svn-src-head@freebsd.org Tue Jun 5 20:13:25 2018 Return-Path: Delivered-To: svn-src-head@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 4FB8BFF4BB6; Tue, 5 Jun 2018 20:13:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 027D36FD87; Tue, 5 Jun 2018 20:13:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7B0D211D7; Tue, 5 Jun 2018 20:13:24 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55KDOAq086040; Tue, 5 Jun 2018 20:13:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55KDOdt086039; Tue, 5 Jun 2018 20:13:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806052013.w55KDOdt086039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 5 Jun 2018 20:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334668 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 334668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:13:25 -0000 Author: asomers Date: Tue Jun 5 20:13:24 2018 New Revision: 334668 URL: https://svnweb.freebsd.org/changeset/base/334668 Log: audit(4): add tests for open(2) and openat(2) These syscalls are atypical, because each one corresponds to several different audit events, and they each pass several different audit class filters. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15657 Added: head/tests/sys/audit/open.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Tue Jun 5 19:23:23 2018 (r334667) +++ head/tests/sys/audit/Makefile Tue Jun 5 20:13:24 2018 (r334668) @@ -7,6 +7,7 @@ ATF_TESTS_C+= file-delete ATF_TESTS_C+= file-close ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read +ATF_TESTS_C+= open SRCS.file-create+= file-create.c SRCS.file-create+= utils.c @@ -18,6 +19,8 @@ SRCS.file-write+= file-write.c SRCS.file-write+= utils.c SRCS.file-read+= file-read.c SRCS.file-read+= utils.c +SRCS.open+= open.c +SRCS.open+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" Added: head/tests/sys/audit/open.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/open.c Tue Jun 5 20:13:24 2018 (r334668) @@ -0,0 +1,191 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Note: open(2) and openat(2) have 12 events each for various values of 'flag' + * Please see: contrib/openbsm/etc/audit_event#L261 + * + * 270:AUE_OPENAT_R:openat(2) - read:fr + * 271:AUE_OPENAT_RC:openat(2) - read,creat:fc,fr,fa,fm + * 272:AUE_OPENAT_RT:openat(2) - read,trunc:fd,fr,fa,fm + * 273:AUE_OPENAT_RTC:openat(2) - read,creat,trunc:fc,fd,fr,fa,fm + * 274:AUE_OPENAT_W:openat(2) - write:fw + * 275:AUE_OPENAT_WC:openat(2) - write,creat:fc,fw,fa,fm + * 276:AUE_OPENAT_WT:openat(2) - write,trunc:fd,fw,fa,fm + * 277:AUE_OPENAT_WTC:openat(2) - write,creat,trunc:fc,fd,fw,fa,fm + * 278:AUE_OPENAT_RW:openat(2) - read,write:fr,fw + * 279:AUE_OPENAT_RWC:openat(2) - read,write,create:fc,fw,fr,fa,fm + * 280:AUE_OPENAT_RWT:openat(2) - read,write,trunc:fd,fw,fr,fa,fm + * 281:AUE_OPENAT_RWTC:openat(2) - read,write,creat,trunc:fc,fd,fw,fr,fa,fm + */ + +#include + +#include +#include + +#include "utils.h" + +static struct pollfd fds[1]; +static mode_t o_mode = 0777; +static char extregex[80]; +static const char *path = "fileforaudit"; +static const char *errpath = "adirhasnoname/fileforaudit"; + +/* + * Define test-cases for success and failure modes of both open(2) and openat(2) + */ +#define OPEN_AT_TC_DEFINE(mode, regex, flag, class) \ +ATF_TC_WITH_CLEANUP(open_ ## mode ## _success); \ +ATF_TC_HEAD(open_ ## mode ## _success, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ + "open(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(open_ ## mode ## _success, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "open.*%s.*fileforaudit.*return,success", regex); \ + /* File needs to exist for successful open(2) invocation */ \ + ATF_REQUIRE(open(path, O_CREAT, o_mode) != -1); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE(syscall(SYS_open, path, flag) != -1); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(open_ ## mode ## _success, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(open_ ## mode ## _failure); \ +ATF_TC_HEAD(open_ ## mode ## _failure, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ + "open(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(open_ ## mode ## _failure, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "open.*%s.*fileforaudit.*return,failure", regex); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE_EQ(-1, syscall(SYS_open, errpath, flag)); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(open_ ## mode ## _failure, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(openat_ ## mode ## _success); \ +ATF_TC_HEAD(openat_ ## mode ## _success, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " \ + "openat(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(openat_ ## mode ## _success, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "openat.*%s.*fileforaudit.*return,success", regex); \ + /* File needs to exist for successful openat(2) invocation */ \ + ATF_REQUIRE(open(path, O_CREAT, o_mode) != -1); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE(openat(AT_FDCWD, path, flag) != -1); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(openat_ ## mode ## _success, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(openat_ ## mode ## _failure); \ +ATF_TC_HEAD(openat_ ## mode ## _failure, tc) \ +{ \ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " \ + "openat(2) call with flags = %s", #flag); \ +} \ +ATF_TC_BODY(openat_ ## mode ## _failure, tc) \ +{ \ + snprintf(extregex, sizeof(extregex), \ + "openat.*%s.*fileforaudit.*return,failure", regex); \ + FILE *pipefd = setup(fds, class); \ + ATF_REQUIRE_EQ(-1, openat(AT_FDCWD, errpath, flag)); \ + check_audit(fds, extregex, pipefd); \ +} \ +ATF_TC_CLEANUP(openat_ ## mode ## _failure, tc) \ +{ \ + cleanup(); \ +} + +/* + * Add both success and failure modes of open(2) and openat(2) + */ +#define OPEN_AT_TC_ADD(tp, mode) \ +do { \ + ATF_TP_ADD_TC(tp, open_ ## mode ## _success); \ + ATF_TP_ADD_TC(tp, open_ ## mode ## _failure); \ + ATF_TP_ADD_TC(tp, openat_ ## mode ## _success); \ + ATF_TP_ADD_TC(tp, openat_ ## mode ## _failure); \ +} while (0) + + +/* + * Each of the 12 OPEN_AT_TC_DEFINE statement is a group of 4 test-cases + * corresponding to separate audit events for open(2) and openat(2) + */ +OPEN_AT_TC_DEFINE(read, "read", O_RDONLY, "fr") +OPEN_AT_TC_DEFINE(read_creat, "read,creat", O_RDONLY | O_CREAT, "fr") +OPEN_AT_TC_DEFINE(read_trunc, "read,trunc", O_RDONLY | O_TRUNC, "fr") +OPEN_AT_TC_DEFINE(read_creat_trunc, "read,creat,trunc", O_RDONLY | O_CREAT + | O_TRUNC, "fr") +OPEN_AT_TC_DEFINE(write, "write", O_WRONLY, "fw") +OPEN_AT_TC_DEFINE(write_creat, "write,creat", O_WRONLY | O_CREAT, "fw") +OPEN_AT_TC_DEFINE(write_trunc, "write,trunc", O_WRONLY | O_TRUNC, "fw") +OPEN_AT_TC_DEFINE(write_creat_trunc, "write,creat,trunc", O_WRONLY | O_CREAT + | O_TRUNC, "fw") +OPEN_AT_TC_DEFINE(read_write, "read,write", O_RDWR, "fr") +OPEN_AT_TC_DEFINE(read_write_creat, "read,write,creat", O_RDWR | O_CREAT, "fw") +OPEN_AT_TC_DEFINE(read_write_trunc, "read,write,trunc", O_RDWR | O_TRUNC, "fr") +OPEN_AT_TC_DEFINE(read_write_creat_trunc, "read,write,creat,trunc", O_RDWR | + O_CREAT | O_TRUNC, "fw") + + +ATF_TP_ADD_TCS(tp) +{ + OPEN_AT_TC_ADD(tp, read); + OPEN_AT_TC_ADD(tp, read_creat); + OPEN_AT_TC_ADD(tp, read_trunc); + OPEN_AT_TC_ADD(tp, read_creat_trunc); + + OPEN_AT_TC_ADD(tp, write); + OPEN_AT_TC_ADD(tp, write_creat); + OPEN_AT_TC_ADD(tp, write_trunc); + OPEN_AT_TC_ADD(tp, write_creat_trunc); + + OPEN_AT_TC_ADD(tp, read_write); + OPEN_AT_TC_ADD(tp, read_write_creat); + OPEN_AT_TC_ADD(tp, read_write_trunc); + OPEN_AT_TC_ADD(tp, read_write_creat_trunc); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Tue Jun 5 20:34:12 2018 Return-Path: Delivered-To: svn-src-head@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 6C343FF57DA; Tue, 5 Jun 2018 20:34:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0904A70B8E; Tue, 5 Jun 2018 20:34:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8CF321515; Tue, 5 Jun 2018 20:34:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55KYBiU096419; Tue, 5 Jun 2018 20:34:11 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55KYBsb096418; Tue, 5 Jun 2018 20:34:11 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201806052034.w55KYBsb096418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 5 Jun 2018 20:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334669 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 334669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:34:12 -0000 Author: vangyzen Date: Tue Jun 5 20:34:11 2018 New Revision: 334669 URL: https://svnweb.freebsd.org/changeset/base/334669 Log: Make Coverity more happy with r334545 Coverity complains about: if (((flags) & M_WAITOK) || _malloc_item != NULL) saying: The expression 1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL is suspicious because it performs a Boolean operation on a constant other than 0 or 1. Although the code is correct, add "!= 0" to make it slightly more legible and to silence hundreds(?) of Coverity warnings. Reported by: Coverity Discussed with: mjg Sponsored by: Dell EMC Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Tue Jun 5 20:13:24 2018 (r334668) +++ head/sys/sys/malloc.h Tue Jun 5 20:34:11 2018 (r334669) @@ -191,9 +191,9 @@ void *malloc(size_t size, struct malloc_type *type, in void *_malloc_item; \ size_t _size = (size); \ if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ - ((flags) & M_ZERO)) { \ + ((flags) & M_ZERO) != 0) { \ _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ - if (((flags) & M_WAITOK) || _malloc_item != NULL) \ + if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) \ bzero(_malloc_item, _size); \ } else { \ _malloc_item = malloc(_size, type, flags); \ From owner-svn-src-head@freebsd.org Tue Jun 5 20:43:38 2018 Return-Path: Delivered-To: svn-src-head@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 4A79CFF5C14; Tue, 5 Jun 2018 20:43:38 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 C178E7118F; Tue, 5 Jun 2018 20:43:37 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2480C21C0F; Tue, 5 Jun 2018 16:43:37 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute5.internal (MEProxy); Tue, 05 Jun 2018 16:43:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=qiwbjw AhG6SG1ba6x8LmYLyrrNLkW0hYYDWizWBdHPk=; b=Y1Fz0rQh+wvXvPS9kATGv+ RdeJdvBCp1YUYToBTsmSGI09c899ozbxo3YZTm5NaamiuycikYoDJLqxvb3D415P V72+og++7b8kP6mBiDUCpDib9lP02IPkZjqKskKa0T05BKMTZPZ+aSrbRxWtwRAM jogDrj3nzoy5tcxQINIsjKCaKgKt8ftbEaQ6BaeUXxG7GIYrmrnUos4xP9ew+fFG qWATkfFRiRoN11zOFCIbTD5z5e+L/9HER+XjMAw9EBCbAgLiCWajlGVoAu6MVTOt ptxcu5L3wlJS/sRwxSGnlWiJK8kXZlqW4U987dk6Eax03PVQdVng49T/lHxpqgtA == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id EAC329E0DE; Tue, 5 Jun 2018 16:43:36 -0400 (EDT) Message-Id: <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> From: Brad Davis To: Renato Botelho , Konstantin Belousov Cc: "src-committers" , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea In-Reply-To: References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> Date: Tue, 05 Jun 2018 14:43:36 -0600 Subject: Re: svn commit: r334617 - in head: . etc Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:43:38 -0000 On Tue, Jun 5, 2018, at 1:07 PM, Renato Botelho wrote: > On 05/06/18 15:26, Konstantin Belousov wrote: > > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: > >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > >>> I find it often very useful to do > >>> (cd src/etc/rc.d && make install) > >>> Same for defaults and several other directories which in fact > >>> contains> >>> non-editable content. Is this planned to keep working ? > >> > >> The short answer is, no. All rc.d scripts get moved to the src of > >> the program they start.> >> > >> That said, if there is a big need for this, we can see about > >> options to keep them working.> >> > >> What are you trying to accomplish when you do this? Just verify > >> the rc.d scripts match your src tree?> > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > binaries> > provided by the project not for the user editing. > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > by this> > procedure and avoid any editing and implied conflict resolution > > for real> > configs. > > > > Not being able to easily install clean copies of these scripts would> > be very inconvenient and time consuming. > > If I understood what Brad is saying, each rc.d script will be > installed> by the application it belongs to. So when it's installing SSH it will> also install /etc/rc.d/sshd and you will not need to deal with rc.d > files on mergemaster anymore. > > Is it correct, Brad? Correct. Regards, Brad Davis From owner-svn-src-head@freebsd.org Tue Jun 5 20:44:50 2018 Return-Path: Delivered-To: svn-src-head@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 5CB57FF5CBA; Tue, 5 Jun 2018 20:44:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 0937471301; Tue, 5 Jun 2018 20:44:49 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A839321C0E; Tue, 5 Jun 2018 16:44:49 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute5.internal (MEProxy); Tue, 05 Jun 2018 16:44:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=OWarKX rTG9U7fkLLWxiSjaw8CGPRii8Z1TNCkONvo8E=; b=hWAja+PB4cSZ2W9kXOtTdC 6D8FY3Dwld0IeyvEGmarMz+jYPeYSCbIsMETSYaF7klTAFzcDDzc3z3+JXGheSCe wBpGIqUlNm0RprrNKujZJKf2ckZI367cIbjK72kxLiExkkmOjoB+R+iZdhCN2IJI U3x2ycRbnTbRDh9KSbXNFvog5D/wQs5SLHJpIMbZX7BkAFGEJa3nFOiJBhxMumMR nRjTWaUuXBMw+dIRBsUQQlwqOzJ+s9VtLUn9ICogway92ytyIVM7TMnEr4uBkXGO +xyAD78P3lVCTbmgV+4cww780b300wcyPD3JMcxmj58ngGojdbRT17NSNRyCi7sg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 4CD119E0DD; Tue, 5 Jun 2018 16:44:49 -0400 (EDT) Message-Id: <1528231489.2440725.1397620864.5987B9ED@webmail.messagingengine.com> From: Brad Davis To: Konstantin Belousov , Eugene Grosbein Cc: Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Date: Tue, 05 Jun 2018 14:44:49 -0600 References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <5B16D8C4.10809@grosbein.net> <20180605192844.GO2450@kib.kiev.ua> In-Reply-To: <20180605192844.GO2450@kib.kiev.ua> Subject: Re: svn commit: r334617 - in head: . etc Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:44:50 -0000 On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > >>> I find it often very useful to do > > >>> (cd src/etc/rc.d && make install) > > >>> Same for defaults and several other directories which in fact > > >>> contains> > >>> non-editable content. Is this planned to keep working ? > > >> > > >> The short answer is, no. All rc.d scripts get moved to the src > > >> of the program they start.> > >> > > >> That said, if there is a big need for this, we can see about > > >> options to keep them working.> > >> > > >> What are you trying to accomplish when you do this? Just verify > > >> the rc.d scripts match your src tree?> > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > binaries> > > provided by the project not for the user editing. > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > by this> > > procedure and avoid any editing and implied conflict resolution > > > for real> > > configs. > > > > > > Not being able to easily install clean copies of these scripts > > > would> > > be very inconvenient and time consuming. > > > > I found that "mergemaster -iFUP" deals with unchanged files > > including mentioned rc* scripts just fine.> > That is, it automatically refreshes unchanged files without any > > silly questions just for change of $FreeBSD$.> > No, you missed the point. Whatever nice is the handling of > unchanged files,> use of mergemaster forces me to handle changed files, which is exactly> what I do not want/need to do. Yes, I update crashboxes very > often, and> I want to get all new code, including the startup scripts, when > I update. The startup scripts will be installed as part of installworld. Regards, Brad Davis From owner-svn-src-head@freebsd.org Tue Jun 5 20:51:04 2018 Return-Path: Delivered-To: svn-src-head@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 EEDB1FF6037; Tue, 5 Jun 2018 20:51:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1852717D8; Tue, 5 Jun 2018 20:51:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83B08217C6; Tue, 5 Jun 2018 20:51:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55Kp3Xs003852; Tue, 5 Jun 2018 20:51:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55Kp2KB003843; Tue, 5 Jun 2018 20:51:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806052051.w55Kp2KB003843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 Jun 2018 20:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334671 - in head/sys: net netinet netinet6 netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netinet netinet6 netipsec X-SVN-Commit-Revision: 334671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:51:04 -0000 Author: ae Date: Tue Jun 5 20:51:01 2018 New Revision: 334671 URL: https://svnweb.freebsd.org/changeset/base/334671 Log: Rework IP encapsulation handling code. Currently it has several disadvantages: - it uses single mutex to protect internal structures. It is used by data- and control- path, thus there are no parallelism at all. - it uses single list to keep encap handlers for both INET and INET6 families. - struct encaptab keeps unneeded information (src, dst, masks, protosw), that isn't used by code in the source tree. - matches are prioritized and when many tunneling interfaces are registered, encapcheck handler of each interface is invoked for each packet. The search takes O(n) for n interfaces. All this work is done with exclusive lock held. What this patch includes: - the datapath is converted to be lockless using epoch(9) KPI. - struct encaptab now linked using CK_LIST. - all unused fields removed from struct encaptab. Several new fields addedr: min_length is the minimum packet length, that encapsulation handler expects to see; exact_match is maximum number of bits, that can return an encapsulation handler, when it wants to consume a packet. - IPv6 and IPv4 handlers are stored in separate lists; - added new "encap_lookup_t" method, that will be used later. It is targeted to speedup lookup of needed interface, when gif(4)/gre(4) have many interfaces. - the need to use protosw structure is eliminated. The only pr_input method was used from this structure, so I don't see the need to keep using it. - encap_input_t method changed to avoid using mbuf tags to store softc pointer. Now it is passed directly trough encap_input_t method. encap_getarg() funtions is removed. - all sockaddr structures and code that uses them removed. We don't have any code in the tree that uses them. All consumers use encap_attach_func() method, that relies on invoking of encapcheck() to determine the needed handler. - introduced struct encap_config, it contains parameters of encap handler that is going to be registered by encap_attach() function. - encap handlers are stored in lists ordered by exact_match value, thus handlers that need more bits to match will be checked first, and if encapcheck method returns exact_match value, the search will be stopped. - all current consumers changed to use new KPI. Reviewed by: mmacy Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D15617 Modified: head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/net/if_me.c head/sys/net/if_stf.c head/sys/netinet/in_gif.c head/sys/netinet/ip_encap.c head/sys/netinet/ip_encap.h head/sys/netinet/ip_gre.c head/sys/netinet/ip_mroute.c head/sys/netinet/pim_var.h head/sys/netinet6/in6_gif.c head/sys/netinet6/ip6_gre.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/pim6_var.h head/sys/netipsec/xform_ipcomp.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/net/if_gif.c Tue Jun 5 20:51:01 2018 (r334671) @@ -923,12 +923,24 @@ bad: } static void -gif_detach(struct gif_softc *sc) +gif_detach(struct gif_softc *sc, int family) { sx_assert(&gif_ioctl_sx, SA_XLOCKED); - if (sc->gif_ecookie != NULL) - encap_detach(sc->gif_ecookie); + if (sc->gif_ecookie != NULL) { + switch (family) { +#ifdef INET + case AF_INET: + ip_encap_detach(sc->gif_ecookie); + break; +#endif +#ifdef INET6 + case AF_INET6: + ip6_encap_detach(sc->gif_ecookie); + break; +#endif + } + } sc->gif_ecookie = NULL; } @@ -1020,7 +1032,7 @@ gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src } if (sc->gif_family != src->sa_family) - gif_detach(sc); + gif_detach(sc, sc->gif_family); if (sc->gif_family == 0 || sc->gif_family != src->sa_family) error = gif_attach(sc, src->sa_family); @@ -1058,7 +1070,7 @@ gif_delete_tunnel(struct ifnet *ifp) sc->gif_family = 0; GIF_WUNLOCK(sc); if (family != 0) { - gif_detach(sc); + gif_detach(sc, family); free(sc->gif_hdr, M_GIF); } ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/net/if_gre.c Tue Jun 5 20:51:01 2018 (r334671) @@ -551,12 +551,24 @@ gre_updatehdr(struct gre_softc *sc) } static void -gre_detach(struct gre_softc *sc) +gre_detach(struct gre_softc *sc, int family) { sx_assert(&gre_ioctl_sx, SA_XLOCKED); - if (sc->gre_ecookie != NULL) - encap_detach(sc->gre_ecookie); + if (sc->gre_ecookie != NULL) { + switch (family) { +#ifdef INET + case AF_INET: + ip_encap_detach(sc->gre_ecookie); + break; +#endif +#ifdef INET6 + case AF_INET6: + ip6_encap_detach(sc->gre_ecookie); + break; +#endif + } + } sc->gre_ecookie = NULL; } @@ -624,7 +636,7 @@ gre_set_tunnel(struct ifnet *ifp, struct sockaddr *src return (EAFNOSUPPORT); } if (sc->gre_family != 0) - gre_detach(sc); + gre_detach(sc, sc->gre_family); GRE_WLOCK(sc); if (sc->gre_family != 0) free(sc->gre_hdr, M_GRE); @@ -666,7 +678,7 @@ gre_delete_tunnel(struct ifnet *ifp) sc->gre_family = 0; GRE_WUNLOCK(sc); if (family != 0) { - gre_detach(sc); + gre_detach(sc, family); free(sc->gre_hdr, M_GRE); } ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -674,12 +686,11 @@ gre_delete_tunnel(struct ifnet *ifp) } int -gre_input(struct mbuf **mp, int *offp, int proto) +gre_input(struct mbuf *m, int off, int proto, void *arg) { - struct gre_softc *sc; + struct gre_softc *sc = arg; struct grehdr *gh; struct ifnet *ifp; - struct mbuf *m; uint32_t *opts; #ifdef notyet uint32_t key; @@ -687,12 +698,8 @@ gre_input(struct mbuf **mp, int *offp, int proto) uint16_t flags; int hlen, isr, af; - m = *mp; - sc = encap_getarg(m); - KASSERT(sc != NULL, ("encap_getarg returned NULL")); - ifp = GRE2IFP(sc); - hlen = *offp + sizeof(struct grehdr) + 4 * sizeof(uint32_t); + hlen = off + sizeof(struct grehdr) + 4 * sizeof(uint32_t); if (m->m_pkthdr.len < hlen) goto drop; if (m->m_len < hlen) { @@ -700,7 +707,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) if (m == NULL) goto drop; } - gh = (struct grehdr *)mtodo(m, *offp); + gh = (struct grehdr *)mtodo(m, off); flags = ntohs(gh->gre_flags); if (flags & ~GRE_FLAGS_MASK) goto drop; @@ -710,7 +717,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) /* reserved1 field must be zero */ if (((uint16_t *)opts)[1] != 0) goto drop; - if (in_cksum_skip(m, m->m_pkthdr.len, *offp) != 0) + if (in_cksum_skip(m, m->m_pkthdr.len, off) != 0) goto drop; hlen += 2 * sizeof(uint16_t); opts++; @@ -760,7 +767,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) default: goto drop; } - m_adj(m, *offp + hlen); + m_adj(m, off + hlen); m_clrprotoflags(m); m->m_pkthdr.rcvif = ifp; M_SETFIB(m, ifp->if_fib); Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/net/if_gre.h Tue Jun 5 20:51:01 2018 (r334671) @@ -101,7 +101,7 @@ struct gre_softc { #define gre_oip gre_gihdr->gi_ip #define gre_oip6 gre_gi6hdr->gi6_ip6 -int gre_input(struct mbuf **, int *, int); +int gre_input(struct mbuf *, int, int, void *); #ifdef INET int in_gre_attach(struct gre_softc *); int in_gre_output(struct mbuf *, int, int); Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/net/if_me.c Tue Jun 5 20:51:01 2018 (r334671) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -122,12 +121,23 @@ static int me_transmit(struct ifnet *, struct mbuf *); static int me_ioctl(struct ifnet *, u_long, caddr_t); static int me_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -static int me_input(struct mbuf **, int *, int); +static int me_input(struct mbuf *, int, int, void *); static int me_set_tunnel(struct ifnet *, struct sockaddr_in *, struct sockaddr_in *); static void me_delete_tunnel(struct ifnet *); +static int me_encapcheck(const struct mbuf *, int, int, void *); +#define ME_MINLEN (sizeof(struct ip) + sizeof(struct mobhdr) -\ + sizeof(in_addr_t)) +static const struct encap_config ipv4_encap_cfg = { + .proto = IPPROTO_MOBILE, + .min_length = ME_MINLEN, + .exact_match = (sizeof(in_addr_t) << 4) + 8, + .check = me_encapcheck, + .input = me_input +}; + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW, 0, "Minimal Encapsulation for IP (RFC 2004)"); @@ -140,19 +150,6 @@ static VNET_DEFINE(int, max_me_nesting) = MAX_ME_NEST; SYSCTL_INT(_net_link_me, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_me_nesting), 0, "Max nested tunnels"); -extern struct domain inetdomain; -static const struct protosw in_mobile_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_MOBILE, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = me_input, - .pr_output = rip_output, - .pr_ctlinput = rip_ctlinput, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; - static void vnet_me_init(const void *unused __unused) { @@ -334,17 +331,13 @@ me_encapcheck(const struct mbuf *m, int off, int proto M_ASSERTPKTHDR(m); - if (m->m_pkthdr.len < sizeof(struct ip) + sizeof(struct mobhdr) - - sizeof(struct in_addr)) - return (0); - ret = 0; ME_RLOCK(sc); if (ME_READY(sc)) { ip = mtod(m, struct ip *); if (sc->me_src.s_addr == ip->ip_dst.s_addr && sc->me_dst.s_addr == ip->ip_src.s_addr) - ret = 32 * 2; + ret = 32 * 2 + 8; } ME_RUNLOCK(sc); return (ret); @@ -376,8 +369,8 @@ me_set_tunnel(struct ifnet *ifp, struct sockaddr_in *s ME_WUNLOCK(sc); if (sc->me_ecookie == NULL) - sc->me_ecookie = encap_attach_func(AF_INET, IPPROTO_MOBILE, - me_encapcheck, &in_mobile_protosw, sc); + sc->me_ecookie = ip_encap_attach(&ipv4_encap_cfg, + sc, M_WAITOK); if (sc->me_ecookie != NULL) { ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); @@ -392,7 +385,7 @@ me_delete_tunnel(struct ifnet *ifp) sx_assert(&me_ioctl_sx, SA_XLOCKED); if (sc->me_ecookie != NULL) - encap_detach(sc->me_ecookie); + ip_encap_detach(sc->me_ecookie); sc->me_ecookie = NULL; ME_WLOCK(sc); sc->me_src.s_addr = 0; @@ -414,19 +407,14 @@ me_in_cksum(uint16_t *p, int nwords) return (~sum); } -int -me_input(struct mbuf **mp, int *offp, int proto) +static int +me_input(struct mbuf *m, int off, int proto, void *arg) { - struct me_softc *sc; + struct me_softc *sc = arg; struct mobhdr *mh; struct ifnet *ifp; - struct mbuf *m; struct ip *ip; int hlen; - - m = *mp; - sc = encap_getarg(m); - KASSERT(sc != NULL, ("encap_getarg returned NULL")); ifp = ME2IFP(sc); /* checks for short packets */ Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/net/if_stf.c Tue Jun 5 20:51:01 2018 (r334671) @@ -85,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -151,19 +150,7 @@ static const char stfname[] = "stf"; static MALLOC_DEFINE(M_STF, stfname, "6to4 Tunnel Interface"); static const int ip_stf_ttl = 40; -extern struct domain inetdomain; -static int in_stf_input(struct mbuf **, int *, int); -static struct protosw in_stf_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_IPV6, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = in_stf_input, - .pr_output = rip_output, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; - +static int in_stf_input(struct mbuf *, int, int, void *); static char *stfnames[] = {"stf0", "stf", "6to4", NULL}; static int stfmodevent(module_t, int, void *); @@ -183,6 +170,14 @@ static int stf_clone_create(struct if_clone *, char *, static int stf_clone_destroy(struct if_clone *, struct ifnet *); static struct if_clone *stf_cloner; +static const struct encap_config ipv4_encap_cfg = { + .proto = IPPROTO_IPV6, + .min_length = sizeof(struct ip), + .exact_match = (sizeof(in_addr_t) << 3) + 8, + .check = stf_encapcheck, + .input = in_stf_input +}; + static int stf_clone_match(struct if_clone *ifc, const char *name) { @@ -250,8 +245,7 @@ stf_clone_create(struct if_clone *ifc, char *name, siz ifp->if_dname = stfname; ifp->if_dunit = IF_DUNIT_NONE; - sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, - stf_encapcheck, &in_stf_protosw, sc); + sc->encap_cookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); if (sc->encap_cookie == NULL) { if_printf(ifp, "attach failed\n"); free(sc, M_STF); @@ -274,7 +268,7 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet * struct stf_softc *sc = ifp->if_softc; int err __unused; - err = encap_detach(sc->encap_cookie); + err = ip_encap_detach(sc->encap_cookie); KASSERT(err == 0, ("Unexpected error detaching encap_cookie")); bpfdetach(ifp); if_detach(ifp); @@ -608,28 +602,20 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr * } static int -in_stf_input(struct mbuf **mp, int *offp, int proto) +in_stf_input(struct mbuf *m, int off, int proto, void *arg) { - struct stf_softc *sc; + struct stf_softc *sc = arg; struct ip *ip; struct ip6_hdr *ip6; - struct mbuf *m; u_int8_t otos, itos; struct ifnet *ifp; - int off; - m = *mp; - off = *offp; - if (proto != IPPROTO_IPV6) { m_freem(m); return (IPPROTO_DONE); } ip = mtod(m, struct ip *); - - sc = (struct stf_softc *)encap_getarg(m); - if (sc == NULL || (STF2IFP(sc)->if_flags & IFF_UP) == 0) { m_freem(m); return (IPPROTO_DONE); @@ -680,7 +666,7 @@ in_stf_input(struct mbuf **mp, int *offp, int proto) ip6->ip6_flow |= htonl((u_int32_t)itos << 20); m->m_pkthdr.rcvif = ifp; - + if (bpf_peers_present(ifp->if_bpf)) { /* * We need to prepend the address family as Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/netinet/in_gif.c Tue Jun 5 20:51:01 2018 (r334671) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -70,25 +69,11 @@ __FBSDID("$FreeBSD$"); #include -static int in_gif_input(struct mbuf **, int *, int); - -extern struct domain inetdomain; -static struct protosw in_gif_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = 0/* IPPROTO_IPV[46] */, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = in_gif_input, - .pr_output = rip_output, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; - #define GIF_TTL 30 static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; #define V_ip_gif_ttl VNET(ip_gif_ttl) SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip_gif_ttl), 0, ""); + &VNET_NAME(ip_gif_ttl), 0, "Default TTL value for encapsulated packets"); int in_gif_output(struct ifnet *ifp, struct mbuf *m, int proto, uint8_t ecn) @@ -136,15 +121,13 @@ in_gif_output(struct ifnet *ifp, struct mbuf *m, int p } static int -in_gif_input(struct mbuf **mp, int *offp, int proto) +in_gif_input(struct mbuf *m, int off, int proto, void *arg) { - struct mbuf *m = *mp; - struct gif_softc *sc; + struct gif_softc *sc = arg; struct ifnet *gifp; struct ip *ip; uint8_t ecn; - sc = encap_getarg(m); if (sc == NULL) { m_freem(m); KMOD_IPSTAT_INC(ips_nogif); @@ -154,7 +137,7 @@ in_gif_input(struct mbuf **mp, int *offp, int proto) if ((gifp->if_flags & IFF_UP) != 0) { ip = mtod(m, struct ip *); ecn = ip->ip_tos; - m_adj(m, *offp); + m_adj(m, off); gif_input(m, gifp, proto, ecn); } else { m_freem(m); @@ -182,7 +165,7 @@ in_gif_encapcheck(const struct mbuf *m, int off, int p ip = mtod(m, const struct ip *); if (sc->gif_iphdr->ip_src.s_addr != ip->ip_dst.s_addr) return (0); - ret = 32; + ret = 32 + 8; /* src + proto */ if (sc->gif_iphdr->ip_dst.s_addr != ip->ip_src.s_addr) { if ((sc->gif_options & GIF_IGNORE_SOURCE) == 0) return (0); @@ -205,14 +188,19 @@ in_gif_encapcheck(const struct mbuf *m, int off, int p return (ret); } +static const struct encap_config ipv4_encap_cfg = { + .proto = -1, + .min_length = sizeof(struct ip), + .exact_match = (sizeof(in_addr_t) << 4) + 8, + .check = gif_encapcheck, + .input = in_gif_input +}; + int in_gif_attach(struct gif_softc *sc) { KASSERT(sc->gif_ecookie == NULL, ("gif_ecookie isn't NULL")); - sc->gif_ecookie = encap_attach_func(AF_INET, -1, gif_encapcheck, - &in_gif_protosw, sc); - if (sc->gif_ecookie == NULL) - return (EEXIST); + sc->gif_ecookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); return (0); } Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Tue Jun 5 20:41:06 2018 (r334670) +++ head/sys/netinet/ip_encap.c Tue Jun 5 20:51:01 2018 (r334671) @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * Copyright (c) 2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,417 +57,214 @@ * So, clearly good old protosw does not work for protocol #4 and #41. * The code will let you match protocol via src/dst address pair. */ -/* XXX is M_NETADDR correct? */ #include __FBSDID("$FreeBSD$"); -#include "opt_mrouting.h" #include "opt_inet.h" #include "opt_inet6.h" #include #include +#include #include +#include #include -#include -#include #include #include -#include -#include +#include #include -#include +#include #include -#include -#include #include #include #ifdef INET6 -#include #include #endif -#include +static MALLOC_DEFINE(M_NETADDR, "encap_export_host", + "Export host address structure"); -#include -#include -static MALLOC_DEFINE(M_NETADDR, "encap_export_host", "Export host address structure"); +struct encaptab { + CK_LIST_ENTRY(encaptab) chain; + int proto; + int min_length; + int exact_match; + void *arg; -static void encap_add(struct encaptab *); -static int mask_match(const struct encaptab *, const struct sockaddr *, - const struct sockaddr *); -static void encap_fillarg(struct mbuf *, void *); + encap_lookup_t lookup; + encap_check_t check; + encap_input_t input; +}; -/* - * All global variables in ip_encap.c are locked using encapmtx. - */ +CK_LIST_HEAD(encaptab_head, encaptab); +#ifdef INET +static struct encaptab_head ipv4_encaptab = CK_LIST_HEAD_INITIALIZER(); +#endif +#ifdef INET6 +static struct encaptab_head ipv6_encaptab = CK_LIST_HEAD_INITIALIZER(); +#endif + static struct mtx encapmtx; MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); -static LIST_HEAD(, encaptab) encaptab = LIST_HEAD_INITIALIZER(encaptab); +#define ENCAP_WLOCK() mtx_lock(&encapmtx) +#define ENCAP_WUNLOCK() mtx_unlock(&encapmtx) +#define ENCAP_RLOCK() epoch_enter_preempt(net_epoch_preempt) +#define ENCAP_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define ENCAP_WAIT() epoch_wait_preempt(net_epoch_preempt) -#ifdef INET -int -encap4_input(struct mbuf **mp, int *offp, int proto) +static struct encaptab * +encap_attach(struct encaptab_head *head, const struct encap_config *cfg, + void *arg, int mflags) { - struct ip *ip; - struct mbuf *m; - struct sockaddr_in s, d; - const struct protosw *psw; - struct encaptab *ep, *match; - void *arg; - int matchprio, off, prio; + struct encaptab *ep, *tmp; - m = *mp; - off = *offp; - ip = mtod(m, struct ip *); + if (cfg == NULL || cfg->input == NULL || + (cfg->check == NULL && cfg->lookup == NULL) || + (cfg->lookup != NULL && cfg->exact_match != ENCAP_DRV_LOOKUP) || + (cfg->exact_match == ENCAP_DRV_LOOKUP && cfg->lookup == NULL)) + return (NULL); - bzero(&s, sizeof(s)); - s.sin_family = AF_INET; - s.sin_len = sizeof(struct sockaddr_in); - s.sin_addr = ip->ip_src; - bzero(&d, sizeof(d)); - d.sin_family = AF_INET; - d.sin_len = sizeof(struct sockaddr_in); - d.sin_addr = ip->ip_dst; + ep = malloc(sizeof(*ep), M_NETADDR, mflags); + if (ep == NULL) + return (NULL); - arg = NULL; - psw = NULL; - match = NULL; - matchprio = 0; - mtx_lock(&encapmtx); - LIST_FOREACH(ep, &encaptab, chain) { - if (ep->af != AF_INET) - continue; - if (ep->proto >= 0 && ep->proto != proto) - continue; - if (ep->func) - prio = (*ep->func)(m, off, proto, ep->arg); - else { - /* - * it's inbound traffic, we need to match in reverse - * order - */ - prio = mask_match(ep, (struct sockaddr *)&d, - (struct sockaddr *)&s); - } + ep->proto = cfg->proto; + ep->min_length = cfg->min_length; + ep->exact_match = cfg->exact_match; + ep->arg = arg; + ep->lookup = cfg->exact_match == ENCAP_DRV_LOOKUP ? cfg->lookup: NULL; + ep->check = cfg->exact_match != ENCAP_DRV_LOOKUP ? cfg->check: NULL; + ep->input = cfg->input; - /* - * We prioritize the matches by using bit length of the - * matches. mask_match() and user-supplied matching function - * should return the bit length of the matches (for example, - * if both src/dst are matched for IPv4, 64 should be returned). - * 0 or negative return value means "it did not match". - * - * The question is, since we have two "mask" portion, we - * cannot really define total order between entries. - * For example, which of these should be preferred? - * mask_match() returns 48 (32 + 16) for both of them. - * src=3ffe::/16, dst=3ffe:501::/32 - * src=3ffe:501::/32, dst=3ffe::/16 - * - * We need to loop through all the possible candidates - * to get the best match - the search takes O(n) for - * n attachments (i.e. interfaces). - */ - if (prio <= 0) - continue; - if (prio > matchprio) { - matchprio = prio; - match = ep; - } + ENCAP_WLOCK(); + CK_LIST_FOREACH(tmp, head, chain) { + if (tmp->exact_match <= ep->exact_match) + break; } - if (match != NULL) { - psw = match->psw; - arg = match->arg; - } - mtx_unlock(&encapmtx); + if (tmp == NULL) + CK_LIST_INSERT_HEAD(head, ep, chain); + else + CK_LIST_INSERT_BEFORE(tmp, ep, chain); + ENCAP_WUNLOCK(); + return (ep); +} - if (match != NULL) { - /* found a match, "match" has the best one */ - if (psw != NULL && psw->pr_input != NULL) { - encap_fillarg(m, arg); - (*psw->pr_input)(mp, offp, proto); - } else - m_freem(m); - return (IPPROTO_DONE); - } +static int +encap_detach(struct encaptab_head *head, const struct encaptab *cookie) +{ + struct encaptab *ep; - /* last resort: inject to raw socket */ - return (rip_input(mp, offp, proto)); + ENCAP_WLOCK(); + CK_LIST_FOREACH(ep, head, chain) { + if (ep == cookie) { + CK_LIST_REMOVE(ep, chain); + ENCAP_WUNLOCK(); + ENCAP_WAIT(); + free(ep, M_NETADDR); + return (0); + } + } + ENCAP_WUNLOCK(); + return (EINVAL); } -#endif -#ifdef INET6 -int -encap6_input(struct mbuf **mp, int *offp, int proto) +static int +encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) { - struct mbuf *m = *mp; - struct ip6_hdr *ip6; - struct sockaddr_in6 s, d; - const struct protosw *psw; struct encaptab *ep, *match; void *arg; - int prio, matchprio; + int matchprio, ret; - ip6 = mtod(m, struct ip6_hdr *); - - bzero(&s, sizeof(s)); - s.sin6_family = AF_INET6; - s.sin6_len = sizeof(struct sockaddr_in6); - s.sin6_addr = ip6->ip6_src; - bzero(&d, sizeof(d)); - d.sin6_family = AF_INET6; - d.sin6_len = sizeof(struct sockaddr_in6); - d.sin6_addr = ip6->ip6_dst; - - arg = NULL; - psw = NULL; match = NULL; matchprio = 0; - mtx_lock(&encapmtx); - LIST_FOREACH(ep, &encaptab, chain) { - if (ep->af != AF_INET6) - continue; + + ENCAP_RLOCK(); + CK_LIST_FOREACH(ep, head, chain) { if (ep->proto >= 0 && ep->proto != proto) continue; - if (ep->func) - prio = (*ep->func)(m, *offp, proto, ep->arg); - else { + if (ep->min_length > m->m_pkthdr.len) + continue; + if (ep->exact_match == ENCAP_DRV_LOOKUP) + ret = (*ep->lookup)(m, off, proto, &arg); + else + ret = (*ep->check)(m, off, proto, ep->arg); + if (ret <= 0) + continue; + if (ret > matchprio) { + match = ep; + if (ep->exact_match != ENCAP_DRV_LOOKUP) + arg = ep->arg; /* - * it's inbound traffic, we need to match in reverse - * order + * No need to continue the search, we got the + * exact match. */ - prio = mask_match(ep, (struct sockaddr *)&d, - (struct sockaddr *)&s); + if (ret >= ep->exact_match) + break; + matchprio = ret; } - - /* see encap4_input() for issues here */ - if (prio <= 0) - continue; - if (prio > matchprio) { - matchprio = prio; - match = ep; - } } - if (match != NULL) { - psw = match->psw; - arg = match->arg; - } - mtx_unlock(&encapmtx); if (match != NULL) { - /* found a match */ - if (psw != NULL && psw->pr_input != NULL) { - encap_fillarg(m, arg); - return (*psw->pr_input)(mp, offp, proto); - } else { - m_freem(m); - return (IPPROTO_DONE); - } + /* found a match, "match" has the best one */ + ret = (*match->input)(m, off, proto, arg); + ENCAP_RUNLOCK(); + MPASS(ret == IPPROTO_DONE); + return (IPPROTO_DONE); } - - /* last resort: inject to raw socket */ - return rip6_input(mp, offp, proto); + ENCAP_RUNLOCK(); + return (0); } -#endif -/*lint -sem(encap_add, custodial(1)) */ -static void -encap_add(struct encaptab *ep) -{ - - mtx_assert(&encapmtx, MA_OWNED); - LIST_INSERT_HEAD(&encaptab, ep, chain); -} - -/* - * sp (src ptr) is always my side, and dp (dst ptr) is always remote side. - * length of mask (sm and dm) is assumed to be same as sp/dp. - * Return value will be necessary as input (cookie) for encap_detach(). - */ +#ifdef INET const struct encaptab * -encap_attach(int af, int proto, const struct sockaddr *sp, - const struct sockaddr *sm, const struct sockaddr *dp, - const struct sockaddr *dm, const struct protosw *psw, void *arg) +ip_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { - struct encaptab *ep; - /* sanity check on args */ - if (sp->sa_len > sizeof(ep->src) || dp->sa_len > sizeof(ep->dst)) - return (NULL); - if (sp->sa_len != dp->sa_len) - return (NULL); - if (af != sp->sa_family || af != dp->sa_family) - return (NULL); - - /* check if anyone have already attached with exactly same config */ - mtx_lock(&encapmtx); - LIST_FOREACH(ep, &encaptab, chain) { - if (ep->af != af) - continue; - if (ep->proto != proto) - continue; - if (ep->src.ss_len != sp->sa_len || - bcmp(&ep->src, sp, sp->sa_len) != 0 || - bcmp(&ep->srcmask, sm, sp->sa_len) != 0) - continue; - if (ep->dst.ss_len != dp->sa_len || - bcmp(&ep->dst, dp, dp->sa_len) != 0 || - bcmp(&ep->dstmask, dm, dp->sa_len) != 0) - continue; - - mtx_unlock(&encapmtx); - return (NULL); - } - - ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/ - if (ep == NULL) { - mtx_unlock(&encapmtx); - return (NULL); - } - bzero(ep, sizeof(*ep)); - - ep->af = af; - ep->proto = proto; - bcopy(sp, &ep->src, sp->sa_len); - bcopy(sm, &ep->srcmask, sp->sa_len); - bcopy(dp, &ep->dst, dp->sa_len); - bcopy(dm, &ep->dstmask, dp->sa_len); - ep->psw = psw; - ep->arg = arg; - - encap_add(ep); - mtx_unlock(&encapmtx); - return (ep); + return (encap_attach(&ipv4_encaptab, cfg, arg, mflags)); } -const struct encaptab * -encap_attach_func(int af, int proto, - int (*func)(const struct mbuf *, int, int, void *), - const struct protosw *psw, void *arg) +int +ip_encap_detach(const struct encaptab *cookie) { - struct encaptab *ep; - /* sanity check on args */ - if (!func) - return (NULL); - - ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/ - if (ep == NULL) - return (NULL); - bzero(ep, sizeof(*ep)); - - ep->af = af; - ep->proto = proto; - ep->func = func; - ep->psw = psw; - ep->arg = arg; - - mtx_lock(&encapmtx); - encap_add(ep); - mtx_unlock(&encapmtx); - return (ep); + return (encap_detach(&ipv4_encaptab, cookie)); } int -encap_detach(const struct encaptab *cookie) +encap4_input(struct mbuf **mp, int *offp, int proto) { - const struct encaptab *ep = cookie; - struct encaptab *p; - mtx_lock(&encapmtx); - LIST_FOREACH(p, &encaptab, chain) { - if (p == ep) { - LIST_REMOVE(p, chain); - mtx_unlock(&encapmtx); - free(p, M_NETADDR); /*XXX*/ - return 0; - } - } - mtx_unlock(&encapmtx); - - return EINVAL; + if (encap_input(&ipv4_encaptab, *mp, *offp, proto) != IPPROTO_DONE) + return (rip_input(mp, offp, proto)); + return (IPPROTO_DONE); } +#endif /* INET */ -static int -mask_match(const struct encaptab *ep, const struct sockaddr *sp, - const struct sockaddr *dp) +#ifdef INET6 +const struct encaptab * +ip6_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { - struct sockaddr_storage s; - struct sockaddr_storage d; - int i; - const u_int8_t *p, *q; - u_int8_t *r; - int matchlen; - if (sp->sa_len > sizeof(s) || dp->sa_len > sizeof(d)) - return 0; - if (sp->sa_family != ep->af || dp->sa_family != ep->af) - return 0; - if (sp->sa_len != ep->src.ss_len || dp->sa_len != ep->dst.ss_len) - return 0; - - matchlen = 0; - - p = (const u_int8_t *)sp; - q = (const u_int8_t *)&ep->srcmask; - r = (u_int8_t *)&s; - for (i = 0 ; i < sp->sa_len; i++) { - r[i] = p[i] & q[i]; - /* XXX estimate */ - matchlen += (q[i] ? 8 : 0); - } - - p = (const u_int8_t *)dp; - q = (const u_int8_t *)&ep->dstmask; - r = (u_int8_t *)&d; - for (i = 0 ; i < dp->sa_len; i++) { - r[i] = p[i] & q[i]; - /* XXX rough estimate */ - matchlen += (q[i] ? 8 : 0); - } - - /* need to overwrite len/family portion as we don't compare them */ - s.ss_len = sp->sa_len; - s.ss_family = sp->sa_family; - d.ss_len = dp->sa_len; - d.ss_family = dp->sa_family; - - if (bcmp(&s, &ep->src, ep->src.ss_len) == 0 && - bcmp(&d, &ep->dst, ep->dst.ss_len) == 0) { - return matchlen; - } else - return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jun 5 20:53:27 2018 Return-Path: Delivered-To: svn-src-head@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 DB951FF62F2 for ; Tue, 5 Jun 2018 20:53:27 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 68FCF71CA1 for ; Tue, 5 Jun 2018 20:53:27 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 7d5428ed-6902-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 7d5428ed-6902-11e8-8837-614b7c574d04; Tue, 05 Jun 2018 20:53:25 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w55KrONe038840; Tue, 5 Jun 2018 14:53:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528232004.63685.25.camel@freebsd.org> Subject: Re: svn commit: r334669 - head/sys/sys From: Ian Lepore To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jun 2018 14:53:24 -0600 In-Reply-To: <201806052034.w55KYBsb096418@repo.freebsd.org> References: <201806052034.w55KYBsb096418@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:53:28 -0000 On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote: > Author: vangyzen > Date: Tue Jun  5 20:34:11 2018 > New Revision: 334669 > URL: https://svnweb.freebsd.org/changeset/base/334669 > > Log: >   Make Coverity more happy with r334545 >    >   Coverity complains about: >    >    if (((flags) & M_WAITOK) || _malloc_item != NULL) >    >   saying: >    >    The expression >    1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL >    is suspicious because it performs a Boolean operation >    on a constant other than 0 or 1. >    >   Although the code is correct, add "!= 0" to make it slightly >   more legible and to silence hundreds(?) of Coverity warnings. >    This is a sad sad thing. Treating (bits & flagconstants) as boolean has a long long history in C. Surely there are literally thousand of occurrances in freebsd code already, so why did this one get flagged? -- Ian From owner-svn-src-head@freebsd.org Tue Jun 5 20:54:30 2018 Return-Path: Delivered-To: svn-src-head@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 9AFACFF63B6; Tue, 5 Jun 2018 20:54:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B38F71E1C; Tue, 5 Jun 2018 20:54:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C69821856; Tue, 5 Jun 2018 20:54:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55KsUGJ006897; Tue, 5 Jun 2018 20:54:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55KsTt5006895; Tue, 5 Jun 2018 20:54:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806052054.w55KsTt5006895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 Jun 2018 20:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334672 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 334672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 20:54:30 -0000 Author: ae Date: Tue Jun 5 20:54:29 2018 New Revision: 334672 URL: https://svnweb.freebsd.org/changeset/base/334672 Log: Constify argument of in6_getscope(). Modified: head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Tue Jun 5 20:51:01 2018 (r334671) +++ head/sys/netinet6/scope6.c Tue Jun 5 20:54:29 2018 (r334672) @@ -453,7 +453,7 @@ in6_clearscope(struct in6_addr *in6) * Return the scope identifier or zero. */ uint16_t -in6_getscope(struct in6_addr *in6) +in6_getscope(const struct in6_addr *in6) { if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) Modified: head/sys/netinet6/scope6_var.h ============================================================================== --- head/sys/netinet6/scope6_var.h Tue Jun 5 20:51:01 2018 (r334671) +++ head/sys/netinet6/scope6_var.h Tue Jun 5 20:54:29 2018 (r334672) @@ -63,7 +63,7 @@ int sa6_checkzone(struct sockaddr_in6 *); int sa6_checkzone_ifp(struct ifnet *, struct sockaddr_in6 *); int in6_setscope(struct in6_addr *, struct ifnet *, u_int32_t *); int in6_clearscope(struct in6_addr *); -uint16_t in6_getscope(struct in6_addr *); +uint16_t in6_getscope(const struct in6_addr *); uint32_t in6_getscopezone(const struct ifnet *, int); void in6_splitscope(const struct in6_addr *, struct in6_addr *, uint32_t *); struct ifnet* in6_getlinkifnet(uint32_t); From owner-svn-src-head@freebsd.org Tue Jun 5 21:00:51 2018 Return-Path: Delivered-To: svn-src-head@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 49C49FF689D; Tue, 5 Jun 2018 21:00:51 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id D4CFC723CA; Tue, 5 Jun 2018 21:00:50 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 165FE14886; Tue, 5 Jun 2018 21:00:49 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w55L0nrf033375 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Jun 2018 21:00:49 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w55L0nVb033374; Tue, 5 Jun 2018 21:00:49 GMT (envelope-from phk) To: Ian Lepore cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334669 - head/sys/sys In-reply-to: <1528232004.63685.25.camel@freebsd.org> From: "Poul-Henning Kamp" References: <201806052034.w55KYBsb096418@repo.freebsd.org> <1528232004.63685.25.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <33372.1528232449.1@critter.freebsd.dk> Date: Tue, 05 Jun 2018 21:00:49 +0000 Message-ID: <33373.1528232449@critter.freebsd.dk> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 21:00:51 -0000 -------- In message <1528232004.63685.25.camel@freebsd.org>, Ian Lepore writes: >On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote: >> (((flags) & M_WAITOK) || _malloc_item != NULL) > >This is a sad sad thing. Treating (bits & flagconstants) as boolean has >a long long history in C. Surely there are literally thousand of >occurrances in freebsd code already, so why did this one get flagged? FlexeLint also gets its knickers in a twist about this kind of construct and as far as I can tell the origin of that particular interpretation comes out of the MISRA C rules. In FlexeLint that specific check can be disabled, and I would imagine Coverity has a similar tweakable setting. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@freebsd.org Tue Jun 5 21:07:22 2018 Return-Path: Delivered-To: svn-src-head@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 6266CFF6DE7; Tue, 5 Jun 2018 21:07:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 0D22C72C5A; Tue, 5 Jun 2018 21:07:21 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 6C4185646B; Tue, 5 Jun 2018 16:07:20 -0500 (CDT) Subject: Re: svn commit: r334669 - head/sys/sys To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806052034.w55KYBsb096418@repo.freebsd.org> <1528232004.63685.25.camel@freebsd.org> From: Eric van Gyzen Openpgp: preference=signencrypt Message-ID: Date: Tue, 5 Jun 2018 16:07:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1528232004.63685.25.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 21:07:22 -0000 On 06/05/2018 15:53, Ian Lepore wrote: > On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote: >> Author: vangyzen >> Date: Tue Jun  5 20:34:11 2018 >> New Revision: 334669 >> URL: https://svnweb.freebsd.org/changeset/base/334669 >> >> Log: >>   Make Coverity more happy with r334545 >>    >>   Coverity complains about: >>    >>    if (((flags) & M_WAITOK) || _malloc_item != NULL) >>    >>   saying: >>    >>    The expression >>    1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL >>    is suspicious because it performs a Boolean operation >>    on a constant other than 0 or 1. >>    >>   Although the code is correct, add "!= 0" to make it slightly >>   more legible and to silence hundreds(?) of Coverity warnings. >>    > > This is a sad sad thing. Treating (bits & flagconstants) as boolean has > a long long history in C. Surely there are literally thousand of > occurrances in freebsd code already, so why did this one get flagged? I agree, and I tend to avoid adding "!= 0" unnecessarily, but I don't feel very strongly about it. This macro is expanded in many locations, so the number of Coverity warnings increased by hundreds in the most recent run. I care about that more than avoiding "!= 0". I don't sprinkle crap all over the code just to appease Coverity, but this one seemed perfectly reasonable. It makes the code slightly more clear and legible for some readers, and I imagine it doesn't hurt the others. Yes, there are probably many old occurrences of this, and there might be many old corresponding warnings, but I tend to focus on the recently added ones, just because they're more likely relevant. /me opens the static analysis can of worms...again Eric From owner-svn-src-head@freebsd.org Tue Jun 5 21:25:01 2018 Return-Path: Delivered-To: svn-src-head@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 6F6EBFF77D6; Tue, 5 Jun 2018 21:25:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1B473D60; Tue, 5 Jun 2018 21:25:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED4C721D1F; Tue, 5 Jun 2018 21:25:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55LP0p5021989; Tue, 5 Jun 2018 21:25:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55LP0j4021984; Tue, 5 Jun 2018 21:25:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806052125.w55LP0j4021984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 Jun 2018 21:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334673 - in head: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 334673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 21:25:01 -0000 Author: ae Date: Tue Jun 5 21:24:59 2018 New Revision: 334673 URL: https://svnweb.freebsd.org/changeset/base/334673 Log: Rework if_gif(4) to use new encap_lookup_t method to speedup lookup of needed interface when many gif interfaces are present. Remove rmlock from gif_softc, use epoch(9) and CK_LIST instead. Move more AF-related code into AF-related locations. Use hash table to speedup lookup of needed softc. Interfaces with GIF_IGNORE_SOURCE flag are stored in plain CK_LIST. Sysctl net.link.gif.parallel_tunnels is removed. The removal was planed 16 years ago, and actually it could work only for outbound direction. Each protocol, that can be handled by if_gif(4) interface is registered by separate encap handler, this helps avoid invoking the handler for unrelated protocols (GRE, PIM, etc.). This change allows dramatically improve performance when many gif(4) interfaces are used. Sponsored by: Yandex LLC Modified: head/share/man/man4/gif.4 head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/netinet/in_gif.c head/sys/netinet6/in6_gif.c Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Tue Jun 5 20:54:29 2018 (r334672) +++ head/share/man/man4/gif.4 Tue Jun 5 21:24:59 2018 (r334673) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2015 +.Dd June 5, 2018 .Dt GIF 4 .Os .Sh NAME @@ -169,14 +169,6 @@ This behavior may be modified at runtime by setting th variable .Va net.link.gif.max_nesting to the desired level of nesting. -Additionally, -.Nm -tunnels are restricted to one per pair of end points. -Parallel tunnels may be enabled by setting the -.Xr sysctl 8 -variable -.Va net.link.gif.parallel_tunnels -to 1. .Sh SEE ALSO .Xr gre 4 , .Xr inet 4 , Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Jun 5 20:54:29 2018 (r334672) +++ head/sys/net/if_gif.c Tue Jun 5 21:24:59 2018 (r334673) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * Copyright (c) 2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -85,8 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #endif /* INET6 */ #include @@ -98,32 +95,17 @@ __FBSDID("$FreeBSD$"); static const char gifname[] = "gif"; -/* - * gif_mtx protects a per-vnet gif_softc_list. - */ -static VNET_DEFINE(struct mtx, gif_mtx); -#define V_gif_mtx VNET(gif_mtx) -static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); -static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); -#define V_gif_softc_list VNET(gif_softc_list) +MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); static struct sx gif_ioctl_sx; SX_SYSINIT(gif_ioctl_sx, &gif_ioctl_sx, "gif_ioctl"); -#define GIF_LIST_LOCK_INIT(x) mtx_init(&V_gif_mtx, "gif_mtx", \ - NULL, MTX_DEF) -#define GIF_LIST_LOCK_DESTROY(x) mtx_destroy(&V_gif_mtx) -#define GIF_LIST_LOCK(x) mtx_lock(&V_gif_mtx) -#define GIF_LIST_UNLOCK(x) mtx_unlock(&V_gif_mtx) - void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af); void (*ng_gif_attach_p)(struct ifnet *ifp); void (*ng_gif_detach_p)(struct ifnet *ifp); static int gif_check_nesting(struct ifnet *, struct mbuf *); -static int gif_set_tunnel(struct ifnet *, struct sockaddr *, - struct sockaddr *); -static void gif_delete_tunnel(struct ifnet *); +static void gif_delete_tunnel(struct gif_softc *); static int gif_ioctl(struct ifnet *, u_long, caddr_t); static int gif_transmit(struct ifnet *, struct mbuf *); static void gif_qflush(struct ifnet *); @@ -132,8 +114,6 @@ static void gif_clone_destroy(struct ifnet *); static VNET_DEFINE(struct if_clone *, gif_cloner); #define V_gif_cloner VNET(gif_cloner) -static int gifmodevent(module_t, int, void *); - SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW, 0, "Generic Tunnel Interface"); @@ -153,21 +133,6 @@ static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NES SYSCTL_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); -/* - * By default, we disallow creation of multiple tunnels between the same - * pair of addresses. Some applications require this functionality so - * we allow control over this check here. - */ -#ifdef XBONEHACK -static VNET_DEFINE(int, parallel_tunnels) = 1; -#else -static VNET_DEFINE(int, parallel_tunnels) = 0; -#endif -#define V_parallel_tunnels VNET(parallel_tunnels) -SYSCTL_INT(_net_link_gif, OID_AUTO, parallel_tunnels, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, - "Allow parallel tunnels?"); - static int gif_clone_create(struct if_clone *ifc, int unit, caddr_t params) { @@ -176,20 +141,15 @@ gif_clone_create(struct if_clone *ifc, int unit, caddr sc = malloc(sizeof(struct gif_softc), M_GIF, M_WAITOK | M_ZERO); sc->gif_fibnum = curthread->td_proc->p_fibnum; GIF2IFP(sc) = if_alloc(IFT_GIF); - GIF_LOCK_INIT(sc); GIF2IFP(sc)->if_softc = sc; if_initname(GIF2IFP(sc), gifname, unit); GIF2IFP(sc)->if_addrlen = 0; GIF2IFP(sc)->if_mtu = GIF_MTU; GIF2IFP(sc)->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; -#if 0 - /* turn off ingress filter */ - GIF2IFP(sc)->if_flags |= IFF_LINK2; -#endif GIF2IFP(sc)->if_ioctl = gif_ioctl; - GIF2IFP(sc)->if_transmit = gif_transmit; - GIF2IFP(sc)->if_qflush = gif_qflush; + GIF2IFP(sc)->if_transmit = gif_transmit; + GIF2IFP(sc)->if_qflush = gif_qflush; GIF2IFP(sc)->if_output = gif_output; GIF2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; GIF2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; @@ -198,9 +158,6 @@ gif_clone_create(struct if_clone *ifc, int unit, caddr if (ng_gif_attach_p != NULL) (*ng_gif_attach_p)(GIF2IFP(sc)); - GIF_LIST_LOCK(); - LIST_INSERT_HEAD(&V_gif_softc_list, sc, gif_list); - GIF_LIST_UNLOCK(); return (0); } @@ -211,10 +168,7 @@ gif_clone_destroy(struct ifnet *ifp) sx_xlock(&gif_ioctl_sx); sc = ifp->if_softc; - gif_delete_tunnel(ifp); - GIF_LIST_LOCK(); - LIST_REMOVE(sc, gif_list); - GIF_LIST_UNLOCK(); + gif_delete_tunnel(sc); if (ng_gif_detach_p != NULL) (*ng_gif_detach_p)(ifp); bpfdetach(ifp); @@ -222,8 +176,8 @@ gif_clone_destroy(struct ifnet *ifp) ifp->if_softc = NULL; sx_xunlock(&gif_ioctl_sx); + GIF_WAIT(); if_free(ifp); - GIF_LOCK_DESTROY(sc); free(sc, M_GIF); } @@ -231,10 +185,14 @@ static void vnet_gif_init(const void *unused __unused) { - LIST_INIT(&V_gif_softc_list); - GIF_LIST_LOCK_INIT(); V_gif_cloner = if_clone_simple(gifname, gif_clone_create, gif_clone_destroy, 0); +#ifdef INET + in_gif_init(); +#endif +#ifdef INET6 + in6_gif_init(); +#endif } VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gif_init, NULL); @@ -244,7 +202,12 @@ vnet_gif_uninit(const void *unused __unused) { if_clone_detach(V_gif_cloner); - GIF_LIST_LOCK_DESTROY(); +#ifdef INET + in_gif_uninit(); +#endif +#ifdef INET6 + in6_gif_uninit(); +#endif } VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gif_uninit, NULL); @@ -272,65 +235,25 @@ static moduledata_t gif_mod = { DECLARE_MODULE(if_gif, gif_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(if_gif, 1); -int -gif_encapcheck(const struct mbuf *m, int off, int proto, void *arg) +struct gif_list * +gif_hashinit(void) { - GIF_RLOCK_TRACKER; - const struct ip *ip; - struct gif_softc *sc; - int ret; + struct gif_list *hash; + int i; - sc = (struct gif_softc *)arg; - if (sc == NULL || (GIF2IFP(sc)->if_flags & IFF_UP) == 0) - return (0); + hash = malloc(sizeof(struct gif_list) * GIF_HASH_SIZE, + M_GIF, M_WAITOK); + for (i = 0; i < GIF_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); - ret = 0; - GIF_RLOCK(sc); + return (hash); +} - /* no physical address */ - if (sc->gif_family == 0) - goto done; +void +gif_hashdestroy(struct gif_list *hash) +{ - switch (proto) { -#ifdef INET - case IPPROTO_IPV4: -#endif -#ifdef INET6 - case IPPROTO_IPV6: -#endif - case IPPROTO_ETHERIP: - break; - default: - goto done; - } - - /* Bail on short packets */ - M_ASSERTPKTHDR(m); - if (m->m_pkthdr.len < sizeof(struct ip)) - goto done; - - ip = mtod(m, const struct ip *); - switch (ip->ip_v) { -#ifdef INET - case 4: - if (sc->gif_family != AF_INET) - goto done; - ret = in_gif_encapcheck(m, off, proto, arg); - break; -#endif -#ifdef INET6 - case 6: - if (m->m_pkthdr.len < sizeof(struct ip6_hdr)) - goto done; - if (sc->gif_family != AF_INET6) - goto done; - ret = in6_gif_encapcheck(m, off, proto, arg); - break; -#endif - } -done: - GIF_RUNLOCK(sc); - return (ret); + free(hash, M_GIF); } static int @@ -357,6 +280,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; + GIF_RLOCK(); sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || @@ -444,6 +368,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + GIF_RUNLOCK(); return (error); } @@ -616,7 +541,8 @@ gif_input(struct mbuf *m, struct ifnet *ifp, int proto break; #endif case AF_LINK: - n = sizeof(struct etherip_header) + sizeof(struct ether_header); + n = sizeof(struct etherip_header) + + sizeof(struct ether_header); if (n > m->m_len) m = m_pullup(m, n); if (m == NULL) @@ -674,20 +600,11 @@ drop: if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } -/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */ -int +static int gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - GIF_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq*)data; - struct sockaddr *dst, *src; struct gif_softc *sc; -#ifdef INET - struct sockaddr_in *sin = NULL; -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6 = NULL; -#endif u_int options; int error; @@ -715,176 +632,25 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } error = 0; switch (cmd) { - case SIOCSIFPHYADDR: -#ifdef INET6 - case SIOCSIFPHYADDR_IN6: -#endif - error = EINVAL; - switch (cmd) { -#ifdef INET - case SIOCSIFPHYADDR: - src = (struct sockaddr *) - &(((struct in_aliasreq *)data)->ifra_addr); - dst = (struct sockaddr *) - &(((struct in_aliasreq *)data)->ifra_dstaddr); + case SIOCDIFPHYADDR: + if (sc->gif_family == 0) break; -#endif -#ifdef INET6 - case SIOCSIFPHYADDR_IN6: - src = (struct sockaddr *) - &(((struct in6_aliasreq *)data)->ifra_addr); - dst = (struct sockaddr *) - &(((struct in6_aliasreq *)data)->ifra_dstaddr); - break; -#endif - default: - goto bad; - } - /* sa_family must be equal */ - if (src->sa_family != dst->sa_family || - src->sa_len != dst->sa_len) - goto bad; - - /* validate sa_len */ - /* check sa_family looks sane for the cmd */ - switch (src->sa_family) { -#ifdef INET - case AF_INET: - if (src->sa_len != sizeof(struct sockaddr_in)) - goto bad; - if (cmd != SIOCSIFPHYADDR) { - error = EAFNOSUPPORT; - goto bad; - } - if (satosin(src)->sin_addr.s_addr == INADDR_ANY || - satosin(dst)->sin_addr.s_addr == INADDR_ANY) { - error = EADDRNOTAVAIL; - goto bad; - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (src->sa_len != sizeof(struct sockaddr_in6)) - goto bad; - if (cmd != SIOCSIFPHYADDR_IN6) { - error = EAFNOSUPPORT; - goto bad; - } - error = EADDRNOTAVAIL; - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(src)->sin6_addr) - || - IN6_IS_ADDR_UNSPECIFIED(&satosin6(dst)->sin6_addr)) - goto bad; - /* - * Check validity of the scope zone ID of the - * addresses, and convert it into the kernel - * internal form if necessary. - */ - error = sa6_embedscope(satosin6(src), 0); - if (error != 0) - goto bad; - error = sa6_embedscope(satosin6(dst), 0); - if (error != 0) - goto bad; - break; -#endif - default: - error = EAFNOSUPPORT; - goto bad; - } - error = gif_set_tunnel(ifp, src, dst); + gif_delete_tunnel(sc); break; - case SIOCDIFPHYADDR: - gif_delete_tunnel(ifp); - break; +#ifdef INET + case SIOCSIFPHYADDR: case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: + error = in_gif_ioctl(sc, cmd, data); + break; +#endif #ifdef INET6 + case SIOCSIFPHYADDR_IN6: case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: -#endif - if (sc->gif_family == 0) { - error = EADDRNOTAVAIL; - break; - } - GIF_RLOCK(sc); - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - case SIOCGIFPDSTADDR: - if (sc->gif_family != AF_INET) { - error = EADDRNOTAVAIL; - break; - } - sin = (struct sockaddr_in *)&ifr->ifr_addr; - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - case SIOCGIFPDSTADDR_IN6: - if (sc->gif_family != AF_INET6) { - error = EADDRNOTAVAIL; - break; - } - sin6 = (struct sockaddr_in6 *) - &(((struct in6_ifreq *)data)->ifr_addr); - memset(sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(*sin6); - break; -#endif - default: - error = EAFNOSUPPORT; - } - if (error == 0) { - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - sin->sin_addr = sc->gif_iphdr->ip_src; - break; - case SIOCGIFPDSTADDR: - sin->sin_addr = sc->gif_iphdr->ip_dst; - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - sin6->sin6_addr = sc->gif_ip6hdr->ip6_src; - break; - case SIOCGIFPDSTADDR_IN6: - sin6->sin6_addr = sc->gif_ip6hdr->ip6_dst; - break; -#endif - } - } - GIF_RUNLOCK(sc); - if (error != 0) - break; - switch (cmd) { -#ifdef INET - case SIOCGIFPSRCADDR: - case SIOCGIFPDSTADDR: - error = prison_if(curthread->td_ucred, - (struct sockaddr *)sin); - if (error != 0) - memset(sin, 0, sizeof(*sin)); - break; -#endif -#ifdef INET6 - case SIOCGIFPSRCADDR_IN6: - case SIOCGIFPDSTADDR_IN6: - error = prison_if(curthread->td_ucred, - (struct sockaddr *)sin6); - if (error == 0) - error = sa6_recoverscope(sin6); - if (error != 0) - memset(sin6, 0, sizeof(*sin6)); -#endif - } + error = in6_gif_ioctl(sc, cmd, data); break; +#endif case SIOCGTUNFIB: ifr->ifr_fib = sc->gif_fibnum; break; @@ -908,171 +674,63 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) sizeof(options)); if (error) break; - if (options & ~GIF_OPTMASK) + if (options & ~GIF_OPTMASK) { error = EINVAL; - else - sc->gif_options = options; - break; - default: - error = EINVAL; - break; - } -bad: - sx_xunlock(&gif_ioctl_sx); - return (error); -} - -static void -gif_detach(struct gif_softc *sc, int family) -{ - - sx_assert(&gif_ioctl_sx, SA_XLOCKED); - if (sc->gif_ecookie != NULL) { - switch (family) { -#ifdef INET - case AF_INET: - ip_encap_detach(sc->gif_ecookie); break; -#endif -#ifdef INET6 - case AF_INET6: - ip6_encap_detach(sc->gif_ecookie); - break; -#endif } - } - sc->gif_ecookie = NULL; -} - -static int -gif_attach(struct gif_softc *sc, int af) -{ - - sx_assert(&gif_ioctl_sx, SA_XLOCKED); - switch (af) { + if (sc->gif_options != options) { + switch (sc->gif_family) { #ifdef INET - case AF_INET: - return (in_gif_attach(sc)); + case AF_INET: + error = in_gif_setopts(sc, options); + break; #endif #ifdef INET6 - case AF_INET6: - return (in6_gif_attach(sc)); + case AF_INET6: + error = in6_gif_setopts(sc, options); + break; #endif - } - return (EAFNOSUPPORT); -} - -static int -gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) -{ - struct gif_softc *sc = ifp->if_softc; - struct gif_softc *tsc; -#ifdef INET - struct ip *ip; -#endif -#ifdef INET6 - struct ip6_hdr *ip6; -#endif - void *hdr; - int error = 0; - - if (sc == NULL) - return (ENXIO); - /* Disallow parallel tunnels unless instructed otherwise. */ - if (V_parallel_tunnels == 0) { - GIF_LIST_LOCK(); - LIST_FOREACH(tsc, &V_gif_softc_list, gif_list) { - if (tsc == sc || tsc->gif_family != src->sa_family) - continue; -#ifdef INET - if (tsc->gif_family == AF_INET && - tsc->gif_iphdr->ip_src.s_addr == - satosin(src)->sin_addr.s_addr && - tsc->gif_iphdr->ip_dst.s_addr == - satosin(dst)->sin_addr.s_addr) { - error = EADDRNOTAVAIL; - GIF_LIST_UNLOCK(); - goto bad; + default: + /* No need to invoke AF-handler */ + sc->gif_options = options; } -#endif -#ifdef INET6 - if (tsc->gif_family == AF_INET6 && - IN6_ARE_ADDR_EQUAL(&tsc->gif_ip6hdr->ip6_src, - &satosin6(src)->sin6_addr) && - IN6_ARE_ADDR_EQUAL(&tsc->gif_ip6hdr->ip6_dst, - &satosin6(dst)->sin6_addr)) { - error = EADDRNOTAVAIL; - GIF_LIST_UNLOCK(); - goto bad; - } -#endif } - GIF_LIST_UNLOCK(); + break; + default: + error = EINVAL; + break; } - switch (src->sa_family) { + if (error == 0 && sc->gif_family != 0) { + if ( #ifdef INET - case AF_INET: - hdr = ip = malloc(sizeof(struct ip), M_GIF, - M_WAITOK | M_ZERO); - ip->ip_src.s_addr = satosin(src)->sin_addr.s_addr; - ip->ip_dst.s_addr = satosin(dst)->sin_addr.s_addr; - break; + cmd == SIOCSIFPHYADDR || #endif #ifdef INET6 - case AF_INET6: - hdr = ip6 = malloc(sizeof(struct ip6_hdr), M_GIF, - M_WAITOK | M_ZERO); - ip6->ip6_src = satosin6(src)->sin6_addr; - ip6->ip6_dst = satosin6(dst)->sin6_addr; - ip6->ip6_vfc = IPV6_VERSION; - break; + cmd == SIOCSIFPHYADDR_IN6 || #endif - default: - return (EAFNOSUPPORT); + 0) { + ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_link_state_change(ifp, LINK_STATE_UP); + } } - - if (sc->gif_family != src->sa_family) - gif_detach(sc, sc->gif_family); - if (sc->gif_family == 0 || - sc->gif_family != src->sa_family) - error = gif_attach(sc, src->sa_family); - - GIF_WLOCK(sc); - if (sc->gif_family != 0) - free(sc->gif_hdr, M_GIF); - sc->gif_family = src->sa_family; - sc->gif_hdr = hdr; - GIF_WUNLOCK(sc); -#if defined(INET) || defined(INET6) bad: -#endif - if (error == 0 && sc->gif_family != 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_UP); - } else { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_DOWN); - } + sx_xunlock(&gif_ioctl_sx); return (error); } static void -gif_delete_tunnel(struct ifnet *ifp) +gif_delete_tunnel(struct gif_softc *sc) { - struct gif_softc *sc = ifp->if_softc; - int family; - if (sc == NULL) - return; - - GIF_WLOCK(sc); - family = sc->gif_family; - sc->gif_family = 0; - GIF_WUNLOCK(sc); - if (family != 0) { - gif_detach(sc, family); + sx_assert(&gif_ioctl_sx, SA_XLOCKED); + if (sc->gif_family != 0) { + CK_LIST_REMOVE(sc, chain); + /* Wait until it become safe to free gif_hdr */ + GIF_WAIT(); free(sc->gif_hdr, M_GIF); } - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - if_link_state_change(ifp, LINK_STATE_DOWN); + sc->gif_family = 0; + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; + if_link_state_change(GIF2IFP(sc), LINK_STATE_DOWN); } + Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Tue Jun 5 20:54:29 2018 (r334672) +++ head/sys/net/if_gif.h Tue Jun 5 21:24:59 2018 (r334673) @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * Copyright (c) 2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,14 +37,9 @@ #define _NET_IF_GIF_H_ #ifdef _KERNEL -#include "opt_inet.h" -#include "opt_inet6.h" -#include - struct ip; struct ip6_hdr; -struct encaptab; extern void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); @@ -55,8 +51,6 @@ extern void (*ng_gif_detach_p)(struct ifnet *ifp); struct gif_softc { struct ifnet *gif_ifp; - struct rmlock gif_lock; - const struct encaptab *gif_ecookie; int gif_family; int gif_flags; u_int gif_fibnum; @@ -65,28 +59,22 @@ struct gif_softc { union { void *hdr; struct ip *iphdr; -#ifdef INET6 struct ip6_hdr *ip6hdr; -#endif } gif_uhdr; - LIST_ENTRY(gif_softc) gif_list; /* all gif's are linked */ + + CK_LIST_ENTRY(gif_softc) chain; }; -#define GIF2IFP(sc) ((sc)->gif_ifp) -#define GIF_LOCK_INIT(sc) rm_init(&(sc)->gif_lock, "gif softc") -#define GIF_LOCK_DESTROY(sc) rm_destroy(&(sc)->gif_lock) -#define GIF_RLOCK_TRACKER struct rm_priotracker gif_tracker -#define GIF_RLOCK(sc) rm_rlock(&(sc)->gif_lock, &gif_tracker) -#define GIF_RUNLOCK(sc) rm_runlock(&(sc)->gif_lock, &gif_tracker) -#define GIF_RLOCK_ASSERT(sc) rm_assert(&(sc)->gif_lock, RA_RLOCKED) -#define GIF_WLOCK(sc) rm_wlock(&(sc)->gif_lock) -#define GIF_WUNLOCK(sc) rm_wunlock(&(sc)->gif_lock) -#define GIF_WLOCK_ASSERT(sc) rm_assert(&(sc)->gif_lock, RA_WLOCKED) +CK_LIST_HEAD(gif_list, gif_softc); +MALLOC_DECLARE(M_GIF); +#ifndef GIF_HASH_SIZE +#define GIF_HASH_SIZE (1 << 4) +#endif + +#define GIF2IFP(sc) ((sc)->gif_ifp) #define gif_iphdr gif_uhdr.iphdr #define gif_hdr gif_uhdr.hdr -#ifdef INET6 #define gif_ip6hdr gif_uhdr.ip6hdr -#endif #define GIF_MTU (1280) /* Default MTU */ #define GIF_MTU_MIN (1280) /* Minimum MTU */ @@ -108,21 +96,29 @@ struct etherip_header { /* mbuf adjust factor to force 32-bit alignment of IP header */ #define ETHERIP_ALIGN 2 +#define GIF_RLOCK() epoch_enter_preempt(net_epoch_preempt) +#define GIF_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) +#define GIF_WAIT() epoch_wait_preempt(net_epoch_preempt) + /* Prototypes */ +struct gif_list *gif_hashinit(void); +void gif_hashdestroy(struct gif_list *); + void gif_input(struct mbuf *, struct ifnet *, int, uint8_t); int gif_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -int gif_encapcheck(const struct mbuf *, int, int, void *); -#ifdef INET + +void in_gif_init(void); +void in_gif_uninit(void); int in_gif_output(struct ifnet *, struct mbuf *, int, uint8_t); -int in_gif_encapcheck(const struct mbuf *, int, int, void *); -int in_gif_attach(struct gif_softc *); -#endif -#ifdef INET6 +int in_gif_ioctl(struct gif_softc *, u_long, caddr_t); +int in_gif_setopts(struct gif_softc *, u_int); + +void in6_gif_init(void); +void in6_gif_uninit(void); int in6_gif_output(struct ifnet *, struct mbuf *, int, uint8_t); -int in6_gif_encapcheck(const struct mbuf *, int, int, void *); -int in6_gif_attach(struct gif_softc *); -#endif +int in6_gif_ioctl(struct gif_softc *, u_long, caddr_t); +int in6_gif_setopts(struct gif_softc *, u_int); #endif /* _KERNEL */ #define GIFGOPTS _IOWR('i', 150, struct ifreq) Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Tue Jun 5 20:54:29 2018 (r334672) +++ head/sys/netinet/in_gif.c Tue Jun 5 21:24:59 2018 (r334673) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * Copyright (c) 2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,9 +39,8 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include -#include -#include #include +#include #include #include #include @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -75,15 +76,155 @@ static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gif_ttl), 0, "Default TTL value for encapsulated packets"); +/* + * We keep interfaces in a hash table using src+dst as key. + * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. + */ +static VNET_DEFINE(struct gif_list *, ipv4_hashtbl) = NULL; +static VNET_DEFINE(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); +#define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_list VNET(ipv4_list) + +#define GIF_HASH(src, dst) (V_ipv4_hashtbl[\ + in_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_HASH_SC(sc) GIF_HASH((sc)->gif_iphdr->ip_src.s_addr,\ + (sc)->gif_iphdr->ip_dst.s_addr) +static uint32_t +in_gif_hashval(in_addr_t src, in_addr_t dst) +{ + uint32_t ret; + + ret = fnv_32_buf(&src, sizeof(src), FNV1_32_INIT); + return (fnv_32_buf(&dst, sizeof(dst), ret)); +} + +static int +in_gif_checkdup(const struct gif_softc *sc, in_addr_t src, in_addr_t dst) +{ + struct gif_softc *tmp; + + if (sc->gif_family == AF_INET && + sc->gif_iphdr->ip_src.s_addr == src && + sc->gif_iphdr->ip_dst.s_addr == dst) + return (EEXIST); + + CK_LIST_FOREACH(tmp, &GIF_HASH(src, dst), chain) { + if (tmp == sc) + continue; + if (tmp->gif_iphdr->ip_src.s_addr == src && + tmp->gif_iphdr->ip_dst.s_addr == dst) + return (EADDRNOTAVAIL); + } + return (0); +} + +static void +in_gif_attach(struct gif_softc *sc) +{ + + if (sc->gif_options & GIF_IGNORE_SOURCE) + CK_LIST_INSERT_HEAD(&V_ipv4_list, sc, chain); + else + CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); +} + int +in_gif_setopts(struct gif_softc *sc, u_int options) +{ + + /* NOTE: we are protected with gif_ioctl_sx lock */ + MPASS(sc->gif_family == AF_INET); + MPASS(sc->gif_options != options); + + if ((options & GIF_IGNORE_SOURCE) != + (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, chain); + sc->gif_options = options; + in_gif_attach(sc); + } + return (0); +} + +int +in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t data) +{ + struct ifreq *ifr = (struct ifreq *)data; + struct sockaddr_in *dst, *src; + struct ip *ip; + int error; + + /* NOTE: we are protected with gif_ioctl_sx lock */ + error = EINVAL; + switch (cmd) { + case SIOCSIFPHYADDR: + src = &((struct in_aliasreq *)data)->ifra_addr; + dst = &((struct in_aliasreq *)data)->ifra_dstaddr; + + /* sanity checks */ + if (src->sin_family != dst->sin_family || + src->sin_family != AF_INET || + src->sin_len != dst->sin_len || + src->sin_len != sizeof(*src)) + break; + if (src->sin_addr.s_addr == INADDR_ANY || + dst->sin_addr.s_addr == INADDR_ANY) { + error = EADDRNOTAVAIL; + break; + } + if (V_ipv4_hashtbl == NULL) + V_ipv4_hashtbl = gif_hashinit(); + error = in_gif_checkdup(sc, src->sin_addr.s_addr, + dst->sin_addr.s_addr); + if (error == EADDRNOTAVAIL) + break; + if (error == EEXIST) { + /* Addresses are the same. Just return. */ + error = 0; + break; + } + ip = malloc(sizeof(*ip), M_GIF, M_WAITOK | M_ZERO); + ip->ip_src.s_addr = src->sin_addr.s_addr; + ip->ip_dst.s_addr = dst->sin_addr.s_addr; + if (sc->gif_family != 0) { + /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, chain); + GIF_WAIT(); + free(sc->gif_hdr, M_GIF); + /* XXX: should we notify about link state change? */ + } + sc->gif_family = AF_INET; + sc->gif_iphdr = ip; + in_gif_attach(sc); + break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jun 5 22:13:48 2018 Return-Path: Delivered-To: svn-src-head@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 253DEFF978C; Tue, 5 Jun 2018 22:13:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B46C177BF8; Tue, 5 Jun 2018 22:13:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FF6522545; Tue, 5 Jun 2018 22:13:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55MDlgo048519; Tue, 5 Jun 2018 22:13:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55MDkN4048513; Tue, 5 Jun 2018 22:13:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806052213.w55MDkN4048513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jun 2018 22:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334695 - in head/stand: common i386/libi386 uboot/lib userboot/userboot zfs X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/stand: common i386/libi386 uboot/lib userboot/userboot zfs X-SVN-Commit-Revision: 334695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 22:13:48 -0000 Author: ian Date: Tue Jun 5 22:13:45 2018 New Revision: 334695 URL: https://svnweb.freebsd.org/changeset/base/334695 Log: Remove comments and assertions that are no longer valid after r330809. r330809 replaced duplication of devdesc struct fields with an embedded copy of the devdesc struct, to avoid fragility. That means all the scattered comments indicating that structs must match are no longer valid. Likewise asserts that attempted to mitigate some of the old fragility. Reviewed by: imp@ Modified: head/stand/common/disk.h head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/libi386.h head/stand/uboot/lib/libuboot.h head/stand/userboot/userboot/main.c head/stand/zfs/libzfs.h Modified: head/stand/common/disk.h ============================================================================== --- head/stand/common/disk.h Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/common/disk.h Tue Jun 5 22:13:45 2018 (r334695) @@ -81,9 +81,8 @@ #ifndef _DISK_H #define _DISK_H -/* Note: Must match the 'struct devdesc' in stand.h */ struct disk_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ int d_slice; int d_partition; uint64_t d_offset; Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/i386/libi386/biosdisk.c Tue Jun 5 22:13:45 2018 (r334695) @@ -78,8 +78,6 @@ struct ptable { #include "geliboot.c" #endif /* LOADER_GELI_SUPPORT */ -CTASSERT(sizeof(struct i386_devdesc) >= sizeof(struct disk_devdesc)); - #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/i386/libi386/libi386.h Tue Jun 5 22:13:45 2018 (r334695) @@ -29,11 +29,9 @@ /* * i386 fully-qualified device descriptor. - * Note, this must match struct zfs_devdesc for zfs support. */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct i386_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ union { struct Modified: head/stand/uboot/lib/libuboot.h ============================================================================== --- head/stand/uboot/lib/libuboot.h Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/uboot/lib/libuboot.h Tue Jun 5 22:13:45 2018 (r334695) @@ -27,9 +27,8 @@ * $FreeBSD$ */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct uboot_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ union { struct { int slice; Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/userboot/userboot/main.c Tue Jun 5 22:13:45 2018 (r334695) @@ -159,7 +159,6 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) struct zfs_devdesc zdev; - CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); if (userboot_zfs_found) { /* Leave the pool/root guid's unassigned */ Modified: head/stand/zfs/libzfs.h ============================================================================== --- head/stand/zfs/libzfs.h Tue Jun 5 21:55:40 2018 (r334694) +++ head/stand/zfs/libzfs.h Tue Jun 5 22:13:45 2018 (r334695) @@ -33,12 +33,9 @@ /* * ZFS fully-qualified device descriptor. - * Arch-specific device descriptors should be binary compatible with this - * structure if they are to support ZFS. */ -/* Note: Must match the 'struct devdesc' in stand.h */ struct zfs_devdesc { - struct devdesc dd; + struct devdesc dd; /* Must be first. */ uint64_t pool_guid; uint64_t root_guid; }; From owner-svn-src-head@freebsd.org Tue Jun 5 22:15:59 2018 Return-Path: Delivered-To: svn-src-head@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 CACEBFF984F; Tue, 5 Jun 2018 22:15:59 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (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 38ACC77D6A; Tue, 5 Jun 2018 22:15:59 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f66.google.com with SMTP id d24-v6so5987984lfa.8; Tue, 05 Jun 2018 15:15:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=EqL4unuZ/PKdS7d/+DjWME3NQS36Fyp3Ejavn9FIIAI=; b=sQYTHOkkb9vcpUnKFhUIF7mG5Ub7v8g8bXuq21fv/vnWLdXfhq2Vi/C2huIkiYDYtx LQbJBeB1qQIoPNm66HSAKkV38+eU+/qRTKPgO0dn+xg+pS0vI31BiLLXi6pKuIHyM755 EuWRef80OANOFdzF1uzm7oXvXRqZ80NPqnG6/zPQI95vg/efWAzh5DtkbfxidRmLZTR8 1L8vcMiQ3YhbzAFmbWfLbm00d56vVwGob7sT1nwxjcd6LiyBZnBoLi06CpUKRIKb0zVo DVBTMGiNsv6rJ32SmSlv5d7hb6wblSLS7BVuqG6U2SqOM/ifED+ZxNy8m2rmMNXZjOcD 9FYw== X-Gm-Message-State: APt69E1XyojKe816YbhG4iEfCJlf3Kg0kL1j0o6hpfDETmYuJ56ThY5I /CHOK8Kqfg8tKYJti8g+pllQHDmPhtk= X-Google-Smtp-Source: ADUXVKIy9ByZUirCVmm1Yqz7Gz2nP/28aFTdgFc9bGs0LufAdwRZiVZaW7VVDoJ8Ece4Wo5AS5dB8A== X-Received: by 2002:a2e:4189:: with SMTP id d9-v6mr238710ljf.36.1528235517718; Tue, 05 Jun 2018 14:51:57 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id l7-v6sm6520339ljh.53.2018.06.05.14.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 14:51:57 -0700 (PDT) Subject: Re: svn commit: r334669 - head/sys/sys To: Eric van Gyzen , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806052034.w55KYBsb096418@repo.freebsd.org> <1528232004.63685.25.camel@freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <3ec8b34a-7cc7-81a1-37e2-706da27ad1dc@FreeBSD.org> Date: Wed, 6 Jun 2018 00:51:55 +0300 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 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 22:16:00 -0000 On 06/06/2018 00:07, Eric van Gyzen wrote: > On 06/05/2018 15:53, Ian Lepore wrote: >> This is a sad sad thing. Treating (bits & flagconstants) as boolean has >> a long long history in C. Surely there are literally thousand of >> occurrances in freebsd code already, so why did this one get flagged? > > I agree, and I tend to avoid adding "!= 0" unnecessarily, but I don't > feel very strongly about it. I am not sure what parts of code you work on, but turning bit operations into logical operations within conditions is the predominant FreeBSD style. Please accept it. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Jun 5 22:56:49 2018 Return-Path: Delivered-To: svn-src-head@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 EBE23FD0D11; Tue, 5 Jun 2018 22:56:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (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 8228E7958D; Tue, 5 Jun 2018 22:56:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x22b.google.com with SMTP id q6-v6so4397063qtn.7; Tue, 05 Jun 2018 15:56:48 -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=BPJvmrArs93W1dTWS7Xi/gMAA+14YlZmxgDsBklMReA=; b=Ehp1D5pcJzUtD/7L9dTsNfpFBbp+TejlW0LlKeReROCOz1rD9d5sStPWS4qbs67kRZ 4MhAgNVQ2/gZjO/omcYMMJ7ymKuqLmmjrt40nqrWcSaNQz5I5PAkiEjZ5utPTH0w8f1b azvIvUAmgljvrkwMt9MMGckrFavMPL68/ivbYF+4r/BbQmK77RPzgyEz76oaylKWDhZy qowCA57xV4aE86PNAP0r8u5lzEtDQNX8Q15rqF6tD2rQa1A+4rR+PNr+AwfU6HLXzbsT m4KgOweMjAz/GpCCpggrHLHCwIum/UeczhMoNEZdRdNp6nl0HBo1dPM6TXYgaIYKnmv2 VHyg== 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=BPJvmrArs93W1dTWS7Xi/gMAA+14YlZmxgDsBklMReA=; b=h+SCI0aYpoRVZzqwwqQGVStCOT7hTh5t3pbkDn22IZOQy71msY7pQhlgI3qBb1iOE5 91OQ556XKwANbrXaYY+DV6vo13Y9vLV4PmNqeWocWZljT1WW9dENS2vbqUAfdRH09KwB +6PxKQC1tjcWSBbMcP1ELRz/vTRBfHSvA3EDBekcxuPh+uHrbBo1/nszW93UwC22l92m 5nNxMMDO8dK0Y0G5g+q+fkIXoTvxKKvdLY6QyS+3GcYFZjfjfbd0g/TI4MAjoXEtWkql UcI9Wqq7q6h9qaE5d8Z1/8nWoXE39qvp2hc1a+sP1nvVF0hpfum8yN02DAhh+BpwKYAz OKHQ== X-Gm-Message-State: APt69E2Nd979uRKK4yM/IqilZrixtWSyCF3WL6BR+qwZAOwMWpGaDm9J 3cIuTyGNBDm5yyncEB1uL0b2p3AfX4XKSspwyRk= X-Google-Smtp-Source: ADUXVKKzJImQtcHBIKi0XGMPIlE1y0xBqfRLXQDU/5bPNg6eRsXBF/ej4YAxYY1MiTx+raqlu6aCzzRB+46z1ppGHf0= X-Received: by 2002:a0c:94fa:: with SMTP id k55-v6mr613030qvk.20.1528239407860; Tue, 05 Jun 2018 15:56:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:1c4e:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 15:56:47 -0700 (PDT) In-Reply-To: <20180605225215.GC1005@FreeBSD.org> References: <201806022220.w52MK9TT026244@repo.freebsd.org> <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> <20180605225215.GC1005@FreeBSD.org> From: Mateusz Guzik Date: Wed, 6 Jun 2018 00:56:47 +0200 Message-ID: Subject: Re: svn commit: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys To: Gleb Smirnoff Cc: Eric van Gyzen , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 22:56:49 -0000 On Wed, Jun 6, 2018 at 12:52 AM, Gleb Smirnoff wrote: > On Tue, Jun 05, 2018 at 06:35:37PM +0200, Mateusz Guzik wrote: > M> > On 06/02/2018 17:20, Mateusz Guzik wrote: > M> > > +#ifdef _KERNEL > M> > > +#define malloc(size, type, flags) ({ > \ > M> > > + void *_malloc_item; > \ > M> > > + size_t _size = (size); > \ > M> > > + if (__builtin_constant_p(size) && __builtin_constant_p(flags) > &&\ > M> > > + ((flags) & M_ZERO)) { > \ > M> > > + _malloc_item = malloc(_size, type, (flags) &~ > M_ZERO); \ > M> > > + if (((flags) & M_WAITOK) || _malloc_item != NULL) > \ > M> > > + bzero(_malloc_item, _size); > \ > M> > > + } else { > \ > M> > > + _malloc_item = malloc(_size, type, flags); > \ > M> > > + } > \ > M> > > + _malloc_item; > \ > M> > > +}) > M> > > +#endif > M> > > M> > Mateusz, > M> > > M> > Thank you for this and for all of your performance work. It is all > very > M> > interesting stuff. > M> > > M> > > M> Thank you for the kind words. It is positive feedback like this which > M> keeps me going! > > Btw, what was the point of checking flags || result? Most places in kernel > ignore flags and just test result regerdless of M_WAITOK/M_NOWAIT. > > The result is already in a register, why do you think checking for absense > of M_WAITOK is faster that checking for !NULL _malloc_item? > This part is only reachable if flags are known at compilation time. If they contain M_WAITOK, the flag check will get elided along (we know for a fact it passes) and subsequently the NULL check will be short circuited, iow for known M_WAITOK|M_ZERO flags this is: _malloc_item = malloc(_size, type, flags & ~ M_ZERO); bzero(_malloc_item, _size); -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Jun 5 23:30:37 2018 Return-Path: Delivered-To: svn-src-head@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 9964EFD1E0A for ; Tue, 5 Jun 2018 23:30:37 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D29B7A53B for ; Tue, 5 Jun 2018 23:30:37 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f169.google.com (mail-yw0-f169.google.com [209.85.161.169]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 02B0220DA8 for ; Tue, 5 Jun 2018 23:30:37 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f169.google.com with SMTP id s201-v6so1313630ywg.8 for ; Tue, 05 Jun 2018 16:30:36 -0700 (PDT) X-Gm-Message-State: APt69E2Ali23b3/QoZhw1cUQpgFDPL1jBJMHdejLbO1IKiwVY7SnH70u Rhi9B9ccBx0Dfn8NgNCPmEcnF0qYxiz+r1GrkWnh5w== X-Google-Smtp-Source: ADUXVKJb1L5VK3pj7DFPmjCWFxO3s4MIUpLaUp+ARgWNxnZ7VIbKxnfS6TpP+8zepqzTzkyMcSeEO5RxjzBG3L+Zi2g= X-Received: by 2002:a81:6d52:: with SMTP id i79-v6mr336842ywc.141.1528241436303; Tue, 05 Jun 2018 16:30:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 16:30:05 -0700 (PDT) In-Reply-To: <20180605140156.GA93953@ns.kevlo.org> References: <201806050952.w559qc3l066480@repo.freebsd.org> <20180605140156.GA93953@ns.kevlo.org> From: Eitan Adler Date: Tue, 5 Jun 2018 16:30:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334650 - head/sys/dev/usb To: Kevin Lo Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 23:30:37 -0000 On 5 June 2018 at 07:01, Kevin Lo wrote: > On Tue, Jun 05, 2018 at 09:52:38AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Tue Jun 5 09:52:38 2018 >> New Revision: 334650 >> URL: https://svnweb.freebsd.org/changeset/base/334650 >> >> Log: >> usbdevs: sync from NetBSD >> >> This adds several vendors from NetBSD's copy of the same file (r1.749). >> Prefer longer more "canonical" names where the names differed. >> >> Sort while here. >> >> Modified: >> head/sys/dev/usb/usbdevs >> >> Modified: head/sys/dev/usb/usbdevs >> ============================================================================== >> --- head/sys/dev/usb/usbdevs Tue Jun 5 05:24:42 2018 (r334649) >> +++ head/sys/dev/usb/usbdevs Tue Jun 5 09:52:38 2018 (r334650) >> @@ -60,7 +60,7 @@ vendor UNKNOWN2 0x0105 Unknown vendor >> vendor EGALAX2 0x0123 eGalax, Inc. >> vendor CHIPSBANK 0x0204 Chipsbank Microelectronics Co. >> vendor HUMAX 0x02ad HUMAX >> -vendor INTENSO 0x2109 INTENSO >> +vendor QUAN 0x01e1 Quan > > Doesn't sort. > > [snip] > >> +vendor INTENSO 0x2109 INTENSO >> vendor VIALABS 0x2109 VIA Labs > > INTENSO has the same vendor id as VIALABS? This doesn't look right. >From the origin (NetBSD): vendor INTENSO 0x2109 INTENSO vendor VIALABS 0x2109 VIA Labs I noticed this earlier and thought it might relate to vendor renames or the like. I'll try and spend more time on it. I have quite a few replies-to-commits to catch up on: I've spent too much time on "new" things and have to deal with the other stuff I've touched now. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Wed Jun 6 01:51:07 2018 Return-Path: Delivered-To: svn-src-head@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 E8308FDC0DD; Wed, 6 Jun 2018 01:51:06 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 990BE7E2FA; Wed, 6 Jun 2018 01:51:06 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A4752468A; Wed, 6 Jun 2018 01:51:06 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w561p6bV054214; Wed, 6 Jun 2018 01:51:06 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w561p6JY054213; Wed, 6 Jun 2018 01:51:06 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201806060151.w561p6JY054213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 6 Jun 2018 01:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334700 - in head/etc: rc.d sendmail X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head/etc: rc.d sendmail X-SVN-Commit-Revision: 334700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 01:51:07 -0000 Author: brd Date: Wed Jun 6 01:51:05 2018 New Revision: 334700 URL: https://svnweb.freebsd.org/changeset/base/334700 Log: Only create /var/log/sendmail.st if start sendmail. For those of us that never use or start sendmail, it is unneeded. Approved by: bapt (mentor) Modified: head/etc/rc.d/sendmail head/etc/sendmail/Makefile Modified: head/etc/rc.d/sendmail ============================================================================== --- head/etc/rc.d/sendmail Wed Jun 6 01:30:48 2018 (r334699) +++ head/etc/rc.d/sendmail Wed Jun 6 01:51:05 2018 (r334700) @@ -197,6 +197,10 @@ sendmail_precmd() sendmail_cert_create fi fi + + if [ ! -f /var/log/sendmail.st ]; then + /usr/bin/install -m 640 -o root -g wheel /dev/null /var/log/sendmail.st + fi } run_rc_command "$1" Modified: head/etc/sendmail/Makefile ============================================================================== --- head/etc/sendmail/Makefile Wed Jun 6 01:30:48 2018 (r334699) +++ head/etc/sendmail/Makefile Wed Jun 6 01:51:05 2018 (r334700) @@ -70,8 +70,6 @@ distribution: ${.CURDIR}/freebsd.submit.mc freebsd.submit.cf ${DESTDIR}/etc/mail ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${SMDIR}/helpfile ${DESTDIR}/etc/mail - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 \ - /dev/null ${DESTDIR}/var/log/sendmail.st .if defined(INSTALL_CF) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${INSTALL_CF} ${DEST_CF} From owner-svn-src-head@freebsd.org Wed Jun 6 02:48:13 2018 Return-Path: Delivered-To: svn-src-head@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 99ECAFDDA19; Wed, 6 Jun 2018 02:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4807A7F743; Wed, 6 Jun 2018 02:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2720C24FA9; Wed, 6 Jun 2018 02:48:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w562mDS7083151; Wed, 6 Jun 2018 02:48:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w562m9tB083134; Wed, 6 Jun 2018 02:48:09 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806060248.w562m9tB083134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 6 Jun 2018 02:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat X-SVN-Commit-Revision: 334701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 02:48:13 -0000 Author: mmacy Date: Wed Jun 6 02:48:09 2018 New Revision: 334701 URL: https://svnweb.freebsd.org/changeset/base/334701 Log: hwpmc: add summary command and further metadata extensions metadata changes: - log pmc sample rate with pmcallocate - log proc flags with thread / process logging to identify user vs kernel threads fixes: - use log cpuid to translate event id to event name Implement rudimentary summary command to track sample counts by thread and process name within a pmc log. % make -j4 buildkernel >& /dev/null & % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 % pmc summary foo cpu_clk_unhalted.thread_p_any: idle: 138108207162 clang-6.0: 105336158004 sh: 72340108510 make: 8642012963 kernel: 7754011631 longest_lat_cache.miss: clang-6.0: 87502625 sh: 40901227 make: 5500165 kernel: 3300099 awk: 2000060 % pmc summary -f ~/foo idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 idle: 69054 clang-6.0: 52668 sh: 36170 make: 4321 kernel: 3877 hwpmc: proc(7445): 3319 awk: 1289 xargs: 357 rand_harvestq: 181 mtree: 102 intr: 53 zfskern: 31 usb: 7 pagedaemon: 4 ntpd: 3 syslogd: 1 acpi_thermal: 1 logger: 1 syncer: 1 snmptrapd: 1 sleep: 1 idx: 17 name: longest_lat_cache.miss rate: 100003 clang-6.0: 875 sh: 409 make: 55 kernel: 33 awk: 20 hwpmc: proc(7445): 14 xargs: 9 idle: 8 intr: 3 zfskern: 2 Added: head/usr.sbin/pmc/cmd_pmc_summary.cc (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/lib/libpmc/libpmc_pmu_util.c (contents, props changed) head/lib/libpmc/pmc.h head/lib/libpmc/pmclog.c head/lib/libpmc/pmclog.h head/share/examples/hwpmc/overhead.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/sys/pmc.h head/sys/sys/pmclog.h head/usr.sbin/pmc/Makefile (contents, props changed) head/usr.sbin/pmc/cmd_pmc.h (contents, props changed) head/usr.sbin/pmc/cmd_pmc_filter.cc head/usr.sbin/pmc/cmd_pmc_stat.c (contents, props changed) head/usr.sbin/pmc/pmc.c (contents, props changed) head/usr.sbin/pmcstat/pmcstat.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/lib/libpmc/libpmc.c Wed Jun 6 02:48:09 2018 (r334701) @@ -1007,7 +1007,8 @@ pmc_mdep_is_compatible_class(enum pmc_class pc) int pmc_allocate(const char *ctrspec, enum pmc_mode mode, - uint32_t flags, int cpu, pmc_id_t *pmcid) + uint32_t flags, int cpu, pmc_id_t *pmcid, + uint64_t count) { size_t n; int retval; @@ -1030,6 +1031,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, pmc_config.pm_cpu = cpu; pmc_config.pm_mode = mode; pmc_config.pm_flags = flags; + pmc_config.pm_count = count; if (PMC_IS_SAMPLING_MODE(mode)) pmc_config.pm_caps |= PMC_CAP_INTERRUPT; /* Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/lib/libpmc/libpmc_pmu_util.c Wed Jun 6 02:48:09 2018 (r334701) @@ -162,13 +162,13 @@ pmc_pmu_idx_get_by_event(const char *cpuid, const char } const char * -pmc_pmu_event_get_by_idx(int idx) +pmc_pmu_event_get_by_idx(const char *cpuid, int idx) { const struct pmu_events_map *pme; const struct pmu_event *pe; int i; - if ((pme = pmu_events_map_get(NULL)) == NULL) + if ((pme = pmu_events_map_get(cpuid)) == NULL) return (NULL); for (i = 0, pe = pme->table; (pe->name || pe->desc || pe->event) && i < idx; pe++, i++); return (pe->name); @@ -470,7 +470,7 @@ pmc_pmu_pmcallocate(const char *e __unused, struct pmc } const char * -pmc_pmu_event_get_by_idx(int idx __unused) +pmc_pmu_event_get_by_idx(const char *c __unused, int idx __unused) { return (NULL); } Modified: head/lib/libpmc/pmc.h ============================================================================== --- head/lib/libpmc/pmc.h Wed Jun 6 01:51:05 2018 (r334700) +++ head/lib/libpmc/pmc.h Wed Jun 6 02:48:09 2018 (r334701) @@ -75,7 +75,7 @@ struct pmc_pmcinfo { __BEGIN_DECLS int pmc_allocate(const char *_ctrspec, enum pmc_mode _mode, uint32_t _flags, - int _cpu, pmc_id_t *_pmcid); + int _cpu, pmc_id_t *_pmcid, uint64_t count); int pmc_attach(pmc_id_t _pmcid, pid_t _pid); int pmc_capabilities(pmc_id_t _pmc, uint32_t *_caps); int pmc_configure_logfile(int _fd); @@ -120,7 +120,7 @@ void pmc_pmu_print_counter_desc_long(const char *); void pmc_pmu_print_counter_full(const char *); uint64_t pmc_pmu_sample_rate_get(const char *); int pmc_pmu_pmcallocate(const char *, struct pmc_op_pmcallocate *); -const char *pmc_pmu_event_get_by_idx(int idx); +const char *pmc_pmu_event_get_by_idx(const char *, int idx); int pmc_pmu_idx_get_by_event(const char*, const char *); int pmc_pmu_stat_mode(const char ***); __END_DECLS Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/lib/libpmc/pmclog.c Wed Jun 6 02:48:09 2018 (r334701) @@ -328,6 +328,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_i.pl_arch); PMCLOG_READSTRING(le, ev->pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); memcpy(ev->pl_u.pl_i.pl_cpuid, le, PMC_CPUID_LEN); + ps->ps_cpuid = strdup(ev->pl_u.pl_i.pl_cpuid); ps->ps_version = ev->pl_u.pl_i.pl_version; ps->ps_arch = ev->pl_u.pl_i.pl_arch; ps->ps_initialized = 1; @@ -347,8 +348,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_a.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_event); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags); - PMCLOG_READ32(le,noop); - ev->pl_u.pl_a.pl_evname = pmc_pmu_event_get_by_idx(ev->pl_u.pl_a.pl_event); + PMCLOG_READ64(le,ev->pl_u.pl_a.pl_rate); + ev->pl_u.pl_a.pl_evname = pmc_pmu_event_get_by_idx(ps->ps_cpuid, ev->pl_u.pl_a.pl_event); if (ev->pl_u.pl_a.pl_evname != NULL) break; else if ((ev->pl_u.pl_a.pl_evname = @@ -407,7 +408,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_THR_CREATE: PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_tid); PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_pid); - PMCLOG_READ32(le,noop); + PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_flags); memcpy(ev->pl_u.pl_tc.pl_tdname, le, MAXCOMLEN+1); break; case PMCLOG_TYPE_THR_EXIT: @@ -415,6 +416,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l break; case PMCLOG_TYPE_PROC_CREATE: PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_pid); + PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_flags); + PMCLOG_READ32(le,noop); memcpy(ev->pl_u.pl_pc.pl_pcomm, le, MAXCOMLEN+1); break; default: /* unknown record type */ @@ -553,6 +556,7 @@ pmclog_open(int fd) ps->ps_count = 0; ps->ps_offset = (off_t) 0; bzero(&ps->ps_saved, sizeof(ps->ps_saved)); + ps->ps_cpuid = NULL; ps->ps_svcount = 0; ps->ps_fd = fd; ps->ps_data = NULL; Modified: head/lib/libpmc/pmclog.h ============================================================================== --- head/lib/libpmc/pmclog.h Wed Jun 6 01:51:05 2018 (r334700) +++ head/lib/libpmc/pmclog.h Wed Jun 6 02:48:09 2018 (r334701) @@ -89,15 +89,16 @@ struct pmclog_ev_pcsample { }; struct pmclog_ev_pmcallocate { - uint32_t pl_event; const char * pl_evname; + uint64_t pl_rate; + uint32_t pl_event; uint32_t pl_flags; pmc_id_t pl_pmcid; }; struct pmclog_ev_pmcallocatedyn { - uint32_t pl_event; char pl_evname[PMC_NAME_MAX]; + uint32_t pl_event; uint32_t pl_flags; pmc_id_t pl_pmcid; }; @@ -122,6 +123,7 @@ struct pmclog_ev_proccsw { struct pmclog_ev_proccreate { pid_t pl_pid; + uint32_t pl_flags; char pl_pcomm[MAXCOMLEN+1]; }; @@ -150,6 +152,7 @@ struct pmclog_ev_sysexit { struct pmclog_ev_threadcreate { pid_t pl_tid; pid_t pl_pid; + uint32_t pl_flags; char pl_tdname[MAXCOMLEN+1]; }; @@ -211,6 +214,7 @@ struct pmclog_parse_state { int ps_fd; /* active fd or -1 */ char *ps_buffer; /* scratch buffer if fd != -1 */ char *ps_data; /* current parse pointer */ + char *ps_cpuid; /* log cpuid */ size_t ps_len; /* length of buffered data */ }; Modified: head/share/examples/hwpmc/overhead.c ============================================================================== --- head/share/examples/hwpmc/overhead.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/share/examples/hwpmc/overhead.c Wed Jun 6 02:48:09 2018 (r334701) @@ -65,7 +65,7 @@ main(int argc, char **argv) if (pmc_init() != 0) err(EX_OSERR, "hwpmc(4) not loaded, kldload or update your kernel"); - if (pmc_allocate(counter_name, PMC_MODE_SC, 0, 0, &pmcid) < 0) + if (pmc_allocate(counter_name, PMC_MODE_SC, 0, 0, &pmcid, 64*1024) < 0) err(EX_OSERR, "failed to allocate %s as a system counter in counting mode", counter_name); Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed Jun 6 02:48:09 2018 (r334701) @@ -194,7 +194,7 @@ CTASSERT(sizeof(struct pmclog_map_in) == PATH_MAX + CTASSERT(offsetof(struct pmclog_map_in,pl_pathname) == 4*4 + sizeof(uintfptr_t)); CTASSERT(sizeof(struct pmclog_map_out) == 4*4 + 2*sizeof(uintfptr_t)); -CTASSERT(sizeof(struct pmclog_pmcallocate) == 6*4); +CTASSERT(sizeof(struct pmclog_pmcallocate) == 8*4); CTASSERT(sizeof(struct pmclog_pmcattach) == 6*4 + PATH_MAX); CTASSERT(offsetof(struct pmclog_pmcattach,pl_pathname) == 6*4); CTASSERT(sizeof(struct pmclog_pmcdetach) == 6*4); @@ -991,6 +991,7 @@ pmclog_process_pmcallocate(struct pmc *pm) PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); PMCLOG_EMIT32(pm->pm_flags); + PMCLOG_EMIT64(pm->pm_sc.pm_reloadcount); ps = pmc_soft_ev_acquire(pm->pm_event); if (ps != NULL) PMCLOG_EMITSTRING(ps->ps_ev.pm_ev_name,PMC_NAME_MAX); @@ -1004,6 +1005,7 @@ pmclog_process_pmcallocate(struct pmc *pm) PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); PMCLOG_EMIT32(pm->pm_flags); + PMCLOG_EMIT64(pm->pm_sc.pm_reloadcount); PMCLOG_DESPATCH_SYNC(po); } } @@ -1050,11 +1052,15 @@ pmclog_process_proccreate(struct pmc_owner *po, struct if (sync) { PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMIT32(p->p_flag); + PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); + PMCLOG_EMIT32(p->p_flag); + PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); PMCLOG_DESPATCH(po); } @@ -1163,14 +1169,14 @@ pmclog_process_threadcreate(struct pmc_owner *po, stru PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); - PMCLOG_EMIT32(0); + PMCLOG_EMIT32(p->p_flag); PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { PMCLOG_RESERVE(po, THR_CREATE, sizeof(struct pmclog_threadcreate)); PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); - PMCLOG_EMIT32(0); + PMCLOG_EMIT32(p->p_flag); PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); PMCLOG_DESPATCH(po); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/sys/dev/hwpmc/hwpmc_mod.c Wed Jun 6 02:48:09 2018 (r334701) @@ -3925,6 +3925,12 @@ pmc_syscall_handler(struct thread *td, void *syscall_a pmc->pm_caps = caps; pmc->pm_flags = pa.pm_flags; + /* XXX set lower bound on sampling for process counters */ + if (PMC_IS_SAMPLING_MODE(mode)) + pmc->pm_sc.pm_reloadcount = pa.pm_count; + else + pmc->pm_sc.pm_initial = pa.pm_count; + /* switch thread to CPU 'cpu' */ pmc_save_cpu_binding(&pb); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed Jun 6 01:51:05 2018 (r334700) +++ head/sys/sys/pmc.h Wed Jun 6 02:48:09 2018 (r334701) @@ -61,8 +61,8 @@ * * The patch version is incremented for every bug fix. */ -#define PMC_VERSION_MAJOR 0x06 -#define PMC_VERSION_MINOR 0x02 +#define PMC_VERSION_MAJOR 0x07 +#define PMC_VERSION_MINOR 0x03 #define PMC_VERSION_PATCH 0x0000 #define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \ @@ -439,6 +439,7 @@ struct pmc_op_pmcallocate { uint32_t pm_flags; /* additional modifiers PMC_F_* */ enum pmc_mode pm_mode; /* desired mode */ pmc_id_t pm_pmcid; /* [return] process pmc id */ + pmc_value_t pm_count; /* initial/sample count */ union pmc_md_op_pmcallocate pm_md; /* MD layer extensions */ }; Modified: head/sys/sys/pmclog.h ============================================================================== --- head/sys/sys/pmclog.h Wed Jun 6 01:51:05 2018 (r334700) +++ head/sys/sys/pmclog.h Wed Jun 6 02:48:09 2018 (r334701) @@ -162,6 +162,7 @@ struct pmclog_pmcallocate { uint32_t pl_pmcid; uint32_t pl_event; uint32_t pl_flags; + uint64_t pl_rate; } __packed; struct pmclog_pmcattach { @@ -190,6 +191,8 @@ struct pmclog_proccsw { struct pmclog_proccreate { PMCLOG_ENTRY_HEADER uint32_t pl_pid; + uint32_t pl_flags; + uint32_t pl_pad; uint64_t pl_pcomm[MAXCOMLEN+1]; /* keep 8 byte aligned */ } __packed; @@ -226,7 +229,7 @@ struct pmclog_threadcreate { PMCLOG_ENTRY_HEADER uint32_t pl_tid; uint32_t pl_pid; - uint32_t pl_pad; + uint32_t pl_flags; uint64_t pl_tdname[MAXCOMLEN+1]; /* keep 8 byte aligned */ } __packed; Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmc/Makefile Wed Jun 6 02:48:09 2018 (r334701) @@ -5,11 +5,12 @@ .include PROG_CXX= pmc MAN= -CXXFLAGS+= -O0 +CXXFLAGS+= LIBADD= kvm pmc m ncursesw pmcstat elf SRCS= pmc.c pmc_util.c cmd_pmc_stat.c \ - cmd_pmc_list.c cmd_pmc_filter.cc + cmd_pmc_list.c cmd_pmc_filter.cc \ + cmd_pmc_summary.cc .include Modified: head/usr.sbin/pmc/cmd_pmc.h ============================================================================== --- head/usr.sbin/pmc/cmd_pmc.h Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmc/cmd_pmc.h Wed Jun 6 02:48:09 2018 (r334701) @@ -47,6 +47,7 @@ extern "C" { int cmd_pmc_filter(int, char **); int cmd_pmc_stat_system(int, char **); int cmd_pmc_list_events(int, char **); + int cmd_pmc_summary(int, char **); #if defined(__cplusplus) }; #endif Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.cc Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Wed Jun 6 02:48:09 2018 (r334701) @@ -70,13 +70,12 @@ __FBSDID("$FreeBSD$"); #include #include -#if _LIBCPP_STD_VER >= 11 #include + using std::unordered_map; -#else -#include -using std::tr1::unordered_map; -#endif +typedef unordered_map idmap; +typedef std::pair identry; + #define LIST_MAX 64 static struct option longopts[] = { {"lwps", required_argument, NULL, 't'}, @@ -158,10 +157,6 @@ struct pmcid_ent { (PMCLOG_TYPE_ ## T << 16) | \ ((L) & 0xFFFF)) - -typedef unordered_map < int ,std::string > idmap; -typedef std::pair < int ,std::string > identry; - static bool pmc_find_name(idmap & map, uint32_t id, char *list[LIST_MAX], int count) { @@ -234,9 +229,9 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui copies = 0; while (pmclog_read(ps, &ev) == 0) { if (ev.pl_type == PMCLOG_TYPE_THR_CREATE) - tidmap.insert(identry(ev.pl_u.pl_tc.pl_tid, ev.pl_u.pl_tc.pl_tdname)); + tidmap[ev.pl_u.pl_tc.pl_tid] = ev.pl_u.pl_tc.pl_tdname; if (ev.pl_type == PMCLOG_TYPE_PROC_CREATE) - pidmap.insert(identry(ev.pl_u.pl_pc.pl_pid, ev.pl_u.pl_pc.pl_pcomm)); + pidmap[ev.pl_u.pl_pc.pl_pid] = ev.pl_u.pl_pc.pl_pcomm; if (ev.pl_type != PMCLOG_TYPE_CALLCHAIN) { if (write(outfd, ev.pl_data, ev.pl_len) != (ssize_t)ev.pl_len) errx(EX_OSERR, "ERROR: failed output write"); Modified: head/usr.sbin/pmc/cmd_pmc_stat.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_stat.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmc/cmd_pmc_stat.c Wed Jun 6 02:48:09 2018 (r334701) @@ -354,7 +354,7 @@ pmc_stat_internal(int argc, char **argv, int system_mo STAILQ_FOREACH(ev, &pmc_args.pa_events, ev_next) { if (pmc_allocate(ev->ev_spec, ev->ev_mode, - ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid) < 0) + ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid, ev->ev_count) < 0) err(EX_OSERR, "ERROR: Cannot allocate %s-mode pmc with specification \"%s\"", PMC_IS_SYSTEM_MODE(ev->ev_mode) ? Added: head/usr.sbin/pmc/cmd_pmc_summary.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmc/cmd_pmc_summary.cc Wed Jun 6 02:48:09 2018 (r334701) @@ -0,0 +1,220 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "cmd_pmc.h" + +#include +#include +#include +#include + +using std::unordered_map; +typedef unordered_map idmap; +typedef unordered_map intmap; +typedef unordered_map strintmap; +typedef std::pair sampleid; +typedef std::pair samplename; +typedef unordered_map > eventcountmap; + +#define P_KPROC 0x00004 /* Kernel process. */ + +static void +usage(void) +{ + errx(EX_USAGE, + "\t summarize log file\n" + "\t -k , --topk show topk processes for each counter\n" + ); +} + +static int +pmc_summary_handler(int logfd, int k, bool do_full) +{ + struct pmclog_parse_state *ps; + struct pmclog_ev ev; + idmap pidmap, tidmap, eventnamemap; + strintmap tideventmap, pideventmap; + intmap eventmap, pmcidmap, ratemap; + intmap kerntidmap, kernpidmap; + eventcountmap countmap; + + ps = static_cast(pmclog_open(logfd)); + if (ps == NULL) + errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", + strerror(errno)); + while (pmclog_read(ps, &ev) == 0) { + if (ev.pl_type == PMCLOG_TYPE_PMCALLOCATE) { + pmcidmap[ev.pl_u.pl_a.pl_pmcid] = ev.pl_u.pl_a.pl_event; + ratemap[ev.pl_u.pl_a.pl_event] = ev.pl_u.pl_a.pl_rate; + eventnamemap[ev.pl_u.pl_a.pl_event] = ev.pl_u.pl_a.pl_evname; + } + if (ev.pl_type == PMCLOG_TYPE_THR_CREATE) { + tidmap[ev.pl_u.pl_tc.pl_tid] = ev.pl_u.pl_tc.pl_tdname; + kerntidmap[ev.pl_u.pl_tc.pl_tid] = !!(ev.pl_u.pl_tc.pl_flags & P_KPROC); + if (tideventmap.find(ev.pl_u.pl_tc.pl_tdname) == tideventmap.end()) + tideventmap[ev.pl_u.pl_tc.pl_tdname] = intmap(); + } + if (ev.pl_type == PMCLOG_TYPE_PROC_CREATE) { + pidmap[ev.pl_u.pl_pc.pl_pid] = ev.pl_u.pl_pc.pl_pcomm; + kernpidmap[ev.pl_u.pl_pc.pl_pid] = !!(ev.pl_u.pl_pc.pl_flags & P_KPROC); + if (pideventmap.find(ev.pl_u.pl_pc.pl_pcomm) == pideventmap.end()) + pideventmap[ev.pl_u.pl_pc.pl_pcomm] = intmap(); + } + if (ev.pl_type == PMCLOG_TYPE_CALLCHAIN) { + auto event = pmcidmap[ev.pl_u.pl_cc.pl_pmcid]; + + if (event == 0) + continue; + eventmap[event]++; + auto tidname = tidmap.find(ev.pl_u.pl_cc.pl_tid); + auto pidname = pidmap.find(ev.pl_u.pl_cc.pl_pid); + if (tidname != tidmap.end()) { + auto &teventmap = tideventmap[tidname->second]; + teventmap[event]++; + } + if (pidname != pidmap.end()) { + auto &peventmap = pideventmap[pidname->second]; + peventmap[event]++; + } + } + } + for (auto &pkv : pideventmap) + for (auto &ekv : pkv.second) { + auto &samplevec = countmap[ekv.first]; + samplevec.emplace_back(ekv.second, pkv.first); + } + for (auto &kv : countmap) + std::sort(kv.second.begin(), kv.second.end(), [](auto &a, auto &b) {return (a.first < b.first);}); + if (do_full) { + for (auto &kv : countmap) { + auto &name = eventnamemap[kv.first]; + auto rate = ratemap[kv.first]; + std::cout << "idx: " << kv.first << " name: " << name << " rate: " << rate << std::endl; + while (!kv.second.empty()) { + auto &val = kv.second.back(); + kv.second.pop_back(); + std::cout << val.second << ": " << val.first << std::endl; + } + } + return (0); + } + for (auto &kv : countmap) { + auto &name = eventnamemap[kv.first]; + auto rate = ratemap[kv.first]; + std::cout << name << ":" << std::endl; + for (auto i = 0; i < k; i++) { + auto largest = kv.second.back(); + kv.second.pop_back(); + std::cout << "\t" << largest.second << ": " << largest.first*rate << std::endl; + } + } + return (0); +} + +static struct option longopts[] = { + {"full", no_argument, NULL, 'f'}, + {"topk", required_argument, NULL, 'k'}, + {NULL, 0, NULL, 0} +}; + +int +cmd_pmc_summary(int argc, char **argv) +{ + int option, logfd, k; + bool do_full; + + do_full = false; + k = 5; + while ((option = getopt_long(argc, argv, "k:f", longopts, NULL)) != -1) { + switch (option) { + case 'f': + do_full = 1; + break; + case 'k': + k = atoi(optarg); + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (argc != 1) { + printf("argc: %d\n", argc); + for (int i = 0; i < argc; i++) + printf("%s\n", argv[i]); + usage(); + } + if ((logfd = open(argv[0], O_RDONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) + errx(EX_OSERR, "ERROR: Cannot open \"%s\" for reading: %s.", argv[0], + strerror(errno)); + + return (pmc_summary_handler(logfd, k, do_full)); +} Modified: head/usr.sbin/pmc/pmc.c ============================================================================== --- head/usr.sbin/pmc/pmc.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmc/pmc.c Wed Jun 6 02:48:09 2018 (r334701) @@ -66,6 +66,7 @@ static struct cmd_handler disp_table[] = { {"stat-system", cmd_pmc_stat_system}, {"list-events", cmd_pmc_list_events}, {"filter", cmd_pmc_filter}, + {"summary", cmd_pmc_summary}, {NULL, NULL} }; Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Jun 6 01:51:05 2018 (r334700) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Jun 6 02:48:09 2018 (r334701) @@ -1129,7 +1129,8 @@ main(int argc, char **argv) STAILQ_FOREACH(ev, &args.pa_events, ev_next) { if (pmc_allocate(ev->ev_spec, ev->ev_mode, - ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid) < 0) + ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid, + ev->ev_count) < 0) err(EX_OSERR, "ERROR: Cannot allocate %s-mode pmc with specification \"%s\"", PMC_IS_SYSTEM_MODE(ev->ev_mode) ? From owner-svn-src-head@freebsd.org Wed Jun 6 02:54:21 2018 Return-Path: Delivered-To: svn-src-head@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 65299FDDE63; Wed, 6 Jun 2018 02:54:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id AC37F7FC98; Wed, 6 Jun 2018 02:54:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 411C642A6CF; Wed, 6 Jun 2018 12:54:18 +1000 (AEST) Date: Wed, 6 Jun 2018 12:54:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334669 - head/sys/sys In-Reply-To: Message-ID: <20180606122034.I994@besplex.bde.org> References: <201806052034.w55KYBsb096418@repo.freebsd.org> <1528232004.63685.25.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=i8ZEjPkR5nfDrTPL43oA:9 a=dMDrLXoxEuWxAglj:21 a=xJ1qA4LxLCKInB2S:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 02:54:21 -0000 On Tue, 5 Jun 2018, Eric van Gyzen wrote: > On 06/05/2018 15:53, Ian Lepore wrote: >> On Tue, 2018-06-05 at 20:34 +0000, Eric van Gyzen wrote: >>> Author: vangyzen >>> Date: Tue Jun\xc2\xa0\xc2\xa05 20:34:11 2018 >>> New Revision: 334669 >>> URL: https://svnweb.freebsd.org/changeset/base/334669 >>> >>> Log: >>> \xc2\xa0 Make Coverity more happy with r334545 >>> \xc2\xa0\xc2\xa0 >>> \xc2\xa0 Coverity complains about: >>> \xc2\xa0\xc2\xa0 >>> \xc2\xa0\xc2\xa0 if (((flags) & M_WAITOK) || _malloc_item != NULL) >>> \xc2\xa0\xc2\xa0 >>> \xc2\xa0 saying: >>> \xc2\xa0\xc2\xa0 >>> \xc2\xa0\xc2\xa0 The expression >>> \xc2\xa0\xc2\xa0 1 /* (2 | 0x100) & 2 */ || _malloc_item != NULL >>> \xc2\xa0\xc2\xa0 is suspicious because it performs a Boolean operation >>> \xc2\xa0\xc2\xa0 on a constant other than 0 or 1. >>> \xc2\xa0\xc2\xa0 >>> \xc2\xa0 Although the code is correct, add "!= 0" to make it slightly >>> \xc2\xa0 more legible and to silence hundreds(?) of Coverity warnings. >>> \xc2\xa0\xc2\xa0 >> This is a sad sad thing. Treating (bits & flagconstants) as boolean has >> a long long history in C. Surely there are literally thousand of >> occurrances in freebsd code already, so why did this one get flagged? Indded, it is a bug in Coverity. However, it is BSD style (counting instances in 4.4BSD kern, explicit comparison of the results of mask tests with 0 so as to convert to boolean are much more common if the test is for == 0 and slightly more common if the test is for != 0). However, this rule is violated in thousands if not millions of cases. It is most commonly violated for 'if (error)' which is not a natural boolean test so it needs the explicit comparison with 0 much more than a mask test. > I agree, and I tend to avoid adding "!= 0" unnecessarily, but I don't > feel very strongly about it. This macro is expanded in many locations, I used to feel very strongly that doing '!= 0' and '== 0' for mask tests was a style bug. Then I got used to BSD style and now don't mind '== 0' and merely don't like '!= 0'. In BSD style, it is doing the inverse mask tests as a boolean using '!' instead of using '== 0' that is the style bug. This makes a lot of sense -- the result of the expression (foo & MASK) is an integer, and the best way to convert that to boolean with negative logic is to compare it with '== 0'. Thus more common non-BSD style of !(foo & MASK) involves implicit conversion of an integer to a boolean. The bug in Coverity should cause a warning about that too. I still feel very strongly about 'if (error)' and 'if (!error)' for non- boolean error, so I think it is not a bug for Coverity to warn about these. However, the conversion for !error is the same as for !(foo & MASK). If this is not a bug in Coverity, then it is a bug in Coverity to not warn about implicit narrowing conversions from integer to bool (and implicit narrowing conversions generally). It is very convenient and usually safest to not have to use a cast for these. However, such conversions aren't very clear and have runtime costs. E.g, the 'if (error)' test can be written as 'bool e; e = error; if (e)'. If all the code is visible to the compiler, then it can optimize away the conversion and generate the same code. Otherwise, it must produce extra code to convert to 0 or 1. > so the number of Coverity warnings increased by hundreds in the most > recent run. I care about that more than avoiding "!= 0". I don't There are currently 736 instances if 'if (error)' in kern. Do you really wish to fix them all? There are currently only 659 instances of 'if (error != 0)' in kern, so the worse style is still more common for this. In kern in 4.4BSD, there were 68 instances of 'if (error)' and zero instances of 'if (error != 0)'. This shows both the bloat in -current and its drift from old styles. The total file size is only 8 times larger. Mask tests are harder to grep for. > sprinkle crap all over the code just to appease Coverity, but this one > seemed perfectly reasonable. It makes the code slightly more clear and > legible for some readers, and I imagine it doesn't hurt the others. > > Yes, there are probably many old occurrences of this, and there might be > many old corresponding warnings, but I tend to focus on the recently > added ones, just because they're more likely relevant. > > /me opens the static analysis can of worms...again Parts related to style should be separate and optional and usually not enabled by default. Bruce From owner-svn-src-head@freebsd.org Wed Jun 6 03:11:53 2018 Return-Path: Delivered-To: svn-src-head@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 C7058FDE6E6; Wed, 6 Jun 2018 03:11:52 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (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 5DD2D805C1; Wed, 6 Jun 2018 03:11:52 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id v83-v6so6159060itc.3; Tue, 05 Jun 2018 20:11:52 -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=oudXpLuCTFGbWy7fj9mUH5p7TtEIiyq7T3J/BAQkXDs=; b=Kp5OKJYM9ialUTCoRdf4+LPiJCUYMyXvYWyRG2RHSpyDeLdgFx0zAwbncuDSHZPuCe 0gUMkLsnMXsYKfR1CXis7ULG35GWl+3MxF/Vk/QNBFkpdbYYqQcLI5GaEC3LbTom+9pz RxNEvF78lt9K85f08izhNc5toLSANpIkv9WVolN25RH/YYGgJ2WkufQljaCpFdAjLXmP U0YODIgzc9pPoeoOqu6Se/XGRhilsxVmtZHgpJwzB05swTblbjidWXZDuPxbM1+0teDv vkJs1570oJF3e8VWX/SBJu9aYAgD+hkoP9czpL338iogmZUWn98UurbcyHiWzkTu/l+0 aEvg== 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=oudXpLuCTFGbWy7fj9mUH5p7TtEIiyq7T3J/BAQkXDs=; b=TQQeV8QVS7IqgubPhAWRyKjGw4t8abXWmddVTApYH36qGDqlAzijCC9Yc8uEv2u1Mr 2X3htXC2yorrFlqJth+xlyE4TVGo1kw8/qKDhr8hn8Yw/o2JBpCSjr8qv7icTAS1V5D0 MzFQCFSBvgaoIIA8xZ8pLbXAiTSM+kONKquV8kndJJ+UZ9IsYywbEJWpP27MM+80Gh15 qgAXZslFmfS2+biImG2gA4h/ZpkLliCyKxSKouSJcri+Mz3khJAjr5+6UP4nDuNQZMVh 2eoKTWrNL817QhfiNX58VqpiRl7BC9OIQ5GUi87Q5xpiI2YeD+NEw4LtrfuvD5GIH/Eu EIjA== X-Gm-Message-State: APt69E2RPwQ25V6jU1BoJxY31uE5DBA0LlbP0WTEx9lmgblm0QB4GjY7 Jj/ckhSA2xzM1yVAiJ+ZtMIqRtbzssESqkr6xEc8vA== X-Google-Smtp-Source: ADUXVKKW3sFPlUG8XX5riRf8FPHY86qyLDZekyWpbmUec/myU8n6P1pPv43ZuGSC0/Zgqwl2yPPZC9KHuqzjQqVN+kM= X-Received: by 2002:a24:2745:: with SMTP id g66-v6mr789793ita.77.1528254711213; Tue, 05 Jun 2018 20:11:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 20:11:50 -0700 (PDT) In-Reply-To: <201806052051.w55Kp2KB003843@repo.freebsd.org> References: <201806052051.w55Kp2KB003843@repo.freebsd.org> From: Matthew Macy Date: Tue, 5 Jun 2018 20:11:50 -0700 Message-ID: Subject: Re: svn commit: r334671 - in head/sys: net netinet netinet6 netipsec To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 03:11:53 -0000 This appears to have broken the NOINET build. --- ip6_gre.o --- cc -target i386-unknown-freebsd12.0 --sysroot=/home/mmacy/devel/build/home/mmacy/networking/i386.i386/tmp -B/home/mmacy/devel/build/home/mmacy/networking/i386.i386/tmp/usr/bin -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /home/mmacy/devel/build/home/mmacy/networking/i386.i386/sys/LINT-NOINET/opt_global.h -I. -I/home/mmacy/networking/sys -I/home/mmacy/networking/sys/contrib/ck/include -fno-common -I/home/mmacy/devel/build/home/mmacy/networking/i386.i386/sys/LINT-NOINET -fno-builtin -MD -MF.depend.ip6_gre.o -MTip6_gre.o -mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -c /home/mmacy/networking/sys/netinet6/ip6_gre.c -o ip6_gre.o /home/mmacy/networking/sys/netinet6/ip6_gre.c:125:40: error: invalid application of 'sizeof' to an incomplete type 'struct ip' .min_length = sizeof(struct greip6) + sizeof(struct ip), ^ ~~~~~~~~~~~ /home/mmacy/networking/sys/netinet6/ip6_gre.c:125:54: note: forward declaration of 'struct ip' .min_length = sizeof(struct greip6) + sizeof(struct ip), ^ 1 error generated. --- if_ath_led.o -- On Tue, Jun 5, 2018 at 1:51 PM, Andrey V. Elsukov wrote: > Author: ae > Date: Tue Jun 5 20:51:01 2018 > New Revision: 334671 > URL: https://svnweb.freebsd.org/changeset/base/334671 > > Log: > Rework IP encapsulation handling code. > > Currently it has several disadvantages: > - it uses single mutex to protect internal structures. It is used by > data- and control- path, thus there are no parallelism at all. > - it uses single list to keep encap handlers for both INET and INET6 > families. > - struct encaptab keeps unneeded information (src, dst, masks, protosw), > that isn't used by code in the source tree. > - matches are prioritized and when many tunneling interfaces are > registered, encapcheck handler of each interface is invoked for each > packet. The search takes O(n) for n interfaces. All this work is done > with exclusive lock held. > > What this patch includes: > - the datapath is converted to be lockless using epoch(9) KPI. > - struct encaptab now linked using CK_LIST. > - all unused fields removed from struct encaptab. Several new fields > addedr: min_length is the minimum packet length, that encapsulation > handler expects to see; exact_match is maximum number of bits, that > can return an encapsulation handler, when it wants to consume a packet. > - IPv6 and IPv4 handlers are stored in separate lists; > - added new "encap_lookup_t" method, that will be used later. It is > targeted to speedup lookup of needed interface, when gif(4)/gre(4) have > many interfaces. > - the need to use protosw structure is eliminated. The only pr_input > method was used from this structure, so I don't see the need to keep > using it. > - encap_input_t method changed to avoid using mbuf tags to store softc > pointer. Now it is passed directly trough encap_input_t method. > encap_getarg() funtions is removed. > - all sockaddr structures and code that uses them removed. We don't have > any code in the tree that uses them. All consumers use encap_attach_func() > method, that relies on invoking of encapcheck() to determine the needed > handler. > - introduced struct encap_config, it contains parameters of encap handler > that is going to be registered by encap_attach() function. > - encap handlers are stored in lists ordered by exact_match value, thus > handlers that need more bits to match will be checked first, and if > encapcheck method returns exact_match value, the search will be stopped. > - all current consumers changed to use new KPI. > > Reviewed by: mmacy > Sponsored by: Yandex LLC > Differential Revision: https://reviews.freebsd.org/D15617 > > Modified: > head/sys/net/if_gif.c > head/sys/net/if_gre.c > head/sys/net/if_gre.h > head/sys/net/if_me.c > head/sys/net/if_stf.c > head/sys/netinet/in_gif.c > head/sys/netinet/ip_encap.c > head/sys/netinet/ip_encap.h > head/sys/netinet/ip_gre.c > head/sys/netinet/ip_mroute.c > head/sys/netinet/pim_var.h > head/sys/netinet6/in6_gif.c > head/sys/netinet6/ip6_gre.c > head/sys/netinet6/ip6_mroute.c > head/sys/netinet6/pim6_var.h > head/sys/netipsec/xform_ipcomp.c > > Modified: head/sys/net/if_gif.c > ============================================================================== > --- head/sys/net/if_gif.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/net/if_gif.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -923,12 +923,24 @@ bad: > } > > static void > -gif_detach(struct gif_softc *sc) > +gif_detach(struct gif_softc *sc, int family) > { > > sx_assert(&gif_ioctl_sx, SA_XLOCKED); > - if (sc->gif_ecookie != NULL) > - encap_detach(sc->gif_ecookie); > + if (sc->gif_ecookie != NULL) { > + switch (family) { > +#ifdef INET > + case AF_INET: > + ip_encap_detach(sc->gif_ecookie); > + break; > +#endif > +#ifdef INET6 > + case AF_INET6: > + ip6_encap_detach(sc->gif_ecookie); > + break; > +#endif > + } > + } > sc->gif_ecookie = NULL; > } > > @@ -1020,7 +1032,7 @@ gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src > } > > if (sc->gif_family != src->sa_family) > - gif_detach(sc); > + gif_detach(sc, sc->gif_family); > if (sc->gif_family == 0 || > sc->gif_family != src->sa_family) > error = gif_attach(sc, src->sa_family); > @@ -1058,7 +1070,7 @@ gif_delete_tunnel(struct ifnet *ifp) > sc->gif_family = 0; > GIF_WUNLOCK(sc); > if (family != 0) { > - gif_detach(sc); > + gif_detach(sc, family); > free(sc->gif_hdr, M_GIF); > } > ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > > Modified: head/sys/net/if_gre.c > ============================================================================== > --- head/sys/net/if_gre.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/net/if_gre.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -551,12 +551,24 @@ gre_updatehdr(struct gre_softc *sc) > } > > static void > -gre_detach(struct gre_softc *sc) > +gre_detach(struct gre_softc *sc, int family) > { > > sx_assert(&gre_ioctl_sx, SA_XLOCKED); > - if (sc->gre_ecookie != NULL) > - encap_detach(sc->gre_ecookie); > + if (sc->gre_ecookie != NULL) { > + switch (family) { > +#ifdef INET > + case AF_INET: > + ip_encap_detach(sc->gre_ecookie); > + break; > +#endif > +#ifdef INET6 > + case AF_INET6: > + ip6_encap_detach(sc->gre_ecookie); > + break; > +#endif > + } > + } > sc->gre_ecookie = NULL; > } > > @@ -624,7 +636,7 @@ gre_set_tunnel(struct ifnet *ifp, struct sockaddr *src > return (EAFNOSUPPORT); > } > if (sc->gre_family != 0) > - gre_detach(sc); > + gre_detach(sc, sc->gre_family); > GRE_WLOCK(sc); > if (sc->gre_family != 0) > free(sc->gre_hdr, M_GRE); > @@ -666,7 +678,7 @@ gre_delete_tunnel(struct ifnet *ifp) > sc->gre_family = 0; > GRE_WUNLOCK(sc); > if (family != 0) { > - gre_detach(sc); > + gre_detach(sc, family); > free(sc->gre_hdr, M_GRE); > } > ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > @@ -674,12 +686,11 @@ gre_delete_tunnel(struct ifnet *ifp) > } > > int > -gre_input(struct mbuf **mp, int *offp, int proto) > +gre_input(struct mbuf *m, int off, int proto, void *arg) > { > - struct gre_softc *sc; > + struct gre_softc *sc = arg; > struct grehdr *gh; > struct ifnet *ifp; > - struct mbuf *m; > uint32_t *opts; > #ifdef notyet > uint32_t key; > @@ -687,12 +698,8 @@ gre_input(struct mbuf **mp, int *offp, int proto) > uint16_t flags; > int hlen, isr, af; > > - m = *mp; > - sc = encap_getarg(m); > - KASSERT(sc != NULL, ("encap_getarg returned NULL")); > - > ifp = GRE2IFP(sc); > - hlen = *offp + sizeof(struct grehdr) + 4 * sizeof(uint32_t); > + hlen = off + sizeof(struct grehdr) + 4 * sizeof(uint32_t); > if (m->m_pkthdr.len < hlen) > goto drop; > if (m->m_len < hlen) { > @@ -700,7 +707,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) > if (m == NULL) > goto drop; > } > - gh = (struct grehdr *)mtodo(m, *offp); > + gh = (struct grehdr *)mtodo(m, off); > flags = ntohs(gh->gre_flags); > if (flags & ~GRE_FLAGS_MASK) > goto drop; > @@ -710,7 +717,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) > /* reserved1 field must be zero */ > if (((uint16_t *)opts)[1] != 0) > goto drop; > - if (in_cksum_skip(m, m->m_pkthdr.len, *offp) != 0) > + if (in_cksum_skip(m, m->m_pkthdr.len, off) != 0) > goto drop; > hlen += 2 * sizeof(uint16_t); > opts++; > @@ -760,7 +767,7 @@ gre_input(struct mbuf **mp, int *offp, int proto) > default: > goto drop; > } > - m_adj(m, *offp + hlen); > + m_adj(m, off + hlen); > m_clrprotoflags(m); > m->m_pkthdr.rcvif = ifp; > M_SETFIB(m, ifp->if_fib); > > Modified: head/sys/net/if_gre.h > ============================================================================== > --- head/sys/net/if_gre.h Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/net/if_gre.h Tue Jun 5 20:51:01 2018 (r334671) > @@ -101,7 +101,7 @@ struct gre_softc { > #define gre_oip gre_gihdr->gi_ip > #define gre_oip6 gre_gi6hdr->gi6_ip6 > > -int gre_input(struct mbuf **, int *, int); > +int gre_input(struct mbuf *, int, int, void *); > #ifdef INET > int in_gre_attach(struct gre_softc *); > int in_gre_output(struct mbuf *, int, int); > > Modified: head/sys/net/if_me.c > ============================================================================== > --- head/sys/net/if_me.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/net/if_me.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > @@ -122,12 +121,23 @@ static int me_transmit(struct ifnet *, struct mbuf *); > static int me_ioctl(struct ifnet *, u_long, caddr_t); > static int me_output(struct ifnet *, struct mbuf *, > const struct sockaddr *, struct route *); > -static int me_input(struct mbuf **, int *, int); > +static int me_input(struct mbuf *, int, int, void *); > > static int me_set_tunnel(struct ifnet *, struct sockaddr_in *, > struct sockaddr_in *); > static void me_delete_tunnel(struct ifnet *); > +static int me_encapcheck(const struct mbuf *, int, int, void *); > > +#define ME_MINLEN (sizeof(struct ip) + sizeof(struct mobhdr) -\ > + sizeof(in_addr_t)) > +static const struct encap_config ipv4_encap_cfg = { > + .proto = IPPROTO_MOBILE, > + .min_length = ME_MINLEN, > + .exact_match = (sizeof(in_addr_t) << 4) + 8, > + .check = me_encapcheck, > + .input = me_input > +}; > + > SYSCTL_DECL(_net_link); > static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW, 0, > "Minimal Encapsulation for IP (RFC 2004)"); > @@ -140,19 +150,6 @@ static VNET_DEFINE(int, max_me_nesting) = MAX_ME_NEST; > SYSCTL_INT(_net_link_me, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, > &VNET_NAME(max_me_nesting), 0, "Max nested tunnels"); > > -extern struct domain inetdomain; > -static const struct protosw in_mobile_protosw = { > - .pr_type = SOCK_RAW, > - .pr_domain = &inetdomain, > - .pr_protocol = IPPROTO_MOBILE, > - .pr_flags = PR_ATOMIC|PR_ADDR, > - .pr_input = me_input, > - .pr_output = rip_output, > - .pr_ctlinput = rip_ctlinput, > - .pr_ctloutput = rip_ctloutput, > - .pr_usrreqs = &rip_usrreqs > -}; > - > static void > vnet_me_init(const void *unused __unused) > { > @@ -334,17 +331,13 @@ me_encapcheck(const struct mbuf *m, int off, int proto > > M_ASSERTPKTHDR(m); > > - if (m->m_pkthdr.len < sizeof(struct ip) + sizeof(struct mobhdr) - > - sizeof(struct in_addr)) > - return (0); > - > ret = 0; > ME_RLOCK(sc); > if (ME_READY(sc)) { > ip = mtod(m, struct ip *); > if (sc->me_src.s_addr == ip->ip_dst.s_addr && > sc->me_dst.s_addr == ip->ip_src.s_addr) > - ret = 32 * 2; > + ret = 32 * 2 + 8; > } > ME_RUNLOCK(sc); > return (ret); > @@ -376,8 +369,8 @@ me_set_tunnel(struct ifnet *ifp, struct sockaddr_in *s > ME_WUNLOCK(sc); > > if (sc->me_ecookie == NULL) > - sc->me_ecookie = encap_attach_func(AF_INET, IPPROTO_MOBILE, > - me_encapcheck, &in_mobile_protosw, sc); > + sc->me_ecookie = ip_encap_attach(&ipv4_encap_cfg, > + sc, M_WAITOK); > if (sc->me_ecookie != NULL) { > ifp->if_drv_flags |= IFF_DRV_RUNNING; > if_link_state_change(ifp, LINK_STATE_UP); > @@ -392,7 +385,7 @@ me_delete_tunnel(struct ifnet *ifp) > > sx_assert(&me_ioctl_sx, SA_XLOCKED); > if (sc->me_ecookie != NULL) > - encap_detach(sc->me_ecookie); > + ip_encap_detach(sc->me_ecookie); > sc->me_ecookie = NULL; > ME_WLOCK(sc); > sc->me_src.s_addr = 0; > @@ -414,19 +407,14 @@ me_in_cksum(uint16_t *p, int nwords) > return (~sum); > } > > -int > -me_input(struct mbuf **mp, int *offp, int proto) > +static int > +me_input(struct mbuf *m, int off, int proto, void *arg) > { > - struct me_softc *sc; > + struct me_softc *sc = arg; > struct mobhdr *mh; > struct ifnet *ifp; > - struct mbuf *m; > struct ip *ip; > int hlen; > - > - m = *mp; > - sc = encap_getarg(m); > - KASSERT(sc != NULL, ("encap_getarg returned NULL")); > > ifp = ME2IFP(sc); > /* checks for short packets */ > > Modified: head/sys/net/if_stf.c > ============================================================================== > --- head/sys/net/if_stf.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/net/if_stf.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -85,7 +85,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -151,19 +150,7 @@ static const char stfname[] = "stf"; > static MALLOC_DEFINE(M_STF, stfname, "6to4 Tunnel Interface"); > static const int ip_stf_ttl = 40; > > -extern struct domain inetdomain; > -static int in_stf_input(struct mbuf **, int *, int); > -static struct protosw in_stf_protosw = { > - .pr_type = SOCK_RAW, > - .pr_domain = &inetdomain, > - .pr_protocol = IPPROTO_IPV6, > - .pr_flags = PR_ATOMIC|PR_ADDR, > - .pr_input = in_stf_input, > - .pr_output = rip_output, > - .pr_ctloutput = rip_ctloutput, > - .pr_usrreqs = &rip_usrreqs > -}; > - > +static int in_stf_input(struct mbuf *, int, int, void *); > static char *stfnames[] = {"stf0", "stf", "6to4", NULL}; > > static int stfmodevent(module_t, int, void *); > @@ -183,6 +170,14 @@ static int stf_clone_create(struct if_clone *, char *, > static int stf_clone_destroy(struct if_clone *, struct ifnet *); > static struct if_clone *stf_cloner; > > +static const struct encap_config ipv4_encap_cfg = { > + .proto = IPPROTO_IPV6, > + .min_length = sizeof(struct ip), > + .exact_match = (sizeof(in_addr_t) << 3) + 8, > + .check = stf_encapcheck, > + .input = in_stf_input > +}; > + > static int > stf_clone_match(struct if_clone *ifc, const char *name) > { > @@ -250,8 +245,7 @@ stf_clone_create(struct if_clone *ifc, char *name, siz > ifp->if_dname = stfname; > ifp->if_dunit = IF_DUNIT_NONE; > > - sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, > - stf_encapcheck, &in_stf_protosw, sc); > + sc->encap_cookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); > if (sc->encap_cookie == NULL) { > if_printf(ifp, "attach failed\n"); > free(sc, M_STF); > @@ -274,7 +268,7 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet * > struct stf_softc *sc = ifp->if_softc; > int err __unused; > > - err = encap_detach(sc->encap_cookie); > + err = ip_encap_detach(sc->encap_cookie); > KASSERT(err == 0, ("Unexpected error detaching encap_cookie")); > bpfdetach(ifp); > if_detach(ifp); > @@ -608,28 +602,20 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr * > } > > static int > -in_stf_input(struct mbuf **mp, int *offp, int proto) > +in_stf_input(struct mbuf *m, int off, int proto, void *arg) > { > - struct stf_softc *sc; > + struct stf_softc *sc = arg; > struct ip *ip; > struct ip6_hdr *ip6; > - struct mbuf *m; > u_int8_t otos, itos; > struct ifnet *ifp; > - int off; > > - m = *mp; > - off = *offp; > - > if (proto != IPPROTO_IPV6) { > m_freem(m); > return (IPPROTO_DONE); > } > > ip = mtod(m, struct ip *); > - > - sc = (struct stf_softc *)encap_getarg(m); > - > if (sc == NULL || (STF2IFP(sc)->if_flags & IFF_UP) == 0) { > m_freem(m); > return (IPPROTO_DONE); > @@ -680,7 +666,7 @@ in_stf_input(struct mbuf **mp, int *offp, int proto) > ip6->ip6_flow |= htonl((u_int32_t)itos << 20); > > m->m_pkthdr.rcvif = ifp; > - > + > if (bpf_peers_present(ifp->if_bpf)) { > /* > * We need to prepend the address family as > > Modified: head/sys/netinet/in_gif.c > ============================================================================== > --- head/sys/netinet/in_gif.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/netinet/in_gif.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > > #include > @@ -70,25 +69,11 @@ __FBSDID("$FreeBSD$"); > > #include > > -static int in_gif_input(struct mbuf **, int *, int); > - > -extern struct domain inetdomain; > -static struct protosw in_gif_protosw = { > - .pr_type = SOCK_RAW, > - .pr_domain = &inetdomain, > - .pr_protocol = 0/* IPPROTO_IPV[46] */, > - .pr_flags = PR_ATOMIC|PR_ADDR, > - .pr_input = in_gif_input, > - .pr_output = rip_output, > - .pr_ctloutput = rip_ctloutput, > - .pr_usrreqs = &rip_usrreqs > -}; > - > #define GIF_TTL 30 > static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; > #define V_ip_gif_ttl VNET(ip_gif_ttl) > SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, > - &VNET_NAME(ip_gif_ttl), 0, ""); > + &VNET_NAME(ip_gif_ttl), 0, "Default TTL value for encapsulated packets"); > > int > in_gif_output(struct ifnet *ifp, struct mbuf *m, int proto, uint8_t ecn) > @@ -136,15 +121,13 @@ in_gif_output(struct ifnet *ifp, struct mbuf *m, int p > } > > static int > -in_gif_input(struct mbuf **mp, int *offp, int proto) > +in_gif_input(struct mbuf *m, int off, int proto, void *arg) > { > - struct mbuf *m = *mp; > - struct gif_softc *sc; > + struct gif_softc *sc = arg; > struct ifnet *gifp; > struct ip *ip; > uint8_t ecn; > > - sc = encap_getarg(m); > if (sc == NULL) { > m_freem(m); > KMOD_IPSTAT_INC(ips_nogif); > @@ -154,7 +137,7 @@ in_gif_input(struct mbuf **mp, int *offp, int proto) > if ((gifp->if_flags & IFF_UP) != 0) { > ip = mtod(m, struct ip *); > ecn = ip->ip_tos; > - m_adj(m, *offp); > + m_adj(m, off); > gif_input(m, gifp, proto, ecn); > } else { > m_freem(m); > @@ -182,7 +165,7 @@ in_gif_encapcheck(const struct mbuf *m, int off, int p > ip = mtod(m, const struct ip *); > if (sc->gif_iphdr->ip_src.s_addr != ip->ip_dst.s_addr) > return (0); > - ret = 32; > + ret = 32 + 8; /* src + proto */ > if (sc->gif_iphdr->ip_dst.s_addr != ip->ip_src.s_addr) { > if ((sc->gif_options & GIF_IGNORE_SOURCE) == 0) > return (0); > @@ -205,14 +188,19 @@ in_gif_encapcheck(const struct mbuf *m, int off, int p > return (ret); > } > > +static const struct encap_config ipv4_encap_cfg = { > + .proto = -1, > + .min_length = sizeof(struct ip), > + .exact_match = (sizeof(in_addr_t) << 4) + 8, > + .check = gif_encapcheck, > + .input = in_gif_input > +}; > + > int > in_gif_attach(struct gif_softc *sc) > { > > KASSERT(sc->gif_ecookie == NULL, ("gif_ecookie isn't NULL")); > - sc->gif_ecookie = encap_attach_func(AF_INET, -1, gif_encapcheck, > - &in_gif_protosw, sc); > - if (sc->gif_ecookie == NULL) > - return (EEXIST); > + sc->gif_ecookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); > return (0); > } > > Modified: head/sys/netinet/ip_encap.c > ============================================================================== > --- head/sys/netinet/ip_encap.c Tue Jun 5 20:41:06 2018 (r334670) > +++ head/sys/netinet/ip_encap.c Tue Jun 5 20:51:01 2018 (r334671) > @@ -4,6 +4,7 @@ > * SPDX-License-Identifier: BSD-3-Clause > * > * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. > + * Copyright (c) 2018 Andrey V. Elsukov > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -56,417 +57,214 @@ > * So, clearly good old protosw does not work for protocol #4 and #41. > * The code will let you match protocol via src/dst address pair. > */ > -/* XXX is M_NETADDR correct? */ > > #include > __FBSDID("$FreeBSD$"); > > -#include "opt_mrouting.h" > #include "opt_inet.h" > #include "opt_inet6.h" > > #include > #include > +#include > #include > +#include > #include > -#include > -#include > #include > #include > -#include > -#include > +#include > > #include > -#include > +#include > > #include > -#include > -#include > #include > #include > > #ifdef INET6 > -#include > #include > #endif > > -#include > +static MALLOC_DEFINE(M_NETADDR, "encap_export_host", > + "Export host address structure"); > > -#include > -#include > -static MALLOC_DEFINE(M_NETADDR, "encap_export_host", "Export host address structure"); > +struct encaptab { > + CK_LIST_ENTRY(encaptab) chain; > + int proto; > + int min_length; > + int exact_match; > + void *arg; > > -static void encap_add(struct encaptab *); > -static int mask_match(const struct encaptab *, const struct sockaddr *, > - const struct sockaddr *); > -static void encap_fillarg(struct mbuf *, void *); > + encap_lookup_t lookup; > + encap_check_t check; > + encap_input_t input; > +}; > > -/* > - * All global variables in ip_encap.c are locked using encapmtx. > - */ > +CK_LIST_HEAD(encaptab_head, encaptab); > +#ifdef INET > +static struct encaptab_head ipv4_encaptab = CK_LIST_HEAD_INITIALIZER(); > +#endif > +#ifdef INET6 > +static struct encaptab_head ipv6_encaptab = CK_LIST_HEAD_INITIALIZER(); > +#endif > + > static struct mtx encapmtx; > MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); > -static LIST_HEAD(, encaptab) encaptab = LIST_HEAD_INITIALIZER(encaptab); > +#define ENCAP_WLOCK() mtx_lock(&encapmtx) > +#define ENCAP_WUNLOCK() mtx_unlock(&encapmtx) > +#define ENCAP_RLOCK() epoch_enter_preempt(net_epoch_preempt) > +#define ENCAP_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) > +#define ENCAP_WAIT() epoch_wait_preempt(net_epoch_preempt) > > -#ifdef INET > -int > -encap4_input(struct mbuf **mp, int *offp, int proto) > +static struct encaptab * > +encap_attach(struct encaptab_head *head, const struct encap_config *cfg, > + void *arg, int mflags) > { > - struct ip *ip; > - struct mbuf *m; > - struct sockaddr_in s, d; > - const struct protosw *psw; > - struct encaptab *ep, *match; > - void *arg; > - int matchprio, off, prio; > + struct encaptab *ep, *tmp; > > - m = *mp; > - off = *offp; > - ip = mtod(m, struct ip *); > + if (cfg == NULL || cfg->input == NULL || > + (cfg->check == NULL && cfg->lookup == NULL) || > + (cfg->lookup != NULL && cfg->exact_match != ENCAP_DRV_LOOKUP) || > + (cfg->exact_match == ENCAP_DRV_LOOKUP && cfg->lookup == NULL)) > + return (NULL); > > - bzero(&s, sizeof(s)); > - s.sin_family = AF_INET; > - s.sin_len = sizeof(struct sockaddr_in); > - s.sin_addr = ip->ip_src; > - bzero(&d, sizeof(d)); > - d.sin_family = AF_INET; > - d.sin_len = sizeof(struct sockaddr_in); > - d.sin_addr = ip->ip_dst; > + ep = malloc(sizeof(*ep), M_NETADDR, mflags); > + if (ep == NULL) > + return (NULL); > > - arg = NULL; > - psw = NULL; > - match = NULL; > - matchprio = 0; > - mtx_lock(&encapmtx); > - LIST_FOREACH(ep, &encaptab, chain) { > - if (ep->af != AF_INET) > - continue; > - if (ep->proto >= 0 && ep->proto != proto) > - continue; > - if (ep->func) > - prio = (*ep->func)(m, off, proto, ep->arg); > - else { > - /* > - * it's inbound traffic, we need to match in reverse > - * order > - */ > - prio = mask_match(ep, (struct sockaddr *)&d, > - (struct sockaddr *)&s); > - } > + ep->proto = cfg->proto; > + ep->min_length = cfg->min_length; > + ep->exact_match = cfg->exact_match; > + ep->arg = arg; > + ep->lookup = cfg->exact_match == ENCAP_DRV_LOOKUP ? cfg->lookup: NULL; > + ep->check = cfg->exact_match != ENCAP_DRV_LOOKUP ? cfg->check: NULL; > + ep->input = cfg->input; > > - /* > - * We prioritize the matches by using bit length of the > - * matches. mask_match() and user-supplied matching function > - * should return the bit length of the matches (for example, > - * if both src/dst are matched for IPv4, 64 should be returned). > - * 0 or negative return value means "it did not match". > - * > - * The question is, since we have two "mask" portion, we > - * cannot really define total order between entries. > - * For example, which of these should be preferred? > - * mask_match() returns 48 (32 + 16) for both of them. > - * src=3ffe::/16, dst=3ffe:501::/32 > - * src=3ffe:501::/32, dst=3ffe::/16 > - * > - * We need to loop through all the possible candidates > - * to get the best match - the search takes O(n) for > - * n attachments (i.e. interfaces). > - */ > - if (prio <= 0) > - continue; > - if (prio > matchprio) { > - matchprio = prio; > - match = ep; > - } > + ENCAP_WLOCK(); > + CK_LIST_FOREACH(tmp, head, chain) { > + if (tmp->exact_match <= ep->exact_match) > + break; > } > - if (match != NULL) { > - psw = match->psw; > - arg = match->arg; > - } > - mtx_unlock(&encapmtx); > + if (tmp == NULL) > + CK_LIST_INSERT_HEAD(head, ep, chain); > + else > + CK_LIST_INSERT_BEFORE(tmp, ep, chain); > + ENCAP_WUNLOCK(); > + return (ep); > +} > > - if (match != NULL) { > - /* found a match, "match" has the best one */ > - if (psw != NULL && psw->pr_input != NULL) { > - encap_fillarg(m, arg); > - (*psw->pr_input)(mp, offp, proto); > - } else > - m_freem(m); > - return (IPPROTO_DONE); > - } > +static int > +encap_detach(struct encaptab_head *head, const struct encaptab *cookie) > +{ > + struct encaptab *ep; > > - /* last resort: inject to raw socket */ > - return (rip_input(mp, offp, proto)); > + ENCAP_WLOCK(); > + CK_LIST_FOREACH(ep, head, chain) { > + if (ep == cookie) { > + CK_LIST_REMOVE(ep, chain); > + ENCAP_WUNLOCK(); > + ENCAP_WAIT(); > + free(ep, M_NETADDR); > + return (0); > + } > + } > + ENCAP_WUNLOCK(); > + return (EINVAL); > } > -#endif > > -#ifdef INET6 > -int > -encap6_input(struct mbuf **mp, int *offp, int proto) > +static int > +encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) > { > - struct mbuf *m = *mp; > - struct ip6_hdr *ip6; > - struct sockaddr_in6 s, d; > - const struct protosw *psw; > struct encaptab *ep, *match; > void *arg; > - int prio, matchprio; > + int matchprio, ret; > > - ip6 = mtod(m, struct ip6_hdr *); > - > - bzero(&s, sizeof(s)); > - s.sin6_family = AF_INET6; > - s.sin6_len = sizeof(struct sockaddr_in6); > - s.sin6_addr = ip6->ip6_src; > - bzero(&d, sizeof(d)); > - d.sin6_family = AF_INET6; > - d.sin6_len = sizeof(struct sockaddr_in6); > - d.sin6_addr = ip6->ip6_dst; > - > - arg = NULL; > - psw = NULL; > match = NULL; > matchprio = 0; > - mtx_lock(&encapmtx); > - LIST_FOREACH(ep, &encaptab, chain) { > - if (ep->af != AF_INET6) > - continue; > + > + ENCAP_RLOCK(); > + CK_LIST_FOREACH(ep, head, chain) { > if (ep->proto >= 0 && ep->proto != proto) > continue; > - if (ep->func) > - prio = (*ep->func)(m, *offp, proto, ep->arg); > - else { > + if (ep->min_length > m->m_pkthdr.len) > + continue; > + if (ep->exact_match == ENCAP_DRV_LOOKUP) > + ret = (*ep->lookup)(m, off, proto, &arg); > + else > + ret = (*ep->check)(m, off, proto, ep->arg); > + if (ret <= 0) > + continue; > + if (ret > matchprio) { > + match = ep; > + if (ep->exact_match != ENCAP_DRV_LOOKUP) > + arg = ep->arg; > /* > - * it's inbound traffic, we need to match in reverse > - * order > + * No need to continue the search, we got the > + * exact match. > */ > - prio = mask_match(ep, (struct sockaddr *)&d, > - (struct sockaddr *)&s); > + if (ret >= ep->exact_match) > + break; > + matchprio = ret; > } > - > - /* see encap4_input() for issues here */ > - if (prio <= 0) > - continue; > - if (prio > matchprio) { > - matchprio = prio; > - match = ep; > - } > } > - if (match != NULL) { > - psw = match->psw; > - arg = match->arg; > - } > - mtx_unlock(&encapmtx); > > if (match != NULL) { > - /* found a match */ > - if (psw != NULL && psw->pr_input != NULL) { > - encap_fillarg(m, arg); > - return (*psw->pr_input)(mp, offp, proto); > - } else { > - m_freem(m); > - return (IPPROTO_DONE); > - } > + /* found a match, "match" has the best one */ > + ret = (*match->input)(m, off, proto, arg); > + ENCAP_RUNLOCK(); > + MPASS(ret == IPPROTO_DONE); > + return (IPPROTO_DONE); > } > - > - /* last resort: inject to raw socket */ > - return rip6_input(mp, offp, proto); > + ENCAP_RUNLOCK(); > + return (0); > } > -#endif > > -/*lint -sem(encap_add, custodial(1)) */ > -static void > -encap_add(struct encaptab *ep) > -{ > - > - mtx_assert(&encapmtx, MA_OWNED); > - LIST_INSERT_HEAD(&encaptab, ep, chain); > -} > - > -/* > - * sp (src ptr) is always my side, and dp (dst ptr) is always remote side. > - * length of mask (sm and dm) is assumed to be same as sp/dp. > - * Return value will be necessary as input (cookie) for encap_detach(). > - */ > +#ifdef INET > const struct encaptab * > -encap_attach(int af, int proto, const struct sockaddr *sp, > - const struct sockaddr *sm, const struct sockaddr *dp, > - const struct sockaddr *dm, const struct protosw *psw, void *arg) > +ip_encap_attach(const struct encap_config *cfg, void *arg, int mflags) > { > - struct encaptab *ep; > > - /* sanity check on args */ > - if (sp->sa_len > sizeof(ep->src) || dp->sa_len > sizeof(ep->dst)) > - return (NULL); > - if (sp->sa_len != dp->sa_len) > - return (NULL); > - if (af != sp->sa_family || af != dp->sa_family) > - return (NULL); > - > - /* check if anyone have already attached with exactly same config */ > - mtx_lock(&encapmtx); > - LIST_FOREACH(ep, &encaptab, chain) { > - if (ep->af != af) > - continue; > - if (ep->proto != proto) > - continue; > - if (ep->src.ss_len != sp->sa_len || > - bcmp(&ep->src, sp, sp->sa_len) != 0 || > - bcmp(&ep->srcmask, sm, sp->sa_len) != 0) > - continue; > - if (ep->dst.ss_len != dp->sa_len || > - bcmp(&ep->dst, dp, dp->sa_len) != 0 || > - bcmp(&ep->dstmask, dm, dp->sa_len) != 0) > - continue; > - > - mtx_unlock(&encapmtx); > - return (NULL); > - } > - > - ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/ > - if (ep == NULL) { > - mtx_unlock(&encapmtx); > - return (NULL); > - } > - bzero(ep, sizeof(*ep)); > - > - ep->af = af; > - ep->proto = proto; > - bcopy(sp, &ep->src, sp->sa_len); > - bcopy(sm, &ep->srcmask, sp->sa_len); > - bcopy(dp, &ep->dst, dp->sa_len); > - bcopy(dm, &ep->dstmask, dp->sa_len); > - ep->psw = psw; > - ep->arg = arg; > - > - encap_add(ep); > - mtx_unlock(&encapmtx); > - return (ep); > + return (encap_attach(&ipv4_encaptab, cfg, arg, mflags)); > } > > -const struct encaptab * > -encap_attach_func(int af, int proto, > - int (*func)(const struct mbuf *, int, int, void *), > - const struct protosw *psw, void *arg) > +int > +ip_encap_detach(const struct encaptab *cookie) > { > - struct encaptab *ep; > > - /* sanity check on args */ > - if (!func) > - return (NULL); > - > - ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/ > - if (ep == NULL) > - return (NULL); > - bzero(ep, sizeof(*ep)); > - > - ep->af = af; > - ep->proto = proto; > - ep->func = func; > - ep->psw = psw; > - ep->arg = arg; > - > - mtx_lock(&encapmtx); > - encap_add(ep); > - mtx_unlock(&encapmtx); > - return (ep); > + return (encap_detach(&ipv4_encaptab, cookie)); > } > > int > -encap_detach(const struct encaptab *cookie) > +encap4_input(struct mbuf **mp, int *offp, int proto) > { > - const struct encaptab *ep = cookie; > - struct encaptab *p; > > - mtx_lock(&encapmtx); > - LIST_FOREACH(p, &encaptab, chain) { > - if (p == ep) { > - LIST_REMOVE(p, chain); > - mtx_unlock(&encapmtx); > - free(p, M_NETADDR); /*XXX*/ > - return 0; > - } > - } > - mtx_unlock(&encapmtx); > - > - return EINVAL; > + if (encap_input(&ipv4_encaptab, *mp, *offp, proto) != IPPROTO_DONE) > + return (rip_input(mp, offp, proto)); > + return (IPPROTO_DONE); > } > +#endif /* INET */ > > -static int > -mask_match(const struct encaptab *ep, const struct sockaddr *sp, > - const struct sockaddr *dp) > +#ifdef INET6 > +const struct encaptab * > +ip6_encap_attach(const struct encap_config *cfg, void *arg, int mflags) > { > - struct sockaddr_storage s; > - struct sockaddr_storage d; > - int i; > - const u_int8_t *p, *q; > - u_int8_t *r; > - int matchlen; > > - if (sp->sa_len > sizeof(s) || dp->sa_len > sizeof(d)) > - return 0; > - if (sp->sa_family != ep->af || dp->sa_family != ep->af) > - return 0; > - if (sp->sa_len != ep->src.ss_len || dp->sa_len != ep->dst.ss_len) > - return 0; > - > - matchlen = 0; > - > - p = (const u_int8_t *)sp; > - q = (const u_int8_t *)&ep->srcmask; > - r = (u_int8_t *)&s; > - for (i = 0 ; i < sp->sa_len; i++) { > - r[i] = p[i] & q[i]; > - /* XXX estimate */ > - matchlen += (q[i] ? 8 : 0); > - } > - > - p = (const u_int8_t *)dp; > - q = (const u_int8_t *)&ep->dstmask; > - r = (u_int8_t *)&d; > - for (i = 0 ; i < dp->sa_len; i++) { > - r[i] = p[i] & q[i]; > - /* XXX rough estimate */ > - matchlen += (q[i] ? 8 : 0); > - } > - > - /* need to overwrite len/family portion as we don't compare them */ > - s.ss_len = sp->sa_len; > - s.ss_family = sp->sa_family; > - d.ss_len = dp->sa_len; > - d.ss_family = dp->sa_family; > - > - if (bcmp(&s, &ep->src, ep->src.ss_len) == 0 && > - bcmp(&d, &ep->dst, ep->dst.ss_len) == 0) { > - return matchlen; > - } else > - return 0; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Wed Jun 6 03:54:45 2018 Return-Path: Delivered-To: svn-src-head@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 09943FDFB74; Wed, 6 Jun 2018 03:54:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4654681B0A; Wed, 6 Jun 2018 03:54:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QPWxfd4S7SzNNQPWzffURR; Tue, 05 Jun 2018 21:54:42 -0600 X-Authority-Analysis: v=2.3 cv=KuxjJ1eN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=35TjDLf5ZU1na4RLt24A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 4AA621A6E; Tue, 5 Jun 2018 20:54:39 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w563rp42070891; Tue, 5 Jun 2018 20:53:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w563rpg1070888; Tue, 5 Jun 2018 20:53:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806060353.w563rpg1070888@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matt Macy cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat In-Reply-To: Message from Matt Macy of "Wed, 06 Jun 2018 02:48:09 -0000." <201806060248.w562m9tB083134@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 20:53:51 -0700 X-CMAE-Envelope: MS4wfMbDtrxQDGSqTXSJidpASvW1z+XGhD8VD4utiBv2f+6kQyZbOOwKxpv+bSHNsdrBGKYAomeBPC8Rm/vS5jp36DlKmApoXRPmhyH12Tw7RskUcJjTOat0 CE7+QtkqzUJDNdy4WeffS9flxSoeVorQiTlSG0mGCGYkZ95Zag6dCT7TMXzkuRsvqQavLioYsRyZ3ImjqXJ0dqu/+2LLqU+feeDEDpcOzbPgBCROOocxqpBF 59i4u3iJAA+oxfy4NwphvISJ+xwHhQ0W3ZYHEiG/4EXwSfeEISYx7vsM8ZLEk/aJ X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 03:54:45 -0000 In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy writes: > Author: mmacy > Date: Wed Jun 6 02:48:09 2018 > New Revision: 334701 > URL: https://svnweb.freebsd.org/changeset/base/334701 > > Log: > hwpmc: add summary command and further metadata extensions > > metadata changes: > - log pmc sample rate with pmcallocate > - log proc flags with thread / process logging > to identify user vs kernel threads > > fixes: > - use log cpuid to translate event id to event name > > Implement rudimentary summary command to track sample > counts by thread and process name within a pmc log. > > % make -j4 buildkernel >& /dev/null & > % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 > % pmc summary foo > cpu_clk_unhalted.thread_p_any: > idle: 138108207162 > clang-6.0: 105336158004 > sh: 72340108510 > make: 8642012963 > kernel: 7754011631 > longest_lat_cache.miss: > clang-6.0: 87502625 > sh: 40901227 > make: 5500165 > kernel: 3300099 > awk: 2000060 > > % pmc summary -f ~/foo > idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 > idle: 69054 > clang-6.0: 52668 > sh: 36170 > make: 4321 > kernel: 3877 > hwpmc: proc(7445): 3319 > awk: 1289 > xargs: 357 > rand_harvestq: 181 > mtree: 102 > intr: 53 > zfskern: 31 > usb: 7 > pagedaemon: 4 > ntpd: 3 > syslogd: 1 > acpi_thermal: 1 > logger: 1 > syncer: 1 > snmptrapd: 1 > sleep: 1 > idx: 17 name: longest_lat_cache.miss rate: 100003 > clang-6.0: 875 > sh: 409 > make: 55 > kernel: 33 > awk: 20 > hwpmc: proc(7445): 14 > xargs: 9 > idle: 8 > intr: 3 > zfskern: 2 Hi Matt, I'm not sure if this is due to this commit or one of your others but it's broken the build. Sorry I can't do any more analysis but I need to get dinner on the table. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 6 04:10:39 2018 Return-Path: Delivered-To: svn-src-head@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 3FC0CFE0131; Wed, 6 Jun 2018 04:10:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 925DE82077; Wed, 6 Jun 2018 04:10:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QPmNfd8rSSzNNQPmPffXHl; Tue, 05 Jun 2018 22:10:37 -0600 X-Authority-Analysis: v=2.3 cv=KuxjJ1eN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=lqruMqFtL0iausSl72QA:9 a=CjuIK1q_8ugA:10 a=oYPce5JG7pwA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A468D1A85; Tue, 5 Jun 2018 21:10:35 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w5649f48078795; Tue, 5 Jun 2018 21:09:41 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w5649f2g078792; Tue, 5 Jun 2018 21:09:41 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806060409.w5649f2g078792@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat In-Reply-To: Message from Cy Schubert of "Tue, 05 Jun 2018 20:53:51 -0700." <201806060353.w563rpg1070888@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 21:09:41 -0700 X-CMAE-Envelope: MS4wfDv8lzgiCoJ+exN4JEhGiuJBXKOuL97lTDt/LwykyMQfMAVd2GkX7iPoaGerurTIDdNHtg6k8o+3VmlC4PsOMoe/M14fkFDtKgStBZ1njKJjW40gKsdx c13sMxXQBxZBi1aDv4m92n6BY9XYcct72hRS80bXaQ15ymt3CqHu0jiDWD9luw9nmjI1M1La2NNbxjWbchz76wQZrq5BKoEBq80rg8xlcH/qjMzGRwIqjz8I v4qYJiK8qTvic6AFxL1K9RBQDPK0H4YoiXBwAWxf3HACZS4EQwIuLtGc3z8x0ze5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 04:10:39 -0000 In message <201806060353.w563rpg1070888@slippy.cwsent.com>, Cy Schubert writes: > In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy > writes: > > Author: mmacy > > Date: Wed Jun 6 02:48:09 2018 > > New Revision: 334701 > > URL: https://svnweb.freebsd.org/changeset/base/334701 > > > > Log: > > hwpmc: add summary command and further metadata extensions > > > > metadata changes: > > - log pmc sample rate with pmcallocate > > - log proc flags with thread / process logging > > to identify user vs kernel threads > > > > fixes: > > - use log cpuid to translate event id to event name > > > > Implement rudimentary summary command to track sample > > counts by thread and process name within a pmc log. > > > > % make -j4 buildkernel >& /dev/null & > > % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 > > % pmc summary foo > > cpu_clk_unhalted.thread_p_any: > > idle: 138108207162 > > clang-6.0: 105336158004 > > sh: 72340108510 > > make: 8642012963 > > kernel: 7754011631 > > longest_lat_cache.miss: > > clang-6.0: 87502625 > > sh: 40901227 > > make: 5500165 > > kernel: 3300099 > > awk: 2000060 > > > > % pmc summary -f ~/foo > > idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 > > idle: 69054 > > clang-6.0: 52668 > > sh: 36170 > > make: 4321 > > kernel: 3877 > > hwpmc: proc(7445): 3319 > > awk: 1289 > > xargs: 357 > > rand_harvestq: 181 > > mtree: 102 > > intr: 53 > > zfskern: 31 > > usb: 7 > > pagedaemon: 4 > > ntpd: 3 > > syslogd: 1 > > acpi_thermal: 1 > > logger: 1 > > syncer: 1 > > snmptrapd: 1 > > sleep: 1 > > idx: 17 name: longest_lat_cache.miss rate: 100003 > > clang-6.0: 875 > > sh: 409 > > make: 55 > > kernel: 33 > > awk: 20 > > hwpmc: proc(7445): 14 > > xargs: 9 > > idle: 8 > > intr: 3 > > zfskern: 2 > > Hi Matt, > > I'm not sure if this is due to this commit or one of your others but > it's broken the build. > > Sorry I can't do any more analysis but I need to get dinner on the > table. Oops, I should have pasted this into my previous email. --- cmd_pmc_filter.o --- /usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0 --sysroot=/export/obj/opt/src/svn-current/amd64.amd64/tmp -B/export/obj/opt/src/svn-current/amd64.amd64/tmp/usr/bin -O2 -pipe -pipe -g -MD -MF.depend.cmd_pmc_filter.o -MTcmd_pmc_filter.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /opt/src/svn-current/usr.sbin/pmc/cmd_pmc_filter.c -o cmd_pmc_filter.o cc: error: no such file or directory: '/opt/src/svn-current/usr.sbin/pmc /cmd_pmc_filter.c' cc: error: no input files -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 6 04:48:27 2018 Return-Path: Delivered-To: svn-src-head@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 F3BDCFE1141 for ; Wed, 6 Jun 2018 04:48:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-20.consmr.mail.ne1.yahoo.com (sonic305-20.consmr.mail.ne1.yahoo.com [66.163.185.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E4AD8322F for ; Wed, 6 Jun 2018 04:48:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: Dc9ix0QVM1lgs_STNlz91mYtDy6czZJui7dBpZXFjwunmU2hiVkE.ze2B5rFa2z lInxPj61t7x.RYNZrCJ8ysWU2lIqPxHHQ4JBUoAHKrnlH7ZV.mBwQWwPuitmRQ9uFPA1FZ1ri1Dg QOfQGcwRFT3IYl_pzGGJO7oruWsm2xZu81ZGiLHm9oOpb79xnvUWSWNcUpeLYGorPN3cXdpU_mAV tb26g7oV0tapJslay61dau7TN8KrX5TxyqWMnXoUZfj3vMiqRpzWhfzEh.9RbGFNJjP.PCQ_vsUx lw5qCs2DpYQmj7HqQmuEFtFUgzwCsANZn.lhXd3XhI8pexJThwPJFSZhqLmlun3SQkyvx3KeqGtT 3DWA8u7FuEIzeiDUnbH_6uPKOdhmZSZxfIu0hMvYyeocxOAvnvNCnogKV44BkubQeW7Dn4PrnVIH KWO1hgL2wxFZuoGmGtt6jlwiYDADxHc1rWOhCbp4Gx9xf20YM.74CbKzUDNebJoTFEjLVnisKzjV 573Pdc9cf37FEaOZ1wSvjMDgqGRrX0CvZoJ9XgvGIU9uhOP9wBB4x25p29yqPkKYnSIIirXK8I_d 6DkNvxoodgko400faCCKvynrL1R_kNik6txHlxSywl8ml8bZpMdtCWJlBtdFLOuJ5BNg57o6AJGC T4OtWpk_wRpmbFIFbOu3U3YW3Pebn6NQfUJJl436P7E3odQgD0JRo90DoMlFw0usbbQDdM0g4jy0 S0Ak4cUusfVNxihsQ3p4pe4vgW2R13fxZVWAI.BTpTkkLmrNVb7wtRq0m0s2xztGXMGdiD_jkvez 82ApZQMkD4UeapN1UC6XZFj85ebEqiv4ZEaoxwqOM4QjBTVgReNeKI3Cw_DlyaLyQP3pR5SH3iOR 7yzPvACylwlmSevYqSvnTyyExoejnIAHow.rR21NXyQ6xjLdedM1uAXb_ngFEdNclVlbwsnY.tRY dz8uz5S8ru7jeriP7ofVV6rhfXjGEpiuCXoA_dNk7NwbfHozHBBoWZwSN Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Wed, 6 Jun 2018 04:48:19 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp416.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 367768a5635c96973672e4fba9db1fa6; Wed, 06 Jun 2018 04:48:15 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat Message-Id: Date: Tue, 5 Jun 2018 21:48:13 -0700 Cc: mmacy@FreeBSD.org To: Cy Schubert , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 04:48:27 -0000 Cy Schubert Cy.Schubert at cschubert.com wrote on Wed Jun 6 04:10:39 UTC 2018 : > Oops, I should have pasted this into my previous email. >=20 > --- cmd_pmc_filter.o --- > /usr/local/bin/ccache cc -target x86_64-unknown-freebsd12.0=20 > --sysroot=3D/export/obj/opt/src/svn-current/amd64.amd64/tmp=20 > -B/export/obj/opt/src/svn-current/amd64.amd64/tmp/usr/bin -O2 -pipe=20= > -pipe -g -MD -MF.depend.cmd_pmc_filter.o -MTcmd_pmc_filter.o=20 > -std=3Dgnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall=20= > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes=20 > -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual=20 > -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align=20 > -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls=20 > -Wold-style-definition -Wno-pointer-sign = -Wmissing-variable-declarations > -Wthread-safety -Wno-empty-body -Wno-string-plus-int=20 > -Wno-unused-const-variable -Qunused-arguments -c=20 > /opt/src/svn-current/usr.sbin/pmc/cmd_pmc_filter.c -o cmd_pmc_filter.o > cc: error: no such file or directory: = '/opt/src/svn-current/usr.sbin/pmc > /cmd_pmc_filter.c' > cc: error: no input files But when I look at: https://ci.freebsd.org/job/FreeBSD-head-amd64-build/8885/consoleText I see a c++ compile of a .cc file instead of a cc of a .c file: --- cmd_pmc_filter.o --- c++ -target x86_64-unknown-freebsd12.0 = --sysroot=3D/usr/obj/usr/src/amd64.amd64/tmp = -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -g -MD = -MF.depend.cmd_pmc_filter.o -MTcmd_pmc_filter.o -fstack-protector-strong = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch = -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline = -Wredundant-decls -Wmissing-variable-declarations -Wthread-safety = -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable = -Qunused-arguments -Wno-c++11-extensions -c = /usr/src/usr.sbin/pmc/cmd_pmc_filter.cc -o cmd_pmc_filter.o (The build did fail overall, but apparently for other reasons.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Jun 6 05:02:57 2018 Return-Path: Delivered-To: svn-src-head@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 88CDEFE1773; Wed, 6 Jun 2018 05:02:57 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A9EB8387C; Wed, 6 Jun 2018 05:02:57 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 0482222FBA; Wed, 6 Jun 2018 05:02:57 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f175.google.com with SMTP id s26-v6so6163926ioj.4; Tue, 05 Jun 2018 22:02:56 -0700 (PDT) X-Gm-Message-State: APt69E2X9zpC+u2vf9pRPECNYLTxjncqVzhbn2D+Pe0z7hpIgSEb4cKb 7URdp2y0OQHSkW9yFbbQnezL/ABEWBnazQkfHSw= X-Google-Smtp-Source: ADUXVKI2jNuXaJsEwv0M8wRvpMB4XCuXJnC4N66wunIL3lqU9c+O/4dkmt24wc+xXlBVGkHqndDbSqifq8sjLsTnJA8= X-Received: by 2002:a6b:d00c:: with SMTP id x12-v6mr1421343ioa.5.1528261376140; Tue, 05 Jun 2018 22:02:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 22:02:55 -0700 (PDT) In-Reply-To: <201806060353.w563rpg1070888@slippy.cwsent.com> References: <201806060248.w562m9tB083134@repo.freebsd.org> <201806060353.w563rpg1070888@slippy.cwsent.com> From: Matthew Macy Date: Tue, 5 Jun 2018 22:02:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:02:57 -0000 Which arch? Universe is passing for me (except for pre-existing breakage of i386-LINT-NOINET). -M On Tue, Jun 5, 2018 at 8:53 PM, Cy Schubert wrote: > In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy > writes: >> Author: mmacy >> Date: Wed Jun 6 02:48:09 2018 >> New Revision: 334701 >> URL: https://svnweb.freebsd.org/changeset/base/334701 >> >> Log: >> hwpmc: add summary command and further metadata extensions >> >> metadata changes: >> - log pmc sample rate with pmcallocate >> - log proc flags with thread / process logging >> to identify user vs kernel threads >> >> fixes: >> - use log cpuid to translate event id to event name >> >> Implement rudimentary summary command to track sample >> counts by thread and process name within a pmc log. >> >> % make -j4 buildkernel >& /dev/null & >> % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 >> % pmc summary foo >> cpu_clk_unhalted.thread_p_any: >> idle: 138108207162 >> clang-6.0: 105336158004 >> sh: 72340108510 >> make: 8642012963 >> kernel: 7754011631 >> longest_lat_cache.miss: >> clang-6.0: 87502625 >> sh: 40901227 >> make: 5500165 >> kernel: 3300099 >> awk: 2000060 >> >> % pmc summary -f ~/foo >> idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 >> idle: 69054 >> clang-6.0: 52668 >> sh: 36170 >> make: 4321 >> kernel: 3877 >> hwpmc: proc(7445): 3319 >> awk: 1289 >> xargs: 357 >> rand_harvestq: 181 >> mtree: 102 >> intr: 53 >> zfskern: 31 >> usb: 7 >> pagedaemon: 4 >> ntpd: 3 >> syslogd: 1 >> acpi_thermal: 1 >> logger: 1 >> syncer: 1 >> snmptrapd: 1 >> sleep: 1 >> idx: 17 name: longest_lat_cache.miss rate: 100003 >> clang-6.0: 875 >> sh: 409 >> make: 55 >> kernel: 33 >> awk: 20 >> hwpmc: proc(7445): 14 >> xargs: 9 >> idle: 8 >> intr: 3 >> zfskern: 2 > > Hi Matt, > > I'm not sure if this is due to this commit or one of your others but > it's broken the build. > > Sorry I can't do any more analysis but I need to get dinner on the > table. > > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > From owner-svn-src-head@freebsd.org Wed Jun 6 05:08:07 2018 Return-Path: Delivered-To: svn-src-head@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 01830FE18D7; Wed, 6 Jun 2018 05:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA8883A12; Wed, 6 Jun 2018 05:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7565E2661D; Wed, 6 Jun 2018 05:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56586TS053687; Wed, 6 Jun 2018 05:08:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56586c9053686; Wed, 6 Jun 2018 05:08:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806060508.w56586c9053686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Jun 2018 05:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334702 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 334702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:08:07 -0000 Author: mjg Date: Wed Jun 6 05:08:05 2018 New Revision: 334702 URL: https://svnweb.freebsd.org/changeset/base/334702 Log: malloc: elaborate on r334545 due to frequent questions While here annotate the NULL check as probably true. Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Wed Jun 6 02:48:09 2018 (r334701) +++ head/sys/sys/malloc.h Wed Jun 6 05:08:05 2018 (r334702) @@ -186,6 +186,41 @@ void free(void *addr, struct malloc_type *type); void free_domain(void *addr, struct malloc_type *type); void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1); +/* + * Try to optimize malloc(..., ..., M_ZERO) allocations by doing zeroing in + * place if the size is known at compilation time. + * + * Passing the flag down requires malloc to blindly zero the entire object. + * In practice a lot of the zeroing can be avoided if most of the object + * gets explicitly initialized after the allocation. Letting the compiler + * zero in place gives it the opportunity to take advantage of this state. + * + * Note that the operation is only applicable if both flags and size are + * known at compilation time. If M_ZERO is passed but M_WAITOK is not, the + * allocation can fail and a NULL check is needed. However, if M_WAITOK is + * passed we know the allocation must succeed and the check can be elided. + * + * _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); + * if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) + * bzero(_malloc_item, _size); + * + * If the flag is set, the compiler knows the left side is always true, + * therefore the entire statement is true and the callsite is: + * + * _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); + * bzero(_malloc_item, _size); + * + * If the flag is not set, the compiler knows the left size is always false + * and the NULL check is needed, therefore the callsite is: + * + * _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); + * if (_malloc_item != NULL) + * bzero(_malloc_item, _size); + * + * The implementation is a macro because of what appears to be a clang 6 bug: + * an inline function variant ended up being compiled to a mere malloc call + * regardless of argument. gcc generates expected code (like the above). + */ #ifdef _KERNEL #define malloc(size, type, flags) ({ \ void *_malloc_item; \ @@ -193,7 +228,8 @@ void *malloc(size_t size, struct malloc_type *type, in if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ ((flags) & M_ZERO) != 0) { \ _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ - if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) \ + if (((flags) & M_WAITOK) != 0 || \ + __predict_true(_malloc_item != NULL)) \ bzero(_malloc_item, _size); \ } else { \ _malloc_item = malloc(_size, type, flags); \ From owner-svn-src-head@freebsd.org Wed Jun 6 05:14:45 2018 Return-Path: Delivered-To: svn-src-head@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 BDC4FFE1C29; Wed, 6 Jun 2018 05:14:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3BE83E6C; Wed, 6 Jun 2018 05:14:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QQmPfudtj5wO5QQmQfJdbR; Tue, 05 Jun 2018 23:14:43 -0600 X-Authority-Analysis: v=2.3 cv=SJtsqtnH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=8BRfB6f9doRxlqv42CgA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2DC5F1B0B; Tue, 5 Jun 2018 22:14:41 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w565E6Js079420; Tue, 5 Jun 2018 22:14:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w565E5Fj079417; Tue, 5 Jun 2018 22:14:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806060514.w565E5Fj079417@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matthew Macy cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat In-Reply-To: Message from Matthew Macy of "Tue, 05 Jun 2018 22:02:55 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 22:14:05 -0700 X-CMAE-Envelope: MS4wfB19y/YBTsMyc5Ev0a1sIQ3Kd/QtlUzyCNDRjJgUCLQ4z762kEKoe+cY1QNGXTHTSyItxrCCs0P4UVEti30MzqxAnP+a1xfCEJDMYDdgbiHR2W6cg2Dx kBk5gsNQBFTw2kDGKzZx3awbKKdW09+n1HCZTfdmV/5prTL8Z/gScgy9TiygX/mToiD/Zr5lyFwoDwsTh3tL0HdRnMLV+vTDqnrVLDWWdY9UuNH0qIC2X5vI lkzC+oXRwdkatrNLetN1/j7QW8+gWEotB+T5jdW/rEFbkuLdBtm5kfqx2rw20qJK X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:14:46 -0000 amd64 ~cy In message , Matthew Macy writes: > Which arch? Universe is passing for me (except for pre-existing > breakage of i386-LINT-NOINET). > > -M > > On Tue, Jun 5, 2018 at 8:53 PM, Cy Schubert wrote > : > > In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy > > writes: > >> Author: mmacy > >> Date: Wed Jun 6 02:48:09 2018 > >> New Revision: 334701 > >> URL: https://svnweb.freebsd.org/changeset/base/334701 > >> > >> Log: > >> hwpmc: add summary command and further metadata extensions > >> > >> metadata changes: > >> - log pmc sample rate with pmcallocate > >> - log proc flags with thread / process logging > >> to identify user vs kernel threads > >> > >> fixes: > >> - use log cpuid to translate event id to event name > >> > >> Implement rudimentary summary command to track sample > >> counts by thread and process name within a pmc log. > >> > >> % make -j4 buildkernel >& /dev/null & > >> % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 > >> % pmc summary foo > >> cpu_clk_unhalted.thread_p_any: > >> idle: 138108207162 > >> clang-6.0: 105336158004 > >> sh: 72340108510 > >> make: 8642012963 > >> kernel: 7754011631 > >> longest_lat_cache.miss: > >> clang-6.0: 87502625 > >> sh: 40901227 > >> make: 5500165 > >> kernel: 3300099 > >> awk: 2000060 > >> > >> % pmc summary -f ~/foo > >> idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 > >> idle: 69054 > >> clang-6.0: 52668 > >> sh: 36170 > >> make: 4321 > >> kernel: 3877 > >> hwpmc: proc(7445): 3319 > >> awk: 1289 > >> xargs: 357 > >> rand_harvestq: 181 > >> mtree: 102 > >> intr: 53 > >> zfskern: 31 > >> usb: 7 > >> pagedaemon: 4 > >> ntpd: 3 > >> syslogd: 1 > >> acpi_thermal: 1 > >> logger: 1 > >> syncer: 1 > >> snmptrapd: 1 > >> sleep: 1 > >> idx: 17 name: longest_lat_cache.miss rate: 100003 > >> clang-6.0: 875 > >> sh: 409 > >> make: 55 > >> kernel: 33 > >> awk: 20 > >> hwpmc: proc(7445): 14 > >> xargs: 9 > >> idle: 8 > >> intr: 3 > >> zfskern: 2 > > > > Hi Matt, > > > > I'm not sure if this is due to this commit or one of your others but > > it's broken the build. > > > > Sorry I can't do any more analysis but I need to get dinner on the > > table. > > > > > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 6 05:17:22 2018 Return-Path: Delivered-To: svn-src-head@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 38840FE1D5E; Wed, 6 Jun 2018 05:17:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCC9B83FDC; Wed, 6 Jun 2018 05:17:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5411267AA; Wed, 6 Jun 2018 05:17:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w565HLcn058788; Wed, 6 Jun 2018 05:17:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w565HLnT058787; Wed, 6 Jun 2018 05:17:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806060517.w565HLnT058787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 Jun 2018 05:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334703 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 334703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:17:22 -0000 Author: ae Date: Wed Jun 6 05:17:21 2018 New Revision: 334703 URL: https://svnweb.freebsd.org/changeset/base/334703 Log: Fix LINT-NOINET build. Use known at build time size for min_length value. Also remove the check from in6_gre_encapcheck(), now it is done in generic code. Modified: head/sys/netinet6/ip6_gre.c Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Wed Jun 6 05:08:05 2018 (r334702) +++ head/sys/netinet6/ip6_gre.c Wed Jun 6 05:17:21 2018 (r334703) @@ -79,17 +79,6 @@ in6_gre_encapcheck(const struct mbuf *m, int off, int return (0); M_ASSERTPKTHDR(m); - /* - * We expect that payload contains at least IPv4 - * or IPv6 packet. - */ - if (m->m_pkthdr.len < sizeof(struct greip6) + -#ifdef INET - sizeof(struct ip)) -#else - sizeof(struct ip6_hdr)) -#endif - return (0); GRE_RLOCK(sc); if (sc->gre_family == 0) @@ -122,7 +111,12 @@ in6_gre_output(struct mbuf *m, int af, int hlen) static const struct encap_config ipv6_encap_cfg = { .proto = IPPROTO_GRE, - .min_length = sizeof(struct greip6) + sizeof(struct ip), + .min_length = sizeof(struct greip6) + +#ifdef INET + sizeof(struct ip), +#else + sizeof(struct ip6_hdr), +#endif .exact_match = (sizeof(struct in6_addr) << 4) + 32, .check = in6_gre_encapcheck, .input = gre_input From owner-svn-src-head@freebsd.org Wed Jun 6 05:28:24 2018 Return-Path: Delivered-To: svn-src-head@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 8379BFE221B; Wed, 6 Jun 2018 05:28:24 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0EF844CF; Wed, 6 Jun 2018 05:28:24 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id E4911231C4; Wed, 6 Jun 2018 05:28:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f41.google.com with SMTP id m194-v6so6502754itg.2; Tue, 05 Jun 2018 22:28:23 -0700 (PDT) X-Gm-Message-State: APt69E05zxvGMFaT/tW0iNhxkOozOS4sqpOvSjzYR2n4GvKwk6qzoEqd DKC0sysNnhaK5BIbW7QsYQEIhNC9Mp7bdS5dwcE= X-Google-Smtp-Source: ADUXVKL8+OhntP7u8LXkoVLtzgXfVFx8KTsmnx6JfZioSrF6wfcBAljzgySpg0uUrZY6OC3jO786IIqsh0vYZ2pfuPw= X-Received: by 2002:a24:6c8a:: with SMTP id w132-v6mr1091408itb.4.1528262903375; Tue, 05 Jun 2018 22:28:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 22:28:22 -0700 (PDT) In-Reply-To: <201806060514.w565E5Fj079417@slippy.cwsent.com> References: <201806060514.w565E5Fj079417@slippy.cwsent.com> From: Matthew Macy Date: Tue, 5 Jun 2018 22:28:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:28:24 -0000 -DNO_CLEAN doesn't work with the file rename. On Tue, Jun 5, 2018 at 10:14 PM, Cy Schubert wrote: > amd64 > > ~cy > > In message il.com> > , Matthew Macy writes: >> Which arch? Universe is passing for me (except for pre-existing >> breakage of i386-LINT-NOINET). >> >> -M >> >> On Tue, Jun 5, 2018 at 8:53 PM, Cy Schubert wrote >> : >> > In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy >> > writes: >> >> Author: mmacy >> >> Date: Wed Jun 6 02:48:09 2018 >> >> New Revision: 334701 >> >> URL: https://svnweb.freebsd.org/changeset/base/334701 >> >> >> >> Log: >> >> hwpmc: add summary command and further metadata extensions >> >> >> >> metadata changes: >> >> - log pmc sample rate with pmcallocate >> >> - log proc flags with thread / process logging >> >> to identify user vs kernel threads >> >> >> >> fixes: >> >> - use log cpuid to translate event id to event name >> >> >> >> Implement rudimentary summary command to track sample >> >> counts by thread and process name within a pmc log. >> >> >> >> % make -j4 buildkernel >& /dev/null & >> >> % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 >> >> % pmc summary foo >> >> cpu_clk_unhalted.thread_p_any: >> >> idle: 138108207162 >> >> clang-6.0: 105336158004 >> >> sh: 72340108510 >> >> make: 8642012963 >> >> kernel: 7754011631 >> >> longest_lat_cache.miss: >> >> clang-6.0: 87502625 >> >> sh: 40901227 >> >> make: 5500165 >> >> kernel: 3300099 >> >> awk: 2000060 >> >> >> >> % pmc summary -f ~/foo >> >> idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 >> >> idle: 69054 >> >> clang-6.0: 52668 >> >> sh: 36170 >> >> make: 4321 >> >> kernel: 3877 >> >> hwpmc: proc(7445): 3319 >> >> awk: 1289 >> >> xargs: 357 >> >> rand_harvestq: 181 >> >> mtree: 102 >> >> intr: 53 >> >> zfskern: 31 >> >> usb: 7 >> >> pagedaemon: 4 >> >> ntpd: 3 >> >> syslogd: 1 >> >> acpi_thermal: 1 >> >> logger: 1 >> >> syncer: 1 >> >> snmptrapd: 1 >> >> sleep: 1 >> >> idx: 17 name: longest_lat_cache.miss rate: 100003 >> >> clang-6.0: 875 >> >> sh: 409 >> >> make: 55 >> >> kernel: 33 >> >> awk: 20 >> >> hwpmc: proc(7445): 14 >> >> xargs: 9 >> >> idle: 8 >> >> intr: 3 >> >> zfskern: 2 >> > >> > Hi Matt, >> > >> > I'm not sure if this is due to this commit or one of your others but >> > it's broken the build. >> > >> > Sorry I can't do any more analysis but I need to get dinner on the >> > table. >> > >> > >> > >> > >> > -- >> > Cheers, >> > Cy Schubert >> > FreeBSD UNIX: Web: http://www.FreeBSD.org >> > >> > The need of the many outweighs the greed of the few. >> > >> > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > From owner-svn-src-head@freebsd.org Wed Jun 6 05:35:01 2018 Return-Path: Delivered-To: svn-src-head@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 7354EFE2606; Wed, 6 Jun 2018 05:35:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CAEC084A0C; Wed, 6 Jun 2018 05:35:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QR5vfkucWuYopQR5xfSHfZ; Tue, 05 Jun 2018 23:34:54 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=r5dZ4yu8JJ6XAt6c_8cA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 712CB1B43; Tue, 5 Jun 2018 22:34:51 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w565XiNG048883; Tue, 5 Jun 2018 22:33:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w565XiAI048880; Tue, 5 Jun 2018 22:33:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806060533.w565XiAI048880@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matthew Macy cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334701 - in head: lib/libpmc share/examples/hwpmc sys/dev/hwpmc sys/sys usr.sbin/pmc usr.sbin/pmcstat In-Reply-To: Message from Matthew Macy of "Tue, 05 Jun 2018 22:28:22 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 22:33:44 -0700 X-CMAE-Envelope: MS4wfAcuTkJjjtp4Fw7gQ659jhHEku328xzvInDfN+48LhZy8fEd2B8UTFzWvsXAiBHfjid97ooeRZQHd+FnggRfY7nlc7231IGkq1MqDacmOOUXtzfykxRs OXIoT43OC1t91M0r/OJYa1ShICPO1yYPk95BIWZa4NciP7MhQXYbCjYLmhzMmAytZ26uH+miqJdOrBAThLXiNfi9oDCrydRYBkYePlzT12ftXmhcf6RCmt9w +Vm101/mrx87U1tfquM6hKsHtj6rx0mu4ock6e1Ux982XpS1s2Dj4TnOKeoSduQd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 05:35:01 -0000 I came to that same conclusion myself moments ago. Thanks. In message , Matthew Macy writes: > -DNO_CLEAN doesn't work with the file rename. > > On Tue, Jun 5, 2018 at 10:14 PM, Cy Schubert wrot > e: > > amd64 > > > > ~cy > > > > In message > il.com> > > , Matthew Macy writes: > >> Which arch? Universe is passing for me (except for pre-existing > >> breakage of i386-LINT-NOINET). > >> > >> -M > >> > >> On Tue, Jun 5, 2018 at 8:53 PM, Cy Schubert wr > ote > >> : > >> > In message <201806060248.w562m9tB083134@repo.freebsd.org>, Matt Macy > >> > writes: > >> >> Author: mmacy > >> >> Date: Wed Jun 6 02:48:09 2018 > >> >> New Revision: 334701 > >> >> URL: https://svnweb.freebsd.org/changeset/base/334701 > >> >> > >> >> Log: > >> >> hwpmc: add summary command and further metadata extensions > >> >> > >> >> metadata changes: > >> >> - log pmc sample rate with pmcallocate > >> >> - log proc flags with thread / process logging > >> >> to identify user vs kernel threads > >> >> > >> >> fixes: > >> >> - use log cpuid to translate event id to event name > >> >> > >> >> Implement rudimentary summary command to track sample > >> >> counts by thread and process name within a pmc log. > >> >> > >> >> % make -j4 buildkernel >& /dev/null & > >> >> % sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15 > >> >> % pmc summary foo > >> >> cpu_clk_unhalted.thread_p_any: > >> >> idle: 138108207162 > >> >> clang-6.0: 105336158004 > >> >> sh: 72340108510 > >> >> make: 8642012963 > >> >> kernel: 7754011631 > >> >> longest_lat_cache.miss: > >> >> clang-6.0: 87502625 > >> >> sh: 40901227 > >> >> make: 5500165 > >> >> kernel: 3300099 > >> >> awk: 2000060 > >> >> > >> >> % pmc summary -f ~/foo > >> >> idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003 > >> >> idle: 69054 > >> >> clang-6.0: 52668 > >> >> sh: 36170 > >> >> make: 4321 > >> >> kernel: 3877 > >> >> hwpmc: proc(7445): 3319 > >> >> awk: 1289 > >> >> xargs: 357 > >> >> rand_harvestq: 181 > >> >> mtree: 102 > >> >> intr: 53 > >> >> zfskern: 31 > >> >> usb: 7 > >> >> pagedaemon: 4 > >> >> ntpd: 3 > >> >> syslogd: 1 > >> >> acpi_thermal: 1 > >> >> logger: 1 > >> >> syncer: 1 > >> >> snmptrapd: 1 > >> >> sleep: 1 > >> >> idx: 17 name: longest_lat_cache.miss rate: 100003 > >> >> clang-6.0: 875 > >> >> sh: 409 > >> >> make: 55 > >> >> kernel: 33 > >> >> awk: 20 > >> >> hwpmc: proc(7445): 14 > >> >> xargs: 9 > >> >> idle: 8 > >> >> intr: 3 > >> >> zfskern: 2 > >> > > >> > Hi Matt, > >> > > >> > I'm not sure if this is due to this commit or one of your others but > >> > it's broken the build. > >> > > >> > Sorry I can't do any more analysis but I need to get dinner on the > >> > table. > >> > > >> > > >> > > >> > > >> > -- > >> > Cheers, > >> > Cy Schubert > >> > FreeBSD UNIX: Web: http://www.FreeBSD.org > >> > > >> > The need of the many outweighs the greed of the few. > >> > > >> > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 6 06:42:13 2018 Return-Path: Delivered-To: svn-src-head@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 D1EFEFE6E17; Wed, 6 Jun 2018 06:42:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80C44869C2; Wed, 6 Jun 2018 06:42:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61E2E274AD; Wed, 6 Jun 2018 06:42:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w566gDHa002095; Wed, 6 Jun 2018 06:42:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w566gD95002094; Wed, 6 Jun 2018 06:42:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806060642.w566gD95002094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 6 Jun 2018 06:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334704 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 06:42:14 -0000 Author: eadler Date: Wed Jun 6 06:42:12 2018 New Revision: 334704 URL: https://svnweb.freebsd.org/changeset/base/334704 Log: top(1): make error message happy We don't use a "size" variable, so just don't report it. Reported by: bapt Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jun 6 05:17:21 2018 (r334703) +++ head/usr.bin/top/machine.c Wed Jun 6 06:42:12 2018 (r334704) @@ -379,7 +379,7 @@ machine_init(struct statics *statics) GETSYSCTL("kern.smp.maxcpus", maxcpu); times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) - err(1, "calloc %zu bytes", size); + err(1, "calloc for kern.smp.maxcpus", size); size = sizeof(long) * maxcpu * CPUSTATES; if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); From owner-svn-src-head@freebsd.org Wed Jun 6 06:43:01 2018 Return-Path: Delivered-To: svn-src-head@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 1A617FE6EB9 for ; Wed, 6 Jun 2018 06:43:01 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE6186B58 for ; Wed, 6 Jun 2018 06:43:00 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 58EDE239BB for ; Wed, 6 Jun 2018 06:43:00 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f175.google.com with SMTP id v68-v6so1551588ywd.3 for ; Tue, 05 Jun 2018 23:43:00 -0700 (PDT) X-Gm-Message-State: APt69E2pCjY9wml0BmBC9PFiOED4V4PMBLZvjnys+eK5lRgbXwBh/Hpz 6CP5TGwSeLNpu9mYhPb8Tupna20LvCrzAmnbVh11kg== X-Google-Smtp-Source: ADUXVKJkr1lDTFHFVa+FE8Pg0UEqaqkKTYyArHa8Qv9OYpBXLW6m8DMBlRkvzGGtcJ82OUQjwWYeLoR+CjiA0xIatqY= X-Received: by 2002:a81:b70b:: with SMTP id v11-v6mr790600ywh.182.1528267379808; Tue, 05 Jun 2018 23:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 23:42:29 -0700 (PDT) In-Reply-To: <20180604054240.bgzlzftyw2zaxwa4@ivaldir.net> References: <201806031341.w53DfOAD000819@repo.freebsd.org> <20180604054240.bgzlzftyw2zaxwa4@ivaldir.net> From: Eitan Adler Date: Tue, 5 Jun 2018 23:42:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334557 - head/usr.bin/top To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 06:43:01 -0000 On 3 June 2018 at 22:42, Baptiste Daroussin wrote: > On Sun, Jun 03, 2018 at 01:41:24PM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Sun Jun 3 13:41:23 2018 >> New Revision: 334557 >> URL: https://svnweb.freebsd.org/changeset/base/334557 >> >> Log: >> top(1): restore size for kern.cp_times >> >> Restore last minute change that broke top(1). >> >> Modified: >> head/usr.bin/top/machine.c >> >> Modified: head/usr.bin/top/machine.c >> ============================================================================== >> --- head/usr.bin/top/machine.c Sun Jun 3 13:40:58 2018 (r334556) >> +++ head/usr.bin/top/machine.c Sun Jun 3 13:41:23 2018 (r334557) >> @@ -384,6 +384,7 @@ machine_init(struct statics *statics) >> times = calloc(maxcpu * CPUSTATES, sizeof(long)); >> if (times == NULL) >> err(1, "calloc %zu bytes", size); >> + size = sizeof(long) * maxcpu * CPUSTATES; > > The error message just above might also be unhappy about the size variable :) r334704 - thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Wed Jun 6 07:04:41 2018 Return-Path: Delivered-To: svn-src-head@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 EF22EFE81A9; Wed, 6 Jun 2018 07:04:40 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A180D8781C; Wed, 6 Jun 2018 07:04:40 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A97278F5; Wed, 6 Jun 2018 07:04:40 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5674edb013692; Wed, 6 Jun 2018 07:04:40 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5674e3j013691; Wed, 6 Jun 2018 07:04:40 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201806060704.w5674e3j013691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Wed, 6 Jun 2018 07:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334705 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 334705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:04:41 -0000 Author: thj Date: Wed Jun 6 07:04:40 2018 New Revision: 334705 URL: https://svnweb.freebsd.org/changeset/base/334705 Log: Use UDP len when calculating UDP checksums The length of the IP payload is normally equal to the UDP length, UDP Options (draft-ietf-tsvwg-udp-options-02) suggests using the difference between IP length and UDP length to create space for trailing data. Correct checksum length calculation to use the UDP length rather than the IP length when not offloading UDP checksums. Approved by: jtl (mentor) Differential Revision: https://reviews.freebsd.org/D15222 Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jun 6 06:42:12 2018 (r334704) +++ head/sys/netinet/ip_output.c Wed Jun 6 07:04:40 2018 (r334705) @@ -80,6 +80,10 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include + #ifdef SCTP #include #include @@ -920,14 +924,28 @@ void in_delayed_cksum(struct mbuf *m) { struct ip *ip; - uint16_t csum, offset, ip_len; + struct udphdr *uh; + uint16_t cklen, csum, offset; ip = mtod(m, struct ip *); offset = ip->ip_hl << 2 ; - ip_len = ntohs(ip->ip_len); - csum = in_cksum_skip(m, ip_len, offset); - if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) - csum = 0xffff; + + if (m->m_pkthdr.csum_flags & CSUM_UDP) { + /* if udp header is not in the first mbuf copy udplen */ + if (offset + sizeof(struct udphdr) > m->m_len) + m_copydata(m, offset + offsetof(struct udphdr, uh_ulen), + 2, (caddr_t)&cklen); + else { + uh = (struct udphdr *)((caddr_t)ip + offset); + cklen = ntohs(uh->uh_ulen); + } + csum = in_cksum_skip(m, cklen + offset, offset); + if (csum == 0) + csum = 0xffff; + } else { + cklen = ntohs(ip->ip_len); + csum = in_cksum_skip(m, cklen, offset); + } offset += m->m_pkthdr.csum_data; /* checksum offset */ /* find the mbuf in the chain where the checksum starts*/ From owner-svn-src-head@freebsd.org Wed Jun 6 07:07:59 2018 Return-Path: Delivered-To: svn-src-head@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 16B1EFE861E for ; Wed, 6 Jun 2018 07:07:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-21.consmr.mail.ne1.yahoo.com (sonic311-21.consmr.mail.ne1.yahoo.com [66.163.188.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A109087A10 for ; Wed, 6 Jun 2018 07:07:58 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 7u8k46QVM1mU6euo93_p4aoteAAKhtbLAGRa5IheDsDzVEVrJP9BPx9Df9.7xPY dg6JyDC1KWiArAB7EnLkc1H1SvWL._MIGADvKXe0avLYY6KlwwuBDV77s6TJplDHub2aJ_Ncfroe SFogm5wmkMyR.nBtECwcV7XGggvlBxgubkE2E8yHSPcBkKLgIekZdH5xWqcPmRmFsLtajFjNMcKq msPLS_H7M1pyZb3q4L.d4no.jaswCuawsJrTM2iRdOTs4pIwNplUjMUd859YvKpeifJkhWMUYrm2 THp5_k2HSWYnJWTarJHmGoL4_WHlcazISsFN3Si.nUA8S3l.cqek.hhKSRqFOW6gr6_3hqykbi7H HaBqPBXYiPki0YGneuhxVclcL_v.t14HucNRUnlfGDMxyjJBaVci_hN.0X_yzW3gMDb7fh.TfD3_ EB_c2sldgvgtby.V.LdWANDCHZQc4UYghVIaSsv2C2_ZSPOHF7OHwzG95NyWn7WOaxoYJ6Lc8ejf DpMxU_WGMdTLGrthuB5mbFn8ar4yMDnu0T_2JqCYBW0TFmXHFazJHAaSWP9EpICkP1WHqvX7Q7mH psRuLsejojom4sluAq4u4IN7E_UNyWXJoAAETriILhzGOdu07.PvrM1Bq3NtoDLpk0JlyFryQDos DvzbbUjPMG2gYSpNN52w2UBrbxxwPC9dFSYW61hNRIp6h4.vK5ghir6D7pWzQq7enEPnyoHBBMYr 12o4xVjcp6Eyn5ltuJjzvloxLilKwZlrxLH9DO4hYX0yN17uP238XkdjnVm86lG9EN4FrZ.YOYiQ UesVAPc4ftbJOJr_dql3WviPYidTxaBDqYU18gfGpzggcL6f9ymffENog0rxxmcta.2oFnZgKB60 FCybmqV5qno3fBB_.9PEoE30EYewPMKNbuW_dxGvtscIuruch0KFUBYNbnVHDTW_uUp59GQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Wed, 6 Jun 2018 07:07:52 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp430.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9d51cf28e8bd9dcbfdadc89177488e42; Wed, 06 Jun 2018 07:07:50 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334704 - head/usr.bin/top Message-Id: Date: Wed, 6 Jun 2018 00:07:49 -0700 To: Eitan Adler , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:07:59 -0000 Eitan Adler eadler at FreeBSD.org wrote on Wed Jun 6 06:42:14 UTC 2018 : > + err(1, "calloc for kern.smp.maxcpus", size); What is "size" used for when the string makes no use of it? === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Jun 6 07:14:06 2018 Return-Path: Delivered-To: svn-src-head@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 820E6FE9145 for ; Wed, 6 Jun 2018 07:14:06 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338DD87ED2 for ; Wed, 6 Jun 2018 07:14:06 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f180.google.com (mail-yb0-f180.google.com [209.85.213.180]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id F1B0C23CC1 for ; Wed, 6 Jun 2018 07:14:05 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f180.google.com with SMTP id p22-v6so1639911yba.13 for ; Wed, 06 Jun 2018 00:14:05 -0700 (PDT) X-Gm-Message-State: APt69E2T4MSdwWyoJSb2bJf2UGbj+hTYiez7Duznn1CTWGGvKB2ybjJc cvrwBM7cC8KZ2l8YYWGu7IYwcFDWbzuyb5ELIHJezQ== X-Google-Smtp-Source: ADUXVKKE/loKyC9yJf5liROmKIa5X2f1LIPf14M6LNur1oBvVkYCvZZU3I/E+l8umIl3rP9pz3CMzK1YYK1J7OQIR2I= X-Received: by 2002:a25:786:: with SMTP id 128-v6mr903653ybh.338.1528269245463; Wed, 06 Jun 2018 00:14:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 00:13:34 -0700 (PDT) In-Reply-To: References: From: Eitan Adler Date: Wed, 6 Jun 2018 00:13:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334704 - head/usr.bin/top To: Mark Millard Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:14:06 -0000 On 6 June 2018 at 00:07, Mark Millard wrote: > Eitan Adler eadler at FreeBSD.org wrote on > Wed Jun 6 06:42:14 UTC 2018 : > >> + err(1, "calloc for kern.smp.maxcpus", size); > > What is "size" used for when the string makes no use of it? Fixed. Thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Wed Jun 6 07:13:28 2018 Return-Path: Delivered-To: svn-src-head@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 2952AFE8F4E; Wed, 6 Jun 2018 07:13:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D09B387DBB; Wed, 6 Jun 2018 07:13:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1CED27AA8; Wed, 6 Jun 2018 07:13:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w567DRIc018864; Wed, 6 Jun 2018 07:13:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w567DRof018863; Wed, 6 Jun 2018 07:13:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806060713.w567DRof018863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 6 Jun 2018 07:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334706 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:13:28 -0000 Author: eadler Date: Wed Jun 6 07:13:27 2018 New Revision: 334706 URL: https://svnweb.freebsd.org/changeset/base/334706 Log: top(1): fix err again I am amazed at my ability to get a one-line error reporting line wrong thrice. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jun 6 07:04:40 2018 (r334705) +++ head/usr.bin/top/machine.c Wed Jun 6 07:13:27 2018 (r334706) @@ -379,7 +379,7 @@ machine_init(struct statics *statics) GETSYSCTL("kern.smp.maxcpus", maxcpu); times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) - err(1, "calloc for kern.smp.maxcpus", size); + err(1, "calloc for kern.smp.maxcpus"); size = sizeof(long) * maxcpu * CPUSTATES; if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); From owner-svn-src-head@freebsd.org Wed Jun 6 07:35:17 2018 Return-Path: Delivered-To: svn-src-head@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 5FEB4FEAE97 for ; Wed, 6 Jun 2018 07:35:17 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12FE968A12 for ; Wed, 6 Jun 2018 07:35:17 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id D007123EBE for ; Wed, 6 Jun 2018 07:35:16 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f181.google.com with SMTP id 81-v6so1583102ywb.6 for ; Wed, 06 Jun 2018 00:35:16 -0700 (PDT) X-Gm-Message-State: APt69E1tbKVapmZfLeVqXnUYLN3dkmFn+JLAXNTCKqWkL+ToXY2DuI5J ELMZwbSXkVMbi5/rKJpNjAfxw/MAbeQGLTK4NPTCmA== X-Google-Smtp-Source: ADUXVKJTrUlvIdsRAPYXKzPIpA5r9nzAbGDQn7dAFT2USeNuUDx7PLtthWwOWa48rzU/QrX0MiSQUkZh3m+4DiRxf4c= X-Received: by 2002:a81:b70b:: with SMTP id v11-v6mr844859ywh.182.1528270516245; Wed, 06 Jun 2018 00:35:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 00:34:45 -0700 (PDT) In-Reply-To: <2256597.yrYJmMiYOr@ralph.baldwin.cx> References: <201805231045.w4NAjWsv059104@repo.freebsd.org> <2256597.yrYJmMiYOr@ralph.baldwin.cx> From: Eitan Adler Date: Wed, 6 Jun 2018 00:34:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334089 - head/sbin/dumpon To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:35:17 -0000 On 23 May 2018 at 09:30, John Baldwin wrote: > On Wednesday, May 23, 2018 10:45:32 AM Eitan Adler wrote: >> Author: eadler >> Date: Wed May 23 10:45:32 2018 >> New Revision: 334089 >> URL: https://svnweb.freebsd.org/changeset/base/334089 >> >> Log: >> dumpon: point to better kernel debug symbols. >> >> The objdir is temporary, and the current example points to GENERIC. >> Instead point to the installed location of the debug symbols that are >> supposed to match the kernel you are using. >> >> PR: 223993 >> Submitted by: Trond.Endrestol@ximalas.info ... What do y'all think of something like: diff --git i/sbin/dumpon/dumpon.8 w/sbin/dumpon/dumpon.8 index fd271b5..28162af 100644 --- i/sbin/dumpon/dumpon.8 +++ w/sbin/dumpon/dumpon.8 @@ -311,15 +311,17 @@ The can be now examined using .Xr kgdb 1 : .Pp -.Dl # kgdb /usr/lib/debug/boot/kernel/kernel.debug vmcore.# +.Dl # kgdb /boot/kernel/kernel vmcore.# .Pp or shorter: .Pp -.Dl # kgdb -n # /usr/lib/debug/boot/kernel/kernel.debug +.Dl # kgdb -n # /boot/kernel/kernel .Pp The core was decrypted properly if .Xr kgdb 1 does not print any errors. +Note that the live kernel might be at a different path +which can be examined by looking at the kern.bootfile sysctl. .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Wed Jun 6 07:33:17 2018 Return-Path: Delivered-To: svn-src-head@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 97AC0FEACB9; Wed, 6 Jun 2018 07:33:17 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 F21E6688FF; Wed, 6 Jun 2018 07:33:16 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id v16-v6so9538171wmh.5; Wed, 06 Jun 2018 00:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=N8HTR0+ioOsiM3Ygw3KSnPwkDKNi6Ac1SgGWVeEWztY=; b=bixHODZcUUutR9A/I1XR/yuLXyvF5m2G+TG5sndQfLdjYc8CvpoTHMM9twCOD/hDOv oOONi+5Wj1/D2VmVBiBQhbK7rnw7MnZjBbiStgPjCrMGTtldHc2wkDF4cjQZgvT89HQf ZpPn295s/o2Pycw4679RKPvAUaom0PHGi5WYRMQ2lHspKKCInq1c3nsoKYMZJVzCCmM2 JVgN+cXN+E/pFIWyd3A2d1M+lpVFwYPFUVVd2aP3YTletaDkYb9OeR7HH7yvGPTxFJ3K o1zNUc8eA9CzYU0PixJRHxVB6n7xf3TX8t0kR722uLYcL7l/GtYeeo2rPCo9P67s4Nbj 5oQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=N8HTR0+ioOsiM3Ygw3KSnPwkDKNi6Ac1SgGWVeEWztY=; b=CHd+Xe94+cx0/P/hh8Yuojb4wvPjxq+sFdpggpSSk1uunMtlvPAf7OKkINkjEm93vZ SOpG68rhwKC8ZdDtKRgStVByLApJjP82fWBxUaZSWhE1qQG7SMPx6NRq1aXdm1QdQM7S aQijptn6OnOTdv4X7L6A+sJCy0sICwmdwDZg9iNs9Y1dHQsMULAypAS1lhvRr0yiQqNx xjjDRS7h9o0lZVXEm1nenxDu7SM9fxzVULO6XMBUj1mUj94a5RpZhNDoxFSjn9bUIYjq t+o4CyCyYT64exemc/HwSpus2GQ1O86q/j/7uaBD52b4attHmqE5LqiX9ZydzmAzgHIM fr7w== X-Gm-Message-State: APt69E0g0oEE3PxrjyckJOhLJD3WL1HInMzpfu6Va7MFasvgE58td46C fhrhZaP/hs4pf3HG5w1uiTmfDA== X-Google-Smtp-Source: ADUXVKJ5h4JKDOwf9VE0nqlfqBNX8pJKq9jqkF84q392TuCTPviEezvDRUhdNkIvw9hpvkYdlLxqeg== X-Received: by 2002:a1c:7507:: with SMTP id o7-v6mr913274wmc.139.1528270395802; Wed, 06 Jun 2018 00:33:15 -0700 (PDT) Received: from ernst.home (p5B02337A.dip0.t-ipconnect.de. [91.2.51.122]) by smtp.gmail.com with ESMTPSA id u108-v6sm62984129wrc.40.2018.06.06.00.33.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Jun 2018 00:33:14 -0700 (PDT) Date: Wed, 6 Jun 2018 09:33:09 +0200 From: Gary Jennejohn To: Eitan Adler Cc: Kevin Lo , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r334650 - head/sys/dev/usb Message-ID: <20180606093309.4d0dd89c@ernst.home> In-Reply-To: References: <201806050952.w559qc3l066480@repo.freebsd.org> <20180605140156.GA93953@ns.kevlo.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 07:33:17 -0000 On Tue, 5 Jun 2018 16:30:05 -0700 Eitan Adler wrote: > On 5 June 2018 at 07:01, Kevin Lo wrote: > > On Tue, Jun 05, 2018 at 09:52:38AM +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Tue Jun 5 09:52:38 2018 > >> New Revision: 334650 > >> URL: https://svnweb.freebsd.org/changeset/base/334650 > >> > >> Log: > >> usbdevs: sync from NetBSD > >> > >> This adds several vendors from NetBSD's copy of the same file (r1.749). > >> Prefer longer more "canonical" names where the names differed. > >> > >> Sort while here. > >> > >> Modified: > >> head/sys/dev/usb/usbdevs > >> > >> Modified: head/sys/dev/usb/usbdevs > >> ============================================================================== > >> --- head/sys/dev/usb/usbdevs Tue Jun 5 05:24:42 2018 (r334649) > >> +++ head/sys/dev/usb/usbdevs Tue Jun 5 09:52:38 2018 (r334650) > >> @@ -60,7 +60,7 @@ vendor UNKNOWN2 0x0105 Unknown vendor > >> vendor EGALAX2 0x0123 eGalax, Inc. > >> vendor CHIPSBANK 0x0204 Chipsbank Microelectronics Co. > >> vendor HUMAX 0x02ad HUMAX > >> -vendor INTENSO 0x2109 INTENSO > >> +vendor QUAN 0x01e1 Quan > > > > Doesn't sort. > > > > [snip] > > > >> +vendor INTENSO 0x2109 INTENSO > >> vendor VIALABS 0x2109 VIA Labs > > > > INTENSO has the same vendor id as VIALABS? This doesn't look right. > > From the origin (NetBSD): > > vendor INTENSO 0x2109 INTENSO > vendor VIALABS 0x2109 VIA Labs > > I noticed this earlier and thought it might relate to vendor renames > or the like. I'll try and spend more time on it. I have quite a few > replies-to-commits to catch up on: I've spent too much time on "new" > things and have to deal with the other stuff I've touched now. > Looking at the usb.if from usb.org indicates that Intenso doesn't even have a USB VID. 0x2109 is listed as VIA Labs. This entry may be the result of Intenso selling a rebadged VIA Labs product. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Wed Jun 6 08:26:01 2018 Return-Path: Delivered-To: svn-src-head@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 2795BFECF02; Wed, 6 Jun 2018 08:26:01 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6B756A683; Wed, 6 Jun 2018 08:26:00 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd23.aul.t-online.de (fwd23.aul.t-online.de [172.20.26.128]) by mailout08.t-online.de (Postfix) with SMTP id D1ABF41C667B; Wed, 6 Jun 2018 10:25:52 +0200 (CEST) Received: from Stefans-MBP-10.fritz.box (Vmk3SiZ-Qh4lIgbptkRbg1fUMN9Kp7NDi6zscK7uXDjs-9ulbCdJgexvCh-de8AgYA@[84.154.104.94]) by fwd23.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1fQTlO-0gc1tw0; Wed, 6 Jun 2018 10:25:50 +0200 Subject: Re: svn commit: r334617 - in head: . etc To: Brad Davis , Renato Botelho , Konstantin Belousov Cc: src-committers , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> From: Stefan Esser Openpgp: preference=signencrypt Autocrypt: addr=se@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAHNKVN0ZWZhbiBFw59lciAoWWFob28hKSA8c3QuZXNzZXJAeWFob28uZGU+wsCWBBMBCgBA AhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AWIQSjceplnAvsyCtxUxNH67XvWv31RAUC WvLvqwUJCyUBEwAKCRBH67XvWv31REySCACc6vqcSFQCRyBRc2CV5ZBjbbnTy7VBoXbUS3/c 4Hn8I0YQ39q7//2z8vYsgLeM1mMXL4PUIU/0f0dBAFBLpxV7bntGzyCJls6SeGS/qcQKhqaI 6I7NcWg8OkIJIhUL6q238cS1ql9pU65fyHe0PP8JS08m81PDpX2/4wTE6h2jgYUy55eXRzoF MEjr1S8SSnidsBem27o7iWu9ltJsUtE86071iZlLzbuHv2nvucrjAV9cK9tHrxYT/YiY8QhT L48iWj2xIjLjg1ebmgIFZ2k881we/KTIoUugqOOR1gDSc4qwM8CA388cN3frjtl98CwhAT5T UV8tIDqri+/Z1AKwzsBNBFVxiRIBCACxI/aglzGVbnI6XHd0MTP05VK/fJub4hHdc+LQpz1M kVnCAhFbY9oecTB/togdKtfiloavjbFrb0nJhJnx57K+3SdSuu+znaQ4SlWiZOtXnkbpRWNU eMm+gtTDMSvloGAfr76RtFHskdDOLgXsHD70bKuMhlBxUCrSwGzHaD00q8iQPhJZ5itb3WPq z3B4IjiDAWTO2obD1wtAvSuHuUj/XJRsiKDKW3x13cfavkad81bZW4cpNwUv8XHLv/vaZPSA ly+hkY7NrDZydMMXVNQ7AJQufWuTJ0q7sImRcEZ5EIa98esJPey4O7C0vY405wjeyxpVZkpq ThDMurqtQFn1ABEBAAHCwHwEGAEKACYCGwwWIQSjceplnAvsyCtxUxNH67XvWv31RAUCWvLv qwUJCyUBGQAKCRBH67XvWv31RLnrB/9gzcRlpx71sDMosoZULWn7wysBJ/8AIEfIByRaHQe3 pn/KwE57pB+zFbbQqB7YzeZb7/UUgR4zU2ZbOcEfwDZcHUbj0B3fGRsS3t0uiLlAd8w0sBZb SxrqzjdpDjIbOZkxssqUmvrsN67UG1AFWH9aD24keBS7YjPBS8hLxPeYV+Xz6vUL8fRZje/Z JgiBMIwyj6g2lH/zkdnxBdC0iG1xxJOLTaghMMeQyCdH6ef8+VMyAlAJsMckbOTvx63tY8z7 DFcrnTJfbe1EziRilVsEaK8tTzJzhcTfos+f3eBYWEilxe5HzIhYKJeC7lmsSUcGwa6+9VRg a0ctmi9Z8OgX Message-ID: Date: Wed, 6 Jun 2018 10:25:49 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ID: Vmk3SiZ-Qh4lIgbptkRbg1fUMN9Kp7NDi6zscK7uXDjs-9ulbCdJgexvCh-de8AgYA X-TOI-MSGID: ec25db48-2a1c-42e8-b3f7-481222979b6a X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 08:26:01 -0000 Am 05.06.18 um 22:43 schrieb Brad Davis: > > On Tue, Jun 5, 2018, at 1:07 PM, Renato Botelho wrote: >> On 05/06/18 15:26, Konstantin Belousov wrote: >> > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: >> >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: >> >>> I find it often very useful to do >> >>> (cd src/etc/rc.d && make install) >> >>> Same for defaults and several other directories which in fact contains >> >>> non-editable content.  Is this planned to keep working ? >> >> >> >> The short answer is, no.  All rc.d scripts get moved to the src of the > program they start. >> >> >> >> That said, if there is a big need for this, we can see about options to > keep them working. >> >> >> >> What are you trying to accomplish when you do this?  Just verify the rc.d > scripts match your src tree? >> > >> > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, >> > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binaries >> > provided by the project not for the user editing. >> > >> > When upgrading the host, esp. on HEAD, i usually refresh scripts by this >> > procedure and avoid any editing and implied conflict resolution for real >> > configs. >> > >> > Not being able to easily install clean copies of these scripts would >> > be very inconvenient and time consuming. >> >> If I understood what Brad is saying, each rc.d script will be installed >> by the application it belongs to. So when it's installing SSH it will >> also install /etc/rc.d/sshd and you will not need to deal with rc.d >> files on mergemaster anymore. >> >> Is it correct, Brad? > > Correct. I have for a long time (decades?) applied local changes to files in src/etc which (very seldom) may need a conflict resolution, and which make sure that /etc is populated with files that match my needs. It is easy to change a file in /etc until it works as desired and then copy it to src/etc, where it is subject to updating via SVN, but still reflects my preferences. With the move to source directories it will be necessary to modify rc files and other configuration file defaults (e.g. ttys) in a number of places. E.g., mergemaster will try to remove the shells installed from ports from /etc/shells on each run and quite a number of other files will either never be automatically updated (by excluding them from mergemaster runs) or on every invocation of mergemaster, unless patched in their respective source directories spread over the whole source tree. This is a BIG step backwards from my PoV, since src/etc currently is the equivalent of FreeBSD's concept of using /etc/rc.conf for configuration of all applicable system settings. Having sources of all files that are going to be installed in /etc (when a new system is setup or by mergemaster) is equivalent in the sense that the location where changes have to be applied is confined to just one directory, src/etc (and a few architecture dependent sub-directories). Regards, STefan From owner-svn-src-head@freebsd.org Wed Jun 6 10:46:25 2018 Return-Path: Delivered-To: svn-src-head@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 86EDCFF0B85; Wed, 6 Jun 2018 10:46:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 355986E9AA; Wed, 6 Jun 2018 10:46:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C3C31C54; Wed, 6 Jun 2018 10:46:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56AkOjs023654; Wed, 6 Jun 2018 10:46:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56AkOMQ023653; Wed, 6 Jun 2018 10:46:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806061046.w56AkOMQ023653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 Jun 2018 10:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334707 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 334707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 10:46:25 -0000 Author: ae Date: Wed Jun 6 10:46:24 2018 New Revision: 334707 URL: https://svnweb.freebsd.org/changeset/base/334707 Log: Use m_copyback() function to write delayed checksum when it isn't located in the first mbuf of the chain. MFC after: 1 week Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Jun 6 07:13:27 2018 (r334706) +++ head/sys/netinet6/ip6_output.c Wed Jun 6 10:46:24 2018 (r334707) @@ -199,18 +199,10 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_sho csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ - if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d plen %u off %u " - "csum_flags=%b\n", __func__, m->m_len, plen, offset, - (int)m->m_pkthdr.csum_flags, CSUM_BITS); - /* - * XXX this should not happen, but if it does, the correct - * behavior may be to insert the checksum in the appropriate - * next mbuf in the chain. - */ - return; - } - *(u_short *)(m->m_data + offset) = csum; + if (offset + sizeof(csum) > m->m_len) + m_copyback(m, offset, sizeof(csum), (caddr_t)&csum); + else + *(u_short *)mtodo(m, offset) = csum; } int From owner-svn-src-head@freebsd.org Wed Jun 6 11:35:18 2018 Return-Path: Delivered-To: svn-src-head@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 3A34DFF20B2; Wed, 6 Jun 2018 11:35:18 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEE9470153; Wed, 6 Jun 2018 11:35:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.20.12.186] (unknown [38.64.177.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 8552F256B3; Wed, 6 Jun 2018 11:35:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Wed, 06 Jun 2018 07:35:12 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: Mateusz Guzik , , , Message-ID: <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys References: <201806060508.w56586c9053686@repo.freebsd.org> In-Reply-To: <201806060508.w56586c9053686@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 11:35:18 -0000 Hi Mateusz, =EF=BB=BF-----Original Message----- From: on behalf of Mateusz Guzik Date: 2018-06-06, Wednesday at 01:08 To: , , Subject: svn commit: r334702 - head/sys/sys > Author: mjg > Date: Wed Jun 6 05:08:05 2018 > New Revision: 334702 > URL: https://svnweb.freebsd.org/changeset/base/334702 >=20 > Log: > malloc: elaborate on r334545 due to frequent questions I was one of the questioners. :-) Thank you for explaining the conditional = logic. > ... > + * Passing the flag down requires malloc to blindly zero the entire obje= ct. > + * In practice a lot of the zeroing can be avoided if most of the object > + * gets explicitly initialized after the allocation. Letting the compile= r > + * zero in place gives it the opportunity to take advantage of this stat= e. This part, I still don't understand. :-( The call to bzero() is still for the full length passed in, so how does thi= s help? > ... > + * _malloc_item =3D malloc(_size, type, (flags) &~ M_ZERO); > + * if (((flags) & M_WAITOK) !=3D 0 || _malloc_item !=3D NULL) > + * bzero(_malloc_item, _size); > + * > + * If the flag is set, the compiler knows the left side is always true, > + * therefore the entire statement is true and the callsite is: I think you mean "... the *right* side is always true ...", since the left = side is the check for the flag being set. "If the flag is set, compiler know= s (the check for the flag being set) is always true" is tautological. > ... > + * If the flag is not set, the compiler knows the left size is always fa= lse > + * and the NULL check is needed, therefore the callsite is: Same issue here. > ... > #ifdef _KERNEL > #define malloc(size, type, flags) ({ \ Now that I'm taking another look at this, I'm confused as to why the entire= macro expansion is inside parentheses? (The braces make sense, since this i= s a block with local variables which need to be contained.) > void *_malloc_item; \ > @@ -193,7 +228,8 @@ void *malloc(size_t size, struct malloc_type *type, i= n > if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ > ((flags) & M_ZERO) !=3D 0) { \ > _malloc_item =3D malloc(_size, type, (flags) &~ M_ZERO); \ > - if (((flags) & M_WAITOK) !=3D 0 || _malloc_item !=3D NULL) \ > + if (((flags) & M_WAITOK) !=3D 0 || \ > + __predict_true(_malloc_item !=3D NULL)) \ > bzero(_malloc_item, _size); \ > } else { \ > _malloc_item =3D malloc(_size, type, flags); \ This confuses me too. If the constant-size/constant-flags/M_ZERO-is-set tes= t fails, then it falls down to calling malloc(). Which we are in the middle = of defining. So what does that expand to? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Wed Jun 6 11:40:19 2018 Return-Path: Delivered-To: svn-src-head@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 7BE2AFF2223; Wed, 6 Jun 2018 11:40:19 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x244.google.com (mail-ot0-x244.google.com [IPv6:2607:f8b0:4003:c0f::244]) (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 F064370364; Wed, 6 Jun 2018 11:40:18 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x244.google.com with SMTP id i5-v6so6823693otf.1; Wed, 06 Jun 2018 04:40:18 -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=Z2hsO/RnyovLmGx/lSqSrOmIoqWKCExmM/7uvxucJZI=; b=l0+fYm02Gn0dfkN4UOUkZejzDoxaGZ76DmTyRcD7XZoO80NZvTAwsuZXqORcFg/A4H qi56qpoJmU9ifZoRFEUmaIc83L9wiygBKAYRfrE9Jzdk2AH+Eu5fqUNUKNUQ86ilAMUj VQX2ghh4SpcHVNkHRHB0v8ZtmdOqZzoQ2PPwWqHv7aQNAv69KLPwjtktK2q3rRFZK2yn YuoriI6fEIB0Yy6Z7piJpW6DlqZjgJ8mKOKCMVdSjsCsoeMmjPjQr0bOutF+C7pb0ues jNVCGYdqO7vvhNacvBKpCFJf4GJZVIIxuCkyiRhC/pOuffz9EEkRmYtqVrKB7euaUqs/ j1Gw== 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=Z2hsO/RnyovLmGx/lSqSrOmIoqWKCExmM/7uvxucJZI=; b=cKyIpeIrN/eQPEbTHmmfjtRKAx9L3nc/PbAa4xSHgnVKSMEG0lH9O4r0uujfH7sjv9 RbCWKyrBXmL7hJhEeWhSl9Jqv2ri6+JvC7riTOE8Xgb7uLhhzUE4a8dZGKzpsPFs3DDr 3hXmmXPt+ToIfumL03irrtQKkIuA5nPceErWWlUcc4Ptf3p49gjVLpEeup5PgHH4g5N8 E+aeF9vHmgH6Qt72UtVby4/ajPc/bPepBRsjsbDMRbpkZHF6mQhLEBWYA/vujmVbpupv AkBURzxWnnw1mk5Tfsmei+Sh1wgfZVweqYjk2NabLKyzM95YymjopaRwCfqP3gAfpM5K 2Xig== X-Gm-Message-State: APt69E0CMC+2RsTvlVttPqK13lpfIpUAf0t3OL6ryEuNN6GCePIFV0M+ zujB3girfEqSH9Sujob9Lniqi+UlT1hurPyeO3Nuww== X-Google-Smtp-Source: ADUXVKJExpyF96rXoGA/bkiYGUOtb3WkJjMPUaDlglCJN285mzEh6Tqfow9GuHyxTLgtqphXh5XS6pOthc5s/sTa0Ig= X-Received: by 2002:a9d:2371:: with SMTP id k46-v6mr1825047otd.210.1528285218243; Wed, 06 Jun 2018 04:40:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:348e:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 04:40:17 -0700 (PDT) In-Reply-To: <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> From: Benjamin Kaduk Date: Wed, 6 Jun 2018 06:40:17 -0500 Message-ID: Subject: Re: svn commit: r334702 - head/sys/sys To: Ravi Pokala Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 11:40:19 -0000 On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: > Hi Mateusz, > > =EF=BB=BF-----Original Message----- > From: on behalf of Mateusz Guzik > > Date: 2018-06-06, Wednesday at 01:08 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r334702 - head/sys/sys > > > ... > > #ifdef _KERNEL > > #define malloc(size, type, flags) ({ > \ > > Now that I'm taking another look at this, I'm confused as to why the > entire macro expansion is inside parentheses? (The braces make sense, sin= ce > this is a block with local variables which need to be contained.) > This is a gcc (and clang) extension to allow the macro body to be a code block -- standard C gets unhappy with just the curly braces. https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html is a maybe-relevant page that google found me. -Ben From owner-svn-src-head@freebsd.org Wed Jun 6 11:41:58 2018 Return-Path: Delivered-To: svn-src-head@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 C7654FF25E7; Wed, 6 Jun 2018 11:41:57 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 69E2370786; Wed, 6 Jun 2018 11:41:57 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 46DDF21B84; Wed, 6 Jun 2018 07:41:51 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Wed, 06 Jun 2018 07:41:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=QCJ7Xj G7/uklyA1RRlK/YFJVFdhuh1iWPurqBDJ29Sk=; b=Qge9hV5Q2bj+Qn7fnlAHFs RlSir2E178Vm0gMIhqPM75e+8TS60rC7NnTIM3SnO6bPZhcMMkrcrjENa+MhwsUx JGhYuWxpRFSWGqfXXgYXPf+s+SETfxhDlq33oBuneCijzNKieaK/T5W5Mais2veg 99z1nRfrjfQ2BvFoG6qgrUVqNq5R2lHN7EnrS9ZJtDlpkEO7ubX3dCU0DXfdUaZ9 EOHuggDt+SaOs0sZYSQJ4ASpYlNvtYGRbVXTgi3ykHdB0UQDl2Qixk4xz6evH7F6 JmqRYx8e5N5NvV8S8a2JzMIk7PtpWzt4GCykPs4UNWRh8z6mYbGTyAWuaRvdvkCg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 1272EBA50D; Wed, 6 Jun 2018 07:41:51 -0400 (EDT) Message-Id: <1528285310.3551889.1398315032.22267C9D@webmail.messagingengine.com> From: Brad Davis To: Stefan Esser , Renato Botelho , Konstantin Belousov Cc: "src-committers" , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Date: Wed, 06 Jun 2018 05:41:50 -0600 Subject: Re: svn commit: r334617 - in head: . etc References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> In-Reply-To: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 11:41:58 -0000 On Wed, Jun 6, 2018, at 2:25 AM, Stefan Esser wrote: > Am 05.06.18 um 22:43 schrieb Brad Davis: > >=20 > > On Tue, Jun 5, 2018, at 1:07 PM, Renato Botelho wrote: > >> On 05/06/18 15:26, Konstantin Belousov wrote: > >> > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: > >> >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > >> >>> I find it often very useful to do > >> >>> (cd src/etc/rc.d && make install) > >> >>> Same for defaults and several other directories which in fact cont= ains > >> >>> non-editable content.=C2=A0 Is this planned to keep working ? > >> >> > >> >> The short answer is, no.=C2=A0 All rc.d scripts get moved to the sr= c of the > > program they start. > >> >> > >> >> That said, if there is a big need for this, we can see about option= s to > > keep them working. > >> >> > >> >> What are you trying to accomplish when you do this?=C2=A0 Just veri= fy the rc.d > > scripts match your src tree? > >> > > >> > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > >> > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binar= ies > >> > provided by the project not for the user editing. > >> > > >> > When upgrading the host, esp. on HEAD, i usually refresh scripts by = this > >> > procedure and avoid any editing and implied conflict resolution for = real > >> > configs. > >> > > >> > Not being able to easily install clean copies of these scripts would > >> > be very inconvenient and time consuming. > >> > >> If I understood what Brad is saying, each rc.d script will be installed > >> by the application it belongs to. So when it's installing SSH it will > >> also install /etc/rc.d/sshd and you will not need to deal with rc.d > >> files on mergemaster anymore. > >> > >> Is it correct, Brad? > >=20 > > Correct. > I have for a long time (decades?) applied local changes to files in src/e= tc > which (very seldom) may need a conflict resolution, and which make sure t= hat > /etc is populated with files that match my needs. >=20 > It is easy to change a file in /etc until it works as desired and then co= py > it to src/etc, where it is subject to updating via SVN, but still reflects > my preferences. >=20 > With the move to source directories it will be necessary to modify rc fil= es > and other configuration file defaults (e.g. ttys) in a number of places. >=20 > E.g., mergemaster will try to remove the shells installed from ports from > /etc/shells on each run and quite a number of other files will either nev= er > be automatically updated (by excluding them from mergemaster runs) or on > every invocation of mergemaster, unless patched in their respective source > directories spread over the whole source tree. >=20 > This is a BIG step backwards from my PoV, since src/etc currently is the > equivalent of FreeBSD's concept of using /etc/rc.conf for configuration of > all applicable system settings. Having sources of all files that are going > to be installed in /etc (when a new system is setup or by mergemaster) is > equivalent in the sense that the location where changes have to be applied > is confined to just one directory, src/etc (and a few architecture depend= ent > sub-directories). You should really consider moving to etcupdate, as it uses 3-way merge and = make this much easier. Regards, Brad Davis From owner-svn-src-head@freebsd.org Wed Jun 6 12:28:44 2018 Return-Path: Delivered-To: svn-src-head@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 6EC1DFF42F6; Wed, 6 Jun 2018 12:28:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 802E371F8D; Wed, 6 Jun 2018 12:28:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id E5E97D66E9F; Wed, 6 Jun 2018 22:28:31 +1000 (AEST) Date: Wed, 6 Jun 2018 22:28:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk cc: Ravi Pokala , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334702 - head/sys/sys In-Reply-To: Message-ID: <20180606220347.N3528@besplex.bde.org> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=mDV3o1hIAAAA:8 a=ltDKUUI1AAAA:8 a=IgBFj9cdW9r1GCZ3iiAA:9 a=CjuIK1q_8ugA:10 a=21gvIwNvQA8A:10 a=IjZwj45LgO3ly-622nXo:22 a=_FVE-zBwftR9WsbkzFJk:22 a=zPa3363zVR52QbuIqfxu:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 12:28:44 -0000 On Wed, 6 Jun 2018, Benjamin Kaduk wrote: > On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: > >> Hi Mateusz, >> ... >>> ... >>> #ifdef _KERNEL >>> #define malloc(size, type, flags) ({ >> \ >> >> Now that I'm taking another look at this, I'm confused as to why the >> entire macro expansion is inside parentheses? (The braces make sense, since >> this is a block with local variables which need to be contained.) > > This is a gcc (and clang) extension to allow the macro body to be a code > block -- standard C gets unhappy with just the curly braces. > https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html is a maybe-relevant > page that google found me. Not really. This is a syntax error which is only accepted by broken compilers, since the language standard is doubly mis-specified by hard-coding it to a wrong value using CSTD=c89 in kern.mk. This asks for c99 with no extensions, but many extensions are needed. These bugs are missing in the corresponding userland makefile bsd.sys.mk. That uses CSTD?=gnu99. This asks for c99 with gnu extensions, which is what is needed, but allows the user to ask for another standard by setting CSTD. To allow the user to ask for c99, or just to not depend on compiler bugs when kern.mk asks for c99, use of this and other extensions should be marked with __extension__, as is most often done for this particular extension. Braces in macros are perfectly standard. The extension is to allow a compound statement (delimited by braces) to return a value. This is done by enclosing the statement in parentheses. The value of the statement is the value of the last expression in it. This is an extension of c99, since in c99 about the only things that can be enclosed in parentheses are expressions, but general statements are not expressions. Especially compound statements. This used to be properly documented (in installed documentation) in /usr/share/info/gcc.info.gz. Bruce From owner-svn-src-head@freebsd.org Wed Jun 6 12:57:13 2018 Return-Path: Delivered-To: svn-src-head@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 07413FF51A2; Wed, 6 Jun 2018 12:57:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9F1472E65; Wed, 6 Jun 2018 12:57:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86EE030E4; Wed, 6 Jun 2018 12:57:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56CvCcb089370; Wed, 6 Jun 2018 12:57:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56CvCwq089369; Wed, 6 Jun 2018 12:57:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806061257.w56CvCwq089369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 6 Jun 2018 12:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334708 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 12:57:13 -0000 Author: jhibbits Date: Wed Jun 6 12:57:11 2018 New Revision: 334708 URL: https://svnweb.freebsd.org/changeset/base/334708 Log: Add a memory barrier after taking a reference on the vnode holdcnt in _vhold This is needed to avoid a race between the VNASSERT() below, and another thread updating the VI_FREE flag, on weakly-ordered architectures. On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' would panic on the assert regularly. It may be possible to use a weaker barrier, and I'll investigate that once all stability issues are worked out on POWER9. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (!locked) { if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { +#if !defined(__amd64__) && !defined(__i386__) + mb(); +#endif VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("_vhold: vnode with holdcnt is free")); return; From owner-svn-src-head@freebsd.org Wed Jun 6 13:01:54 2018 Return-Path: Delivered-To: svn-src-head@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 A2DA8FF547A; Wed, 6 Jun 2018 13:01:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50CEC73204; Wed, 6 Jun 2018 13:01:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3270B3148; Wed, 6 Jun 2018 13:01:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56D1rHR093626; Wed, 6 Jun 2018 13:01:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56D1rex093625; Wed, 6 Jun 2018 13:01:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806061301.w56D1rex093625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 Jun 2018 13:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334709 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 334709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:01:54 -0000 Author: ae Date: Wed Jun 6 13:01:53 2018 New Revision: 334709 URL: https://svnweb.freebsd.org/changeset/base/334709 Log: Make in_delayed_cksum() be similar to IPv6 implementation. Use m_copyback() function to write checksum when it isn't located in the first mbuf of the chain. Handmade analog doesn't handle the case when parts of checksum are located in different mbufs. Also in case when mbuf is too short, m_copyback() will allocate new mbuf in the chain instead of making out of bounds write. Also wrap long line and remove now useless KASSERTs. X-MFC after: r334705 Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jun 6 12:57:11 2018 (r334708) +++ head/sys/netinet/ip_output.c Wed Jun 6 13:01:53 2018 (r334709) @@ -933,10 +933,10 @@ in_delayed_cksum(struct mbuf *m) if (m->m_pkthdr.csum_flags & CSUM_UDP) { /* if udp header is not in the first mbuf copy udplen */ if (offset + sizeof(struct udphdr) > m->m_len) - m_copydata(m, offset + offsetof(struct udphdr, uh_ulen), - 2, (caddr_t)&cklen); + m_copydata(m, offset + offsetof(struct udphdr, + uh_ulen), sizeof(cklen), (caddr_t)&cklen); else { - uh = (struct udphdr *)((caddr_t)ip + offset); + uh = (struct udphdr *)mtodo(m, offset); cklen = ntohs(uh->uh_ulen); } csum = in_cksum_skip(m, cklen + offset, offset); @@ -948,14 +948,10 @@ in_delayed_cksum(struct mbuf *m) } offset += m->m_pkthdr.csum_data; /* checksum offset */ - /* find the mbuf in the chain where the checksum starts*/ - while ((m != NULL) && (offset >= m->m_len)) { - offset -= m->m_len; - m = m->m_next; - } - KASSERT(m != NULL, ("in_delayed_cksum: checksum outside mbuf chain.")); - KASSERT(offset + sizeof(u_short) <= m->m_len, ("in_delayed_cksum: checksum split between mbufs.")); - *(u_short *)(m->m_data + offset) = csum; + if (offset + sizeof(csum) > m->m_len) + m_copyback(m, offset, sizeof(csum), (caddr_t)&csum); + else + *(u_short *)mtodo(m, offset) = csum; } /* From owner-svn-src-head@freebsd.org Wed Jun 6 13:01:58 2018 Return-Path: Delivered-To: svn-src-head@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 632B7FF5487; Wed, 6 Jun 2018 13:01:58 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 E6F2973219; Wed, 6 Jun 2018 13:01:57 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id s9-v6so6198576qtg.2; Wed, 06 Jun 2018 06:01:57 -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=jh9Fxn0U00HSEc8X87PdggIsR63IuHSky6bKAcSyBew=; b=bFgDBWYr7GucGGtn10jHGCl9icu0YgilFUER34WIMC4Dn0emKVc20PmrZdaTP/+LhB pAnhP0MDpDG1cD5vnYKEBWw2r4Szh+KJl4/0P4vwAq7kHbFp4MI3ppKwHbJPdFG/NcmV vdHvLj+TQZ3c7YgtmO30aWQ+/bpd9EeprVtWwzCV/f20WTqnwQHWfUr7SHvlK7CxPI76 9Sj8oRm6JYdJ7h2kDChasuTKMhVB+02sYntmx+44ySCg4F005/iBY2TrSAIRD1LktUk2 NdtSSqCQuYs/i0NyXCDQP99GH7A0aCgEUkdWrnVPgoP4ohVnc/ebOzMUPf3NWEmp4zlf BI+w== 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=jh9Fxn0U00HSEc8X87PdggIsR63IuHSky6bKAcSyBew=; b=P2BxPSzg+l/Do577lL+OjBFe2gFI+dp2TVLr0WAm/MWn9sS1DXww1acwHS+SAnLHtH M/GAdbyrB5afyX0qlNtr6j+wW3FW7aZvXDovw6qj6qPN+C4odBJvjVde3rX39ySasA19 YONa7lNpc9VKu2/Em9lnekBEuwjyujT0Ga97AVmVKo3HYcL1UbPBCndV00+diR3Ntv7p uLtI4kQOpd5aWKWREdsTtLLOhFjdCYOkYjxJz9trh42OaWYKZFIj+iTltAQjUYhddw62 7t/iewQEH8SIu7DtIFu7xziMNVOd1krex8PXYCIomwsEomWCD+5EiHbBw4EhUeSrqoZ2 Z+DA== X-Gm-Message-State: APt69E0V6qfuMTKar1DHIIAZsEZSgkyzVfs1EJ/i1SzL+wXIObse32g0 vppeHfP0h00dqy14QPykTyVXvd6D8lhOu8uUgNVpxg== X-Google-Smtp-Source: ADUXVKLYEHHcQNm5LstDfMUiMAW6iPHKKyHCQa92q4F+UZ7OaC632qaCSEGVFs3Sp59IVx+LsAcwTLOqolWrSWTNrEo= X-Received: by 2002:ac8:358a:: with SMTP id k10-v6mr2544606qtb.248.1528290117367; Wed, 06 Jun 2018 06:01:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:1c4e:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:01:56 -0700 (PDT) In-Reply-To: <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> From: Mateusz Guzik Date: Wed, 6 Jun 2018 15:01:56 +0200 Message-ID: Subject: Re: svn commit: r334702 - head/sys/sys To: Ravi Pokala Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:01:58 -0000 On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > > + * Passing the flag down requires malloc to blindly zero the entire > object. > > + * In practice a lot of the zeroing can be avoided if most of the object > > + * gets explicitly initialized after the allocation. Letting the > compiler > > + * zero in place gives it the opportunity to take advantage of this > state. > > This part, I still don't understand. :-( > > The call to bzero() is still for the full length passed in, so how does > this help? > > bzero is: #define bzero(buf, len) __builtin_memset((buf), 0, (len)) > ... > > + * _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); > > + * if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) > > + * bzero(_malloc_item, _size); > > + * > > + * If the flag is set, the compiler knows the left side is always true, > > + * therefore the entire statement is true and the callsite is: > > I think you mean "... the *right* side is always true ...", since the left > side is the check for the flag being set. "If the flag is set, compiler > knows (the check for the flag being set) is always true" is tautological. > It explains how __builtin_constant_p(flags) being true allows the compiler to optimize out the flags-based check. I don't understand why this particular use runs into so much confusion. Just above it there is a M_ZERO check relying on the same property and receiving no attention. > ... > > + * If the flag is not set, the compiler knows the left size is always > false > > + * and the NULL check is needed, therefore the callsite is: > > Same issue here. > > > ... > > #ifdef _KERNEL > > #define malloc(size, type, flags) ({ > \ > > Now that I'm taking another look at this, I'm confused as to why the > entire macro expansion is inside parentheses? (The braces make sense, since > this is a block with local variables which need to be contained.) > > It is to return the value (the last expression). > > void *_malloc_item; \ > > @@ -193,7 +228,8 @@ void *malloc(size_t size, struct malloc_type > *type, in > > if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ > > ((flags) & M_ZERO) != 0) { \ > > _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ > > - if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) \ > > + if (((flags) & M_WAITOK) != 0 || \ > > + __predict_true(_malloc_item != NULL)) \ > > bzero(_malloc_item, _size); \ > > } else { \ > > _malloc_item = malloc(_size, type, flags); \ > > This confuses me too. If the constant-size/constant-flags/M_ZERO-is-set > test fails, then it falls down to calling malloc(). Which we are in the > middle of defining. So what does that expand to? > > Expansion is not recursive, so this is an actual call to malloc. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Jun 6 13:02:28 2018 Return-Path: Delivered-To: svn-src-head@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 4918AFF5524 for ; Wed, 6 Jun 2018 13:02:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (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 CEBAF73472 for ; Wed, 6 Jun 2018 13:02:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id l6-v6so7904197iti.2 for ; Wed, 06 Jun 2018 06:02: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=N+BQ7neqjDYb0GLU6fFleJi5HshcU+4aQh0hi+xWI6I=; b=b0Yfy9XSLdmgsefHjqzS+Mlx1EnZEdJrEdS8H4lUUNrOngqA4KxcfI3MM/mwa5w//r oEOuSUWuBRYKsJhyuBn/ApX/3mLt5+98XOiPQrZip5LWGTiMV4CMcMWq/XKfAy4/SkAe tqjDjmdUHK5t1sK6C5/bZz1pToHmwZ2hdsf0/664fCIBupyIytTe2P5UONEfSzrPXOx+ SwOtWfO+wTh5LvDBrh3QuLDAfdqnGATWZt36juP6CPm1fmKc3DVIcs/9vuhpZZ40QOdG 99lJ02LMM0UtWokPno27bE1i39Qp4h1Xw1Tt4khYOxGqNItpFiqeuNjfl10I3Z1mCR2Y ey4A== 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=N+BQ7neqjDYb0GLU6fFleJi5HshcU+4aQh0hi+xWI6I=; b=bW7xaQm+QP44qvvpHBKpCkH6FXzxCxEnIb/ypY9LbbqX7dnRVoPbBOyBRqaat2mtwh 5aQXVDF4+o28IiddaEFtPIwctvL99WQ1KGKd9/8lEPipuB9ujGfvTw7/dinTEKh/+fVM D2UkkKUn+FhT7Os27FfZzS9dVqFQcohJalyxW3AXoblSzxQc3XjhlPiW6RGJHx0fCa08 MqFaf//nPIik5CjqP9pRVFRTlRDrliFOETaFuEZqZrxuTuG0Jyy1y3Pminb+z+EVc2oE Opl5W7kA62TC8gvgLowvGV7qmzOEvXmNl+gYSktZzv4qt9VywmiVryK9Gf3tbKHwYCzy eKDA== X-Gm-Message-State: APt69E0Q5eTorzBbtyWKBO67siN6t6NWmAKvSvKSsnvqKH0OjxJc/C1S nHf2arIFBynmgJK8TUnRRCGvTFFI6pDbAQiuzxp2Og== X-Google-Smtp-Source: ADUXVKIuuOYt0jCvw0SQCFX+uwxNzPheRVzpFg99b1ixEDZue5e7NyY+EBEkHjDNvcCran+EF70rdZR4rPdyQ5+3LxU= X-Received: by 2002:a24:efc2:: with SMTP id i185-v6mr2307999ith.57.1528290147084; Wed, 06 Jun 2018 06:02:27 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:02:26 -0700 (PDT) X-Originating-IP: [137.122.64.159] In-Reply-To: <201806061257.w56CvCwq089369@repo.freebsd.org> References: <201806061257.w56CvCwq089369@repo.freebsd.org> From: Warner Losh Date: Wed, 6 Jun 2018 09:02:26 -0400 X-Google-Sender-Auth: d89317V9BHXN54oHRsYZhw30gJc Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:02:28 -0000 On Wed, Jun 6, 2018 at 8:57 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Jun 6 12:57:11 2018 > New Revision: 334708 > URL: https://svnweb.freebsd.org/changeset/base/334708 > > Log: > Add a memory barrier after taking a reference on the vnode holdcnt in > _vhold > > This is needed to avoid a race between the VNASSERT() below, and another > thread updating the VI_FREE flag, on weakly-ordered architectures. > > On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' > would > panic on the assert regularly. > > It may be possible to use a weaker barrier, and I'll investigate that > once > all stability issues are worked out on POWER9. > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================ > ================== > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > if (!locked) { > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > +#if !defined(__amd64__) && !defined(__i386__) > + mb(); > +#endif > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > ("_vhold: vnode with holdcnt is free")); > return; > > So why isn't the refcount_acquire() enough? Warner From owner-svn-src-head@freebsd.org Wed Jun 6 13:21:53 2018 Return-Path: Delivered-To: svn-src-head@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 429B2FF5D2A; Wed, 6 Jun 2018 13:21:53 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (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 A959973DDE; Wed, 6 Jun 2018 13:21:52 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x241.google.com with SMTP id t134-v6so9082487lff.6; Wed, 06 Jun 2018 06:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+hJvypAT4A0EbGhClTw2TYADVRTtwXAnYKVACfHx73A=; b=l3tDYLrKjsJ62m21QCGnLSySf3DSnUjbNmKKw++gbfUrzinv+/Sr/UXt0LOdv+AFBh 2vFpsrd+lpxAgnb6uAWiCKCwZrlBI7GzL+ZONs4N7EdLAHYFfvmZtWqBgP5SI9fmTRuU 7HW1c4WpDpCeVgGzcH540pn/eWuqxRzk8Vm09LjjHwH6gkbLdQh0lCc5q57mN1k3Iueg hjdYYUB8zoP5jWtzeG2xcMAJSJaAccjFWs9iWYQ2NBjqz6KRRCbwTZN241aq9YZ5FFje upmlfjy8zlV/xCSTZXbC4tqrEyNvp6AdlNfCvPWwYeLkfkIf6ZN3TpyLYUHlACxUAwE6 DtQA== 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=+hJvypAT4A0EbGhClTw2TYADVRTtwXAnYKVACfHx73A=; b=Grj0/XfYXj0DOrFxJTUISl1Kizt3pqvRtBUP0yeIpYtk7vGELL9QhZ0cq3+V8dNZjM t8mf0BKSfn+xbD+8wKWvZb2/fm8y5N884t59kfanF8Jo1iQwiduFw3rQAMh1VnzXYJ5D gwFXqwib4/DmYtsLx0Jeg8Z7SspUmiS0tFiGu6uzJORC3lJcORaxkBPkruP5RIQptGpF C4Gehmcg+Qvgp9/5S8Lqrgh0s4LAN8hvg1fXEj15yuaUcpTiPfdrBA9nbMWifDUXIvj9 ijTnoUHrBNekb83teO8LfcFBn3768U5B+qHVxA354Cyc0kXGLWXdkp4njfR6FWLcgnYI Jt4Q== X-Gm-Message-State: APt69E1nKQEXmaElZY1sMTtBFzqnyBXOuSv0LX7fCgKMyrffVawCBIlr DIvc01RZgzrDaKNzTm1rffii7FBwMv3g+ywUTxI= X-Google-Smtp-Source: ADUXVKKSqOlkK9deZ3UOYSgPLxtKbc4UxnOS0uyuLiZpyRYprxv94SddutVKFI+X+V7OGv6LCXGBo6JaEu+5ms3eRwg= X-Received: by 2002:a2e:8605:: with SMTP id a5-v6mr2075853lji.43.1528291310541; Wed, 06 Jun 2018 06:21:50 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 2002:a2e:1702:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:21:49 -0700 (PDT) In-Reply-To: References: <201806061257.w56CvCwq089369@repo.freebsd.org> From: Justin Hibbits Date: Wed, 6 Jun 2018 09:21:49 -0400 X-Google-Sender-Auth: XtfUlyrqa-bZgkiF_4K2An84IpA Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:21:53 -0000 On Wed, Jun 6, 2018 at 9:02 AM, Warner Losh wrote: > > > On Wed, Jun 6, 2018 at 8:57 AM, Justin Hibbits wrote: >> >> Author: jhibbits >> Date: Wed Jun 6 12:57:11 2018 >> New Revision: 334708 >> URL: https://svnweb.freebsd.org/changeset/base/334708 >> >> Log: >> Add a memory barrier after taking a reference on the vnode holdcnt in >> _vhold >> >> This is needed to avoid a race between the VNASSERT() below, and another >> thread updating the VI_FREE flag, on weakly-ordered architectures. >> >> On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' >> would >> panic on the assert regularly. >> >> It may be possible to use a weaker barrier, and I'll investigate that >> once >> all stability issues are worked out on POWER9. >> >> Modified: >> head/sys/kern/vfs_subr.c >> >> Modified: head/sys/kern/vfs_subr.c >> >> ============================================================================== >> --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) >> +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) >> @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) >> CTR2(KTR_VFS, "%s: vp %p", __func__, vp); >> if (!locked) { >> if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { >> +#if !defined(__amd64__) && !defined(__i386__) >> + mb(); >> +#endif >> VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, >> ("_vhold: vnode with holdcnt is free")); >> return; >> > > So why isn't the refcount_acquire() enough? > > Warner I'm not entirely sure. I had never seen this before, it's only cropped up on my POWER9 system. The refcount_acquire doesn't include a memory barrier, and mjg is reluctant to add one, since most refcount users don't care about ordering. Adding the memory barrier appeases the VNASSERT(). It may only be necessary for the VNASSERT(), and may not be strictly necessary for proper operation, but I think it's safest this way, until better performance metrics can be done. - Justin From owner-svn-src-head@freebsd.org Wed Jun 6 13:22:55 2018 Return-Path: Delivered-To: svn-src-head@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 B7905FF5F9A; Wed, 6 Jun 2018 13:22:55 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 1B96374109; Wed, 6 Jun 2018 13:22:55 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f65.google.com with SMTP id d24-v6so9077443lfa.8; Wed, 06 Jun 2018 06:22:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OitHN4SgsLUs2UE1nHHThgGQjKnKTg/s5jcrsrNd6rE=; b=DVTcIvuxJOVJKMpzn40f8sPuWqBolbxXpgNmOjERhfbLI1z0aylZ7wed5IUbFny93+ GMu4EeW1bE8M7WgNrCv4esbTM1iqasxZoegLnsKmnFJ9sn2ddrvMyDgtTPQruWQLZ3y6 Pziycqy6VnnesQi7yxBqeyAhtXcP3Ux6dAqsjg3YitKERQcLc6tjFiw+qg3dV2g0uue1 zj9L/lUiuiFS2uM7fynYlerRWqI1mmy3a1Zkc4U+svy0UQ3PHaunQPancP4ty5XyrbM9 QBINbSKwDoN6inKFkXg2vFyMsGnKDc/Ix4E+Be+PG38qg3PnWg6x1Xq6KjNHSzVoeT89 jPOA== X-Gm-Message-State: APt69E2yVpd/E5WH+VLxx1SHB0VtbO1NB5JFejfMbQfNODEkb4ZzFjtT 2g1X7S6xeIHwKv0ojU2uRzMgZxOv4fo= X-Google-Smtp-Source: ADUXVKIndXkC2A9KV3tjUInFOS1rvEPYBRcVusr5L6JbKd8Di1DdVQycBzQGcHUo01TBmR7AhT/EuQ== X-Received: by 2002:a2e:560d:: with SMTP id k13-v6mr2088289ljb.124.1528291373034; Wed, 06 Jun 2018 06:22:53 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id y6-v6sm826955ljc.67.2018.06.06.06.22.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 06:22:52 -0700 (PDT) Subject: Re: svn commit: r334708 - head/sys/kern To: Warner Losh , Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806061257.w56CvCwq089369@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <600c9c66-fda6-de4c-3db7-0a79ef833f62@FreeBSD.org> Date: Wed, 6 Jun 2018 16:22:51 +0300 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 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:22:56 -0000 On 06/06/2018 16:02, Warner Losh wrote: > > > On Wed, Jun 6, 2018 at 8:57 AM, Justin Hibbits > wrote: > > Author: jhibbits > Date: Wed Jun  6 12:57:11 2018 > New Revision: 334708 > URL: https://svnweb.freebsd.org/changeset/base/334708 > > > Log: >   Add a memory barrier after taking a reference on the vnode holdcnt in _vhold > >   This is needed to avoid a race between the VNASSERT() below, and another >   thread updating the VI_FREE flag, on weakly-ordered architectures. > >   On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' would >   panic on the assert regularly. > >   It may be possible to use a weaker barrier, and I'll investigate that once >   all stability issues are worked out on POWER9. > > Modified: >   head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c    Wed Jun  6 10:46:24 2018        (r334707) > +++ head/sys/kern/vfs_subr.c    Wed Jun  6 12:57:11 2018        (r334708) > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) >         CTR2(KTR_VFS, "%s: vp %p", __func__, vp); >         if (!locked) { >                 if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > +#if !defined(__amd64__) && !defined(__i386__) > +                       mb(); > +#endif >                         VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, >                             ("_vhold: vnode with holdcnt is free")); >                         return; > > > So why isn't the refcount_acquire() enough? This is the wrong "acquire", "acquire" in a sense of "get" or "increment", not in a sense of a memory barrier. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Jun 6 13:25:23 2018 Return-Path: Delivered-To: svn-src-head@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 4C0DFFF60DB; Wed, 6 Jun 2018 13:25:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C9A742B6; Wed, 6 Jun 2018 13:25:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [137.122.64.159]) by mail.baldwin.cx (Postfix) with ESMTPSA id 54E4C10A87D; Wed, 6 Jun 2018 09:25:22 -0400 (EDT) Subject: Re: svn commit: r334089 - head/sbin/dumpon To: Eitan Adler References: <201805231045.w4NAjWsv059104@repo.freebsd.org> <2256597.yrYJmMiYOr@ralph.baldwin.cx> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <328b6f24-ffeb-4d16-c3da-d6673b495bcf@FreeBSD.org> Date: Wed, 6 Jun 2018 09:25:21 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; 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-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 06 Jun 2018 09:25:22 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:25:23 -0000 On 6/6/18 3:34 AM, Eitan Adler wrote: > On 23 May 2018 at 09:30, John Baldwin wrote: >> On Wednesday, May 23, 2018 10:45:32 AM Eitan Adler wrote: >>> Author: eadler >>> Date: Wed May 23 10:45:32 2018 >>> New Revision: 334089 >>> URL: https://svnweb.freebsd.org/changeset/base/334089 >>> >>> Log: >>> dumpon: point to better kernel debug symbols. >>> >>> The objdir is temporary, and the current example points to GENERIC. >>> Instead point to the installed location of the debug symbols that are >>> supposed to match the kernel you are using. >>> >>> PR: 223993 >>> Submitted by: Trond.Endrestol@ximalas.info > ... > > What do y'all think of something like: > > diff --git i/sbin/dumpon/dumpon.8 w/sbin/dumpon/dumpon.8 > index fd271b5..28162af 100644 > --- i/sbin/dumpon/dumpon.8 > +++ w/sbin/dumpon/dumpon.8 > @@ -311,15 +311,17 @@ The > can be now examined using > .Xr kgdb 1 : > .Pp > -.Dl # kgdb /usr/lib/debug/boot/kernel/kernel.debug vmcore.# > +.Dl # kgdb /boot/kernel/kernel vmcore.# > .Pp > or shorter: > .Pp > -.Dl # kgdb -n # /usr/lib/debug/boot/kernel/kernel.debug > +.Dl # kgdb -n # /boot/kernel/kernel This can just be 'kgdb -n #' kgdb uses the sysctl as the default kernel location. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Jun 6 13:29:53 2018 Return-Path: Delivered-To: svn-src-head@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 394ABFF62F3; Wed, 6 Jun 2018 13:29:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE1807459A; Wed, 6 Jun 2018 13:29:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAF453907; Wed, 6 Jun 2018 13:29:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56DTq5C004730; Wed, 6 Jun 2018 13:29:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56DTq0A004729; Wed, 6 Jun 2018 13:29:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061329.w56DTq0A004729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 13:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334710 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 334710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:29:53 -0000 Author: hselasky Date: Wed Jun 6 13:29:52 2018 New Revision: 334710 URL: https://svnweb.freebsd.org/changeset/base/334710 Log: Implement the rdmsrl_safe() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/asm/msr.h Modified: head/sys/compat/linuxkpi/common/include/asm/msr.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/msr.h Wed Jun 6 13:01:53 2018 (r334709) +++ head/sys/compat/linuxkpi/common/include/asm/msr.h Wed Jun 6 13:29:52 2018 (r334710) @@ -32,5 +32,6 @@ #include #define rdmsrl(msr, val) ((val) = rdmsr(msr)) +#define rdmsrl_safe(msr, val) rdmsr_safe(msr, val) #endif /* _ASM_MSR_H_ */ From owner-svn-src-head@freebsd.org Wed Jun 6 13:37:32 2018 Return-Path: Delivered-To: svn-src-head@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 5CBB8FF6675; Wed, 6 Jun 2018 13:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0276574B46; Wed, 6 Jun 2018 13:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF5553B34; Wed, 6 Jun 2018 13:37:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56DbVLE009663; Wed, 6 Jun 2018 13:37:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56DbVrk009662; Wed, 6 Jun 2018 13:37:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061337.w56DbVrk009662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 13:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334711 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:37:32 -0000 Author: hselasky Date: Wed Jun 6 13:37:31 2018 New Revision: 334711 URL: https://svnweb.freebsd.org/changeset/base/334711 Log: Implement the ktime_compare() and ktime_after() functions in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 6 13:29:52 2018 (r334710) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 6 13:37:31 2018 (r334711) @@ -127,6 +127,25 @@ ktime_add(ktime_t lhs, ktime_t rhs) return (lhs + rhs); } +static inline int +ktime_compare(const ktime_t cmp1, const ktime_t cmp2) +{ + + if (cmp1 > cmp2) + return (1); + else if (cmp1 < cmp2) + return (-1); + else + return (0); +} + +static inline bool +ktime_after(const ktime_t cmp1, const ktime_t cmp2) +{ + + return (ktime_compare(cmp1, cmp2) > 0); +} + static inline ktime_t timespec_to_ktime(struct timespec ts) { From owner-svn-src-head@freebsd.org Wed Jun 6 13:57:03 2018 Return-Path: Delivered-To: svn-src-head@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 BB839FF6DB4; Wed, 6 Jun 2018 13:57:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61A0775801; Wed, 6 Jun 2018 13:57:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [10.200.7.59] (unknown [137.122.64.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id F3482264B5; Wed, 6 Jun 2018 13:57:02 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Wed, 06 Jun 2018 09:57:01 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: Benjamin Kaduk CC: Mateusz Guzik , src-committers , , Message-ID: <41069956-C0D7-43C6-93D7-A843D991E47B@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:57:03 -0000 -----Original Message----- From: on behalf of Benjamin Kaduk Date: 2018-06-06, Wednesday at 07:40 To: Ravi Pokala Cc: Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: >>=20 >> Hi Mateusz, >>=20 >> =EF=BB=BF-----Original Message----- >> From: on behalf of Mateusz Guzik >> Date: 2018-06-06, Wednesday at 01:08 >> To: , , >> Subject: svn commit: r334702 - head/sys/sys >>=20 >>> ... >>> #ifdef _KERNEL >>> #define malloc(size, type, flags) ({ = \ >>=20 >> Now that I'm taking another look at this, I'm confused as to why the ent= ire macro expansion is inside parentheses? (The braces make sense, since thi= s is a block with local variables which need to be contained.) >=20 > This is a gcc (and clang) extension to allow the macro body to be a code = block -- standard C gets unhappy with just the curly braces. https://gcc.gn= u.org/onlinedocs/gcc/Statement-Exprs.html is a maybe-relevant page that goog= le found me. "Neat." Thanks Ben. -Ravi > -Ben=20 From owner-svn-src-head@freebsd.org Wed Jun 6 13:59:52 2018 Return-Path: Delivered-To: svn-src-head@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 463EDFF6F90; Wed, 6 Jun 2018 13:59:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEE7F759E2; Wed, 6 Jun 2018 13:59:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D18D93E6F; Wed, 6 Jun 2018 13:59:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56DxpPY020225; Wed, 6 Jun 2018 13:59:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56DxpSZ020224; Wed, 6 Jun 2018 13:59:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061359.w56DxpSZ020224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 13:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334712 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 334712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 13:59:52 -0000 Author: hselasky Date: Wed Jun 6 13:59:51 2018 New Revision: 334712 URL: https://svnweb.freebsd.org/changeset/base/334712 Log: Implement the atomic_dec_if_positive() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 6 13:37:31 2018 (r334711) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 6 13:59:51 2018 (r334712) @@ -235,6 +235,22 @@ atomic_cmpxchg(atomic_t *v, int old, int new) __ret.val; \ }) +static inline int +atomic_dec_if_positive(atomic_t *v) +{ + int retval; + int curr; + + do { + curr = atomic_read(v); + retval = curr - 1; + if (unlikely(retval < 0)) + break; + } while (!likely(atomic_cmpset_int(&v->counter, curr, retval))); + + return (retval); +} + #define LINUX_ATOMIC_OP(op, c_op) \ static inline void atomic_##op(int i, atomic_t *v) \ { \ From owner-svn-src-head@freebsd.org Wed Jun 6 14:03:29 2018 Return-Path: Delivered-To: svn-src-head@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 196EAFF73AE; Wed, 6 Jun 2018 14:03:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 87A7F75EBC; Wed, 6 Jun 2018 14:03:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w56E3COl022871; Wed, 6 Jun 2018 17:03:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w56E3COl022871 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w56E3B7L022870; Wed, 6 Jun 2018 17:03:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 6 Jun 2018 17:03:11 +0300 From: Konstantin Belousov To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180606140311.GU2450@kib.kiev.ua> References: <201806061257.w56CvCwq089369@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806061257.w56CvCwq089369@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 14:03:29 -0000 On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Jun 6 12:57:11 2018 > New Revision: 334708 > URL: https://svnweb.freebsd.org/changeset/base/334708 > > Log: > Add a memory barrier after taking a reference on the vnode holdcnt in _vhold > > This is needed to avoid a race between the VNASSERT() below, and another > thread updating the VI_FREE flag, on weakly-ordered architectures. > > On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' would > panic on the assert regularly. > > It may be possible to use a weaker barrier, and I'll investigate that once > all stability issues are worked out on POWER9. > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > if (!locked) { > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > +#if !defined(__amd64__) && !defined(__i386__) > + mb(); > +#endif > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > ("_vhold: vnode with holdcnt is free")); > return; First, mb() must not be used in the FreeBSD code at all. Look at atomic_thread_fenceXXX(9) KPI. Second, you need the reciprocal fence between clearing of VI_FREE and refcount_acquire(), otherwise the added barrier is nop. Most likely, you got away with it because there is a mutex unlock between clearing of VI_FREE and acquire, which release semantic you abused. Does the fence needed for the non-invariants case ? Fourth, doesn't v_usecount has the same issues WRT inactivation ? From owner-svn-src-head@freebsd.org Wed Jun 6 14:22:18 2018 Return-Path: Delivered-To: svn-src-head@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 41FA2FF7D22; Wed, 6 Jun 2018 14:22:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E790F76AC4; Wed, 6 Jun 2018 14:22:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id CA0122BD3; Wed, 6 Jun 2018 14:22:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1B4D15C43; Wed, 6 Jun 2018 14:22:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0S7-514IDFDa; Wed, 6 Jun 2018 14:22:14 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 80E895C40 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events From: Bryan Drewery X-Mailer: iPhone Mail (15E302) In-Reply-To: Date: Wed, 6 Jun 2018 10:22:12 -0400 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <22DC270C-75B9-4219-B022-AF1C3E9022F0@FreeBSD.org> References: <201805252146.w4PLk7vL009258@repo.freebsd.org> To: Kyle Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 14:22:18 -0000 Will look today or tomorrow. Pretty sure just a small thing is missing from M= akefile.libcompat. Regards, Bryan Drewery > On Jun 5, 2018, at 00:32, Kyle Evans wrote: >=20 >> On Mon, Jun 4, 2018 at 10:11 PM, Kyle Evans wrote: >>> On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery wr= ote: >>> Author: bdrewery >>> Date: Fri May 25 21:46:07 2018 >>> New Revision: 334226 >>> URL: https://svnweb.freebsd.org/changeset/base/334226 >>>=20 >>> Log: >>> Cleanup style >>>=20 >>> Modified: >>> head/lib/libpmcstat/pmu-events/Makefile >>>=20 >>> Modified: head/lib/libpmcstat/pmu-events/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >>> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2018= (r334225) >>> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2018= (r334226) >>> @@ -1,9 +1,10 @@ >>> # $FreeBSD$ >>>=20 >>> -PROG=3Djevents >>> -SRCS=3Djevents.c jsmn.c json.c >>> +PROG=3D jevents >>> +SRCS=3D jevents.c jsmn.c json.c >>> CFLAGS+=3D -Wno-cast-qual >>> -.PATH: ${.CURDIR} >>> -build-tools: jevents >>> MAN=3D >>> + >>> +build-tools: jevents >>> + >>> .include >>>=20 >>=20 >> Hi Bryan, >>=20 >> Something about this appears to be subtly wrong, but I can't quite pin >> down what. I'm getting a failure in the lib32 build of libpmc: >>=20 >> sh: ./pmu-events/jevents: not found >>=20 >> My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents >> exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents. >> ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and >> libpmc_events.c.meta. I'm guessing this is the problem- that >> obj-lib32/... doesn't have the built jevents, but it's not obvious to >> me why this is the case. >=20 > Some additional context: >=20 > SRCCONF is defined to a file that looks like this: >=20 > WITH_BSD_GREP=3D"YES" > WITHOUT_BSD_GREP_FASTMATCH=3D"YES" > WITH_LOADER_LUA=3D"YES" > WITHOUT_FORTH=3D"YES" >=20 > _SRC_ENV_CONF and __MAKE_CONF are set to /dev/null; all three set in > arguments to make(1). OBJDIR has been completely wiped before-hand. From owner-svn-src-head@freebsd.org Wed Jun 6 14:59:25 2018 Return-Path: Delivered-To: svn-src-head@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 08BF5FF8B24; Wed, 6 Jun 2018 14:59:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6CF77CDC; Wed, 6 Jun 2018 14:59:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70AB24837; Wed, 6 Jun 2018 14:59:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56ExOpJ050716; Wed, 6 Jun 2018 14:59:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56ExNRJ050714; Wed, 6 Jun 2018 14:59:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061459.w56ExNRJ050714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 14:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334713 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 334713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 14:59:25 -0000 Author: hselasky Date: Wed Jun 6 14:59:23 2018 New Revision: 334713 URL: https://svnweb.freebsd.org/changeset/base/334713 Log: Implement the init_wait_entry() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 13:59:51 2018 (r334712) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 14:59:23 2018 (r334713) @@ -106,8 +106,11 @@ extern wait_queue_func_t default_wake_function; INIT_LIST_HEAD(&(wqh)->task_list); \ } while (0) +void linux_init_wait_entry(wait_queue_t *, int); void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool); +#define init_wait_entry(wq, flags) \ + linux_init_wait_entry(wq, flags) #define wake_up(wqh) \ linux_wake_up(wqh, TASK_NORMAL, 1, false) #define wake_up_all(wqh) \ Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Jun 6 13:59:51 2018 (r334712) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Jun 6 14:59:23 2018 (r334713) @@ -188,6 +188,17 @@ default_wake_function(wait_queue_t *wq, unsigned int s } void +linux_init_wait_entry(wait_queue_t *wq, int flags) +{ + + memset(wq, 0, sizeof(*wq)); + wq->flags = flags; + wq->private = current; + wq->func = autoremove_wake_function; + INIT_LIST_HEAD(&wq->task_list); +} + +void linux_wake_up(wait_queue_head_t *wqh, unsigned int state, int nr, bool locked) { wait_queue_t *pos, *next; From owner-svn-src-head@freebsd.org Wed Jun 6 15:06:22 2018 Return-Path: Delivered-To: svn-src-head@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 93EFDFF8FB6; Wed, 6 Jun 2018 15:06:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4670778399; Wed, 6 Jun 2018 15:06:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2835A49C9; Wed, 6 Jun 2018 15:06:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56F6LvP055964; Wed, 6 Jun 2018 15:06:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56F6LRR055963; Wed, 6 Jun 2018 15:06:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061506.w56F6LRR055963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334714 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:06:22 -0000 Author: hselasky Date: Wed Jun 6 15:06:21 2018 New Revision: 334714 URL: https://svnweb.freebsd.org/changeset/base/334714 Log: Rename two structure field members while keeping backwards compatibility in the LinuxKPI. Add a comment saying in which Linux version this change was made. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 14:59:23 2018 (r334713) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 15:06:21 2018 (r334714) @@ -63,12 +63,18 @@ struct wait_queue { unsigned int flags; /* always 0 */ void *private; wait_queue_func_t *func; - struct list_head task_list; + union { + struct list_head task_list; /* < v4.13 */ + struct list_head entry; /* >= v4.13 */ + }; }; struct wait_queue_head { spinlock_t lock; - struct list_head task_list; + union { + struct list_head task_list; /* < v4.13 */ + struct list_head head; /* >= v4.13 */ + }; }; /* From owner-svn-src-head@freebsd.org Wed Jun 6 15:06:44 2018 Return-Path: Delivered-To: svn-src-head@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 D81AAFD0004; Wed, 6 Jun 2018 15:06:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 82656784CD; Wed, 6 Jun 2018 15:06:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id i18-v6so6663592qtp.12; Wed, 06 Jun 2018 08:06:43 -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=diGLwL8ukBvgfLf6E/dXBNTNiQe1zne2hnIQ0AgVqrQ=; b=rMnSx9En5xIYuEeam3OMEHSILpanDG6e8OT+vA09HUdGoJsz7UeQWX6jmwOPgITMcP y5yiMH2jyQdd+EbQdUgKszC6jkgiElqrJv1hIoYhProxWnGAM78iSqU2OYfKbNWV81aw FuUkZ1Pu6rngVsW5CaA/t4C9TIBcxVmEh1JfFU6rWH0mV6fZMz63odvWWfi+vFsAS0N+ r193W189LP1TTi4Rvf3qXhA+U45Ds5xvyRh6svFgxttkHigwMtqwgdiIkcnzpzNju2DC WfkwST8AZ5+rtpcoApA5dzF8ILNtVgKMhTNZ3yPQwuBJUcczsZoeKhvFlOxJhyognrWt OibA== 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=diGLwL8ukBvgfLf6E/dXBNTNiQe1zne2hnIQ0AgVqrQ=; b=qUMsSMJwCJTXgrbDVRmpQbml5VYXEIM5mh2lRcPe0u19SE7+BL/fpX6lIZqlW3NNzL YTaBZ2HOienfFE1KsW5FLgMNZFjrNGTwFsP4yV52o8qy+yroDmxu0KcsHUzGlpW8ME16 mmv7iEDATlLP9ut3aq/9HSsCPDKaNjF0/hgqqdegiGU1ao7LVKtrDAmlR3qQ6Ckfr8NE INASPGMCsFcQvxBYv0eRnhLtpb0hIsWPvDB/5oKW8axl+hDiZptqlJDHVVfrdLyKmF+X NJIKkHc3pzoNRchsihNxacAr0tVJ7ouWDKRTkS1BKs3w8LjAcuPTpMeDPplVSsvhu6rV Rxnw== X-Gm-Message-State: APt69E10hK1fUS7h51rKqymgphKm3QdbJN2V3LeeMrkYtBsDwHUcBued rLmVYIIUBovJTQifCsEwoA189PISIZCTD5bJhzFN8g== X-Google-Smtp-Source: ADUXVKLHZJ3afBz2JSiwMbF8CFcGcy5uMfqHYjAeAIoDaudZZ0VFRIEng9TeXaUsEcgKLCila0nciCGBHx91teBAX4o= X-Received: by 2002:ac8:34aa:: with SMTP id w39-v6mr2998336qtb.237.1528297602857; Wed, 06 Jun 2018 08:06:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:1c4e:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 08:06:42 -0700 (PDT) In-Reply-To: <201806061359.w56DxpSZ020224@repo.freebsd.org> References: <201806061359.w56DxpSZ020224@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 6 Jun 2018 17:06:42 +0200 Message-ID: Subject: Re: svn commit: r334712 - head/sys/compat/linuxkpi/common/include/asm To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:06:44 -0000 On Wed, Jun 6, 2018 at 3:59 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Jun 6 13:59:51 2018 > New Revision: 334712 > URL: https://svnweb.freebsd.org/changeset/base/334712 > > Log: > Implement the atomic_dec_if_positive() function in the LinuxKPI. > > Submitted by: Johannes Lundberg > MFC after: 1 week > Sponsored by: Mellanox Technologies > Sponsored by: Limelight Networks > > Modified: > head/sys/compat/linuxkpi/common/include/asm/atomic.h > > Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h > ============================================================ > ================== > --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun > 6 13:37:31 2018 (r334711) > +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun > 6 13:59:51 2018 (r334712) > @@ -235,6 +235,22 @@ atomic_cmpxchg(atomic_t *v, int old, int new) > __ret.val; \ > }) > > +static inline int > +atomic_dec_if_positive(atomic_t *v) > +{ > + int retval; > + int curr; > + > + do { > + curr = atomic_read(v); > + retval = curr - 1; > + if (unlikely(retval < 0)) > + break; > + } while (!likely(atomic_cmpset_int(&v->counter, curr, retval))); > + > + return (retval); > +} > + > cmpset loops are crap since they require an explicit re-read of the target value see fcmpset and refcount_acquire_if_not_zero for an example use -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Jun 6 15:10:13 2018 Return-Path: Delivered-To: svn-src-head@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 08B40FD039F; Wed, 6 Jun 2018 15:10:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C4A9787F2; Wed, 6 Jun 2018 15:10:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDEE49CF; Wed, 6 Jun 2018 15:10:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56FACwp056161; Wed, 6 Jun 2018 15:10:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56FACOr056160; Wed, 6 Jun 2018 15:10:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061510.w56FACOr056160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334715 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:10:13 -0000 Author: hselasky Date: Wed Jun 6 15:10:11 2018 New Revision: 334715 URL: https://svnweb.freebsd.org/changeset/base/334715 Log: Implement the might_sleep_if() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 15:06:21 2018 (r334714) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 15:10:11 2018 (r334715) @@ -47,6 +47,10 @@ #define might_sleep() \ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()") +#define might_sleep_if(cond) do { \ + if (cond) { might_sleep(); } \ +} while (0) + struct wait_queue; struct wait_queue_head; From owner-svn-src-head@freebsd.org Wed Jun 6 15:12:20 2018 Return-Path: Delivered-To: svn-src-head@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 B1FFEFD08E5; Wed, 6 Jun 2018 15:12:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A55478DE3; Wed, 6 Jun 2018 15:12:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A92F4B51; Wed, 6 Jun 2018 15:12:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56FCKJK057311; Wed, 6 Jun 2018 15:12:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56FCKgf057289; Wed, 6 Jun 2018 15:12:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806061512.w56FCKgf057289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 6 Jun 2018 15:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334716 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:12:20 -0000 Author: jhibbits Date: Wed Jun 6 15:12:19 2018 New Revision: 334716 URL: https://svnweb.freebsd.org/changeset/base/334716 Log: Revert r334708 This is the wrong place to put the barrier. Requested by: kib,mjg Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jun 6 15:10:11 2018 (r334715) +++ head/sys/kern/vfs_subr.c Wed Jun 6 15:12:19 2018 (r334716) @@ -2807,9 +2807,6 @@ _vhold(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (!locked) { if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { -#if !defined(__amd64__) && !defined(__i386__) - mb(); -#endif VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("_vhold: vnode with holdcnt is free")); return; From owner-svn-src-head@freebsd.org Wed Jun 6 15:19:31 2018 Return-Path: Delivered-To: svn-src-head@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 9306BFD0ECA; Wed, 6 Jun 2018 15:19:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4181B794B1; Wed, 6 Jun 2018 15:19:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17D5F4B6F; Wed, 6 Jun 2018 15:19:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56FJUpO061668; Wed, 6 Jun 2018 15:19:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56FJUmY061667; Wed, 6 Jun 2018 15:19:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061519.w56FJUmY061667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334717 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:19:31 -0000 Author: hselasky Date: Wed Jun 6 15:19:30 2018 New Revision: 334717 URL: https://svnweb.freebsd.org/changeset/base/334717 Log: Implement the __add_wait_queue_entry_tail() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 15:12:19 2018 (r334716) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 6 15:19:30 2018 (r334717) @@ -54,7 +54,10 @@ struct wait_queue; struct wait_queue_head; +#define wait_queue_entry wait_queue + typedef struct wait_queue wait_queue_t; +typedef struct wait_queue_entry wait_queue_entry_t; typedef struct wait_queue_head wait_queue_head_t; typedef int wait_queue_func_t(wait_queue_t *, unsigned int, int, void *); @@ -246,6 +249,12 @@ static inline void __add_wait_queue_tail(wait_queue_head_t *wqh, wait_queue_t *wq) { list_add_tail(&wq->task_list, &wqh->task_list); +} + +static inline void +__add_wait_queue_entry_tail(wait_queue_head_t *wqh, wait_queue_entry_t *wq) +{ + list_add_tail(&wq->entry, &wqh->head); } static inline void From owner-svn-src-head@freebsd.org Wed Jun 6 15:31:48 2018 Return-Path: Delivered-To: svn-src-head@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 1995CFD15F4; Wed, 6 Jun 2018 15:31:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3B247A093; Wed, 6 Jun 2018 15:31:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4CCF4E62; Wed, 6 Jun 2018 15:31:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56FVl73069784; Wed, 6 Jun 2018 15:31:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56FVltF069783; Wed, 6 Jun 2018 15:31:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061531.w56FVltF069783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334718 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 334718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:31:48 -0000 Author: hselasky Date: Wed Jun 6 15:31:47 2018 New Revision: 334718 URL: https://svnweb.freebsd.org/changeset/base/334718 Log: Rewrite code using atomic_fcmpset_int() in the LinuxKPI. Suggested by: mjg@ MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 6 15:19:30 2018 (r334717) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 6 15:31:47 2018 (r334718) @@ -239,15 +239,16 @@ static inline int atomic_dec_if_positive(atomic_t *v) { int retval; - int curr; + int old; - do { - curr = atomic_read(v); - retval = curr - 1; + old = atomic_read(v); + for (;;) { + retval = old - 1; if (unlikely(retval < 0)) break; - } while (!likely(atomic_cmpset_int(&v->counter, curr, retval))); - + if (likely(atomic_fcmpset_int(&v->counter, &old, retval))) + break; + } return (retval); } From owner-svn-src-head@freebsd.org Wed Jun 6 15:36:40 2018 Return-Path: Delivered-To: svn-src-head@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 CFC56FD1AB4; Wed, 6 Jun 2018 15:36:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6880B7A646; Wed, 6 Jun 2018 15:36:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 3AB1C4D27; Wed, 6 Jun 2018 15:36:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8534D5E82; Wed, 6 Jun 2018 15:36:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id RRa5C2yAFkuk; Wed, 6 Jun 2018 15:36:36 +0000 (UTC) Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 62F0A5E7B To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805252146.w4PLk7vL009258@repo.freebsd.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <06289a72-2948-083f-d208-d9f36d88699e@FreeBSD.org> Date: Wed, 6 Jun 2018 11:36:34 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OyKVroGYbCm2cNsmNkwb5QKP5gWGKcnk0" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:36:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OyKVroGYbCm2cNsmNkwb5QKP5gWGKcnk0 Content-Type: multipart/mixed; boundary="n9zkG49Ai8edcwAWJLoQp7foIXCcauabv"; protected-headers="v1" From: Bryan Drewery To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <06289a72-2948-083f-d208-d9f36d88699e@FreeBSD.org> Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events References: <201805252146.w4PLk7vL009258@repo.freebsd.org> In-Reply-To: --n9zkG49Ai8edcwAWJLoQp7foIXCcauabv Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/5/18 12:32 AM, Kyle Evans wrote: > On Mon, Jun 4, 2018 at 10:11 PM, Kyle Evans wrote:= >> On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery = wrote: >>> Author: bdrewery >>> Date: Fri May 25 21:46:07 2018 >>> New Revision: 334226 >>> URL: https://svnweb.freebsd.org/changeset/base/334226 >>> >>> Log: >>> Cleanup style >>> >>> Modified: >>> head/lib/libpmcstat/pmu-events/Makefile >>> >>> Modified: head/lib/libpmcstat/pmu-events/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2= 018 (r334225) >>> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2= 018 (r334226) >>> @@ -1,9 +1,10 @@ >>> # $FreeBSD$ >>> >>> -PROG=3Djevents >>> -SRCS=3Djevents.c jsmn.c json.c >>> +PROG=3D jevents >>> +SRCS=3D jevents.c jsmn.c json.c >>> CFLAGS+=3D -Wno-cast-qual >>> -.PATH: ${.CURDIR} >>> -build-tools: jevents >>> MAN=3D >>> + >>> +build-tools: jevents >>> + >>> .include >>> >> >> Hi Bryan, >> >> Something about this appears to be subtly wrong, but I can't quite pin= >> down what. I'm getting a failure in the lib32 build of libpmc: >> >> sh: ./pmu-events/jevents: not found I believe this was fixed by r334455. >> >> My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents >> exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents. >> ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and >> libpmc_events.c.meta. I'm guessing this is the problem- that >> obj-lib32/... doesn't have the built jevents, but it's not obvious to >> me why this is the case. >=20 > Some additional context: >=20 > SRCCONF is defined to a file that looks like this: >=20 > WITH_BSD_GREP=3D"YES" > WITHOUT_BSD_GREP_FASTMATCH=3D"YES" > WITH_LOADER_LUA=3D"YES" > WITHOUT_FORTH=3D"YES" >=20 > _SRC_ENV_CONF and __MAKE_CONF are set to /dev/null; all three set in > arguments to make(1). OBJDIR has been completely wiped before-hand. >=20 --=20 Regards, Bryan Drewery --n9zkG49Ai8edcwAWJLoQp7foIXCcauabv-- --OyKVroGYbCm2cNsmNkwb5QKP5gWGKcnk0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlsX/4IACgkQNddxu25G l88DLgf/RssG0YrdwEGWUYI5kMpKlF9ktMpGX8tSAPMdNBUddCASgFCR4COWYWk6 X3TxIl0SrINuVQlJuTPj2vpGsUFZidHXat2ClVJuVBIoMQZ1Pw3H5BH5dcdlU00r Ce6YboBCHPTnD76bjHF6hOyrZv8Qy1hpPhTdOPuWAnNbBVbQ4FEWjNuhiSGsboGR hX2lk0rsvQ2Mb/jxw/wWWH5YVza5il1dl9LaV3R0dRTuYpetKs9mWZK21IS9Uu28 ypemjcQ0kmYPFULDg9TRMrERmFZCCU+il0jLeW6VBZFJLIU7qaKbnOug9RSJ2/57 mhp8gpgKQJfyqm8ySQRAhUxJkpxwJQ== =14Zv -----END PGP SIGNATURE----- --OyKVroGYbCm2cNsmNkwb5QKP5gWGKcnk0-- From owner-svn-src-head@freebsd.org Wed Jun 6 15:46:01 2018 Return-Path: Delivered-To: svn-src-head@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 3507BFD3184; Wed, 6 Jun 2018 15:46:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D87FC7AC23; Wed, 6 Jun 2018 15:46:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8DA35049; Wed, 6 Jun 2018 15:46:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56Fk0aX076899; Wed, 6 Jun 2018 15:46:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56Fjv3e076880; Wed, 6 Jun 2018 15:45:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806061545.w56Fjv3e076880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 6 Jun 2018 15:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334719 - in head: cddl/lib/libdtrace lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: cddl/lib/libdtrace lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Commit-Revision: 334719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:46:01 -0000 Author: sbruno Date: Wed Jun 6 15:45:57 2018 New Revision: 334719 URL: https://svnweb.freebsd.org/changeset/base/334719 Log: Load balance sockets with new SO_REUSEPORT_LB option. This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures: Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations: As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). This is a substantially different contribution as compared to its original incarnation at svn r332894 and reverted at svn r332967. Thanks to rwatson@ for the substantive feedback that is included in this commit. Submitted by: Johannes Lundberg Obtained from: DragonflyBSD Relnotes: Yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Modified: head/cddl/lib/libdtrace/tcp.d head/lib/libc/sys/getsockopt.2 head/sys/kern/uipc_debug.c head/sys/kern/uipc_socket.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/socket.h head/sys/sys/socketvar.h Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Wed Jun 6 15:31:47 2018 (r334718) +++ head/cddl/lib/libdtrace/tcp.d Wed Jun 6 15:45:57 2018 (r334719) @@ -192,12 +192,12 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); tcps_laddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie6_local); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); tcps_raddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); tcps_state = p == NULL ? -1 : p->t_state; tcps_iss = p == NULL ? 0 : p->iss; tcps_irs = p == NULL ? 0 : p->irs; Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Wed Jun 6 15:31:47 2018 (r334718) +++ head/lib/libc/sys/getsockopt.2 Wed Jun 6 15:45:57 2018 (r334719) @@ -152,6 +152,7 @@ and set with .It Dv SO_DEBUG Ta "enables recording of debugging information" .It Dv SO_REUSEADDR Ta "enables local address reuse" .It Dv SO_REUSEPORT Ta "enables duplicate address and port bindings" +.It Dv SO_REUSEPORT_LB Ta "enables duplicate address and port bindings with load balancing" .It Dv SO_KEEPALIVE Ta "enables keep connections alive" .It Dv SO_DONTROUTE Ta "enables routing bypass for outgoing messages" .It Dv SO_LINGER Ta "linger on close if data present" @@ -207,6 +208,15 @@ if they all set before binding the port. This option permits multiple instances of a program to each receive UDP/IP multicast or broadcast datagrams destined for the bound port. +.Pp +.Dv SO_REUSEPORT_LB +allows completely duplicate bindings by multiple processes +if they all set +.Dv SO_REUSEPORT_LB +before binding the port. +Incoming TCP and UDP connections are distributed among the sharing +processes based on a hash function of local port number, foreign IP +address and port number. A maximum of 256 processes can share one socket. .Pp .Dv SO_KEEPALIVE enables the Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/kern/uipc_debug.c Wed Jun 6 15:45:57 2018 (r334719) @@ -77,7 +77,7 @@ db_print_sotype(short so_type) } static void -db_print_sooptions(short so_options) +db_print_sooptions(int so_options) { int comma; @@ -120,6 +120,10 @@ db_print_sooptions(short so_options) } if (so_options & SO_REUSEPORT) { db_printf("%sSO_REUSEPORT", comma ? ", " : ""); + comma = 1; + } + if (so_options & SO_REUSEPORT_LB) { + db_printf("%sSO_REUSEPORT_LB", comma ? ", " : ""); comma = 1; } if (so_options & SO_TIMESTAMP) { Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/kern/uipc_socket.c Wed Jun 6 15:45:57 2018 (r334719) @@ -2776,6 +2776,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_BROADCAST: case SO_REUSEADDR: case SO_REUSEPORT: + case SO_REUSEPORT_LB: case SO_OOBINLINE: case SO_TIMESTAMP: case SO_BINTIME: @@ -2994,6 +2995,7 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_KEEPALIVE: case SO_REUSEADDR: case SO_REUSEPORT: + case SO_REUSEPORT_LB: case SO_BROADCAST: case SO_OOBINLINE: case SO_ACCEPTCONN: Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet/in_pcb.c Wed Jun 6 15:45:57 2018 (r334719) @@ -108,6 +108,9 @@ __FBSDID("$FreeBSD$"); #include +#define INPCBLBGROUP_SIZMIN 8 +#define INPCBLBGROUP_SIZMAX 256 + static struct callout ipport_tick_callout; /* @@ -217,7 +220,214 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtim * functions often modify hash chains or addresses in pcbs. */ +static struct inpcblbgroup * +in_pcblbgroup_alloc(struct inpcblbgrouphead *hdr, u_char vflag, + uint16_t port, const union in_dependaddr *addr, int size) +{ + struct inpcblbgroup *grp; + size_t bytes; + + bytes = __offsetof(struct inpcblbgroup, il_inp[size]); + grp = malloc(bytes, M_PCB, M_ZERO | M_NOWAIT); + if (!grp) + return (NULL); + grp->il_vflag = vflag; + grp->il_lport = port; + grp->il_dependladdr = *addr; + grp->il_inpsiz = size; + LIST_INSERT_HEAD(hdr, grp, il_list); + return (grp); +} + +static void +in_pcblbgroup_free(struct inpcblbgroup *grp) +{ + + LIST_REMOVE(grp, il_list); + free(grp, M_TEMP); +} + +static struct inpcblbgroup * +in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, + struct inpcblbgroup *old_grp, int size) +{ + struct inpcblbgroup *grp; + int i; + + grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag, + old_grp->il_lport, &old_grp->il_dependladdr, size); + if (!grp) + return (NULL); + + KASSERT(old_grp->il_inpcnt < grp->il_inpsiz, + ("invalid new local group size %d and old local group count %d", + grp->il_inpsiz, old_grp->il_inpcnt)); + + for (i = 0; i < old_grp->il_inpcnt; ++i) + grp->il_inp[i] = old_grp->il_inp[i]; + grp->il_inpcnt = old_grp->il_inpcnt; + in_pcblbgroup_free(old_grp); + return (grp); +} + /* + * PCB at index 'i' is removed from the group. Pull up the ones below il_inp[i] + * and shrink group if possible. + */ +static void +in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp, + int i) +{ + struct inpcblbgroup *grp = *grpp; + + for (; i + 1 < grp->il_inpcnt; ++i) + grp->il_inp[i] = grp->il_inp[i + 1]; + grp->il_inpcnt--; + + if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && + grp->il_inpcnt <= (grp->il_inpsiz / 4)) { + /* Shrink this group. */ + struct inpcblbgroup *new_grp = + in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); + if (new_grp) + *grpp = new_grp; + } + return; +} + +/* + * Add PCB to load balance group for SO_REUSEPORT_LB option. + */ +static int +in_pcbinslbgrouphash(struct inpcb *inp) +{ + struct inpcbinfo *pcbinfo; + struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + uint16_t hashmask, lport; + uint32_t group_index; + struct ucred *cred; + static int limit_logged = 0; + + pcbinfo = inp->inp_pcbinfo; + + INP_WLOCK_ASSERT(inp); + INP_HASH_WLOCK_ASSERT(pcbinfo); + + if (pcbinfo->ipi_lbgrouphashbase == NULL) + return (0); + + hashmask = pcbinfo->ipi_lbgrouphashmask; + lport = inp->inp_lport; + group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask); + hdr = &pcbinfo->ipi_lbgrouphashbase[group_index]; + + /* + * Don't allow jailed socket to join local group. + */ + if (inp->inp_socket != NULL) + cred = inp->inp_socket->so_cred; + else + cred = NULL; + if (cred != NULL && jailed(cred)) + return (0); + +#ifdef INET6 + /* + * Don't allow IPv4 mapped INET6 wild socket. + */ + if ((inp->inp_vflag & INP_IPV4) && + inp->inp_laddr.s_addr == INADDR_ANY && + INP_CHECK_SOCKAF(inp->inp_socket, AF_INET6)) { + return (0); + } +#endif + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(inp->inp_lport, + pcbinfo->ipi_lbgrouphashmask)]; + LIST_FOREACH(grp, hdr, il_list) { + if (grp->il_vflag == inp->inp_vflag && + grp->il_lport == inp->inp_lport && + memcmp(&grp->il_dependladdr, + &inp->inp_inc.inc_ie.ie_dependladdr, + sizeof(grp->il_dependladdr)) == 0) { + break; + } + } + if (grp == NULL) { + /* Create new load balance group. */ + grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, + inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, + INPCBLBGROUP_SIZMIN); + if (!grp) + return (ENOBUFS); + } else if (grp->il_inpcnt == grp->il_inpsiz) { + if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { + if (!limit_logged) { + limit_logged = 1; + printf("lb group port %d, limit reached\n", + ntohs(grp->il_lport)); + } + return (0); + } + + /* Expand this local group. */ + grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); + if (!grp) + return (ENOBUFS); + } + + KASSERT(grp->il_inpcnt < grp->il_inpsiz, + ("invalid local group size %d and count %d", + grp->il_inpsiz, grp->il_inpcnt)); + + grp->il_inp[grp->il_inpcnt] = inp; + grp->il_inpcnt++; + return (0); +} + +/* + * Remove PCB from load balance group. + */ +static void +in_pcbremlbgrouphash(struct inpcb *inp) +{ + struct inpcbinfo *pcbinfo; + struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + int i; + + pcbinfo = inp->inp_pcbinfo; + + INP_WLOCK_ASSERT(inp); + INP_HASH_WLOCK_ASSERT(pcbinfo); + + if (pcbinfo->ipi_lbgrouphashbase == NULL) + return; + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(inp->inp_lport, + pcbinfo->ipi_lbgrouphashmask)]; + + LIST_FOREACH(grp, hdr, il_list) { + for (i = 0; i < grp->il_inpcnt; ++i) { + if (grp->il_inp[i] != inp) + continue; + + if (grp->il_inpcnt == 1) { + /* We are the last, free this local group. */ + in_pcblbgroup_free(grp); + } else { + /* Pull up inpcbs, shrink group if possible. */ + in_pcblbgroup_reorder(hdr, &grp, i); + } + return; + } + } +} + +/* * Different protocols initialize their inpcbs differently - giving * different name to the lock. But they all are disposed the same. */ @@ -252,6 +462,8 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char &pcbinfo->ipi_hashmask); pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_porthashmask); + pcbinfo->ipi_lbgrouphashbase = hashinit(hash_nelements, M_PCB, + &pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_init(pcbinfo, hashfields, hash_nelements); #endif @@ -275,6 +487,8 @@ in_pcbinfo_destroy(struct inpcbinfo *pcbinfo) hashdestroy(pcbinfo->ipi_hashbase, M_PCB, pcbinfo->ipi_hashmask); hashdestroy(pcbinfo->ipi_porthashbase, M_PCB, pcbinfo->ipi_porthashmask); + hashdestroy(pcbinfo->ipi_lbgrouphashbase, M_PCB, + pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_destroy(pcbinfo); #endif @@ -513,18 +727,20 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp /* * Return cached socket options. */ -short +int inp_so_options(const struct inpcb *inp) { - short so_options; + int so_options; - so_options = 0; + so_options = 0; - if ((inp->inp_flags2 & INP_REUSEPORT) != 0) - so_options |= SO_REUSEPORT; - if ((inp->inp_flags2 & INP_REUSEADDR) != 0) - so_options |= SO_REUSEADDR; - return (so_options); + if ((inp->inp_flags2 & INP_REUSEPORT_LB) != 0) + so_options |= SO_REUSEPORT_LB; + if ((inp->inp_flags2 & INP_REUSEPORT) != 0) + so_options |= SO_REUSEPORT; + if ((inp->inp_flags2 & INP_REUSEADDR) != 0) + so_options |= SO_REUSEADDR; + return (so_options); } #endif /* INET || INET6 */ @@ -581,6 +797,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n int error; /* + * XXX: Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here + * so that we don't have to add to the (already messy) code below. + */ + int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); + + /* * No state changes, so read locks are sufficient here. */ INP_LOCK_ASSERT(inp); @@ -591,7 +813,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip4(cred, &laddr)) != 0) @@ -628,16 +850,23 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; + /* + * XXX: How to deal with SO_REUSEPORT_LB here? + * Treat same as SO_REUSEPORT for now. + */ + if ((so->so_options & + (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) + reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (sin->sin_addr.s_addr != INADDR_ANY) { sin->sin_port = 0; /* yech... */ bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* - * Is the address a local IP address? + * Is the address a local IP address? * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ if ((inp->inp_flags & INP_BINDANY) == 0 && - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; @@ -667,7 +896,8 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_flags2 & INP_REUSEPORT) == 0) && + (t->inp_flags2 & INP_REUSEPORT) || + (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -692,11 +922,15 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ tw = intotw(t); if (tw == NULL || - (reuseport & tw->tw_so_options) == 0) + ((reuseport & tw->tw_so_options) == 0 && + (reuseport_lb & + tw->tw_so_options) == 0)) { return (EADDRINUSE); + } } else if (t && - ((inp->inp_flags2 & INP_BINDMULTI) == 0) && - (reuseport & inp_so_options(t)) == 0) { + ((inp->inp_flags2 & INP_BINDMULTI) == 0) && + (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0) { #ifdef INET6 if (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || @@ -705,7 +939,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n (inp->inp_vflag & INP_IPV6PROTO) == 0 || (t->inp_vflag & INP_IPV6PROTO) == 0) #endif - return (EADDRINUSE); + return (EADDRINUSE); if (t && (! in_pcbbind_check_bindmulti(inp, t))) return (EADDRINUSE); } @@ -1442,6 +1676,7 @@ in_pcbdrop(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(inp->inp_pcbinfo); + in_pcbremlbgrouphash(inp); LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { @@ -1705,6 +1940,61 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i } #undef INP_LOOKUP_MAPPED_PCB_COST +static struct inpcb * +in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, + const struct in_addr *laddr, uint16_t lport, const struct in_addr *faddr, + uint16_t fport, int lookupflags) +{ + struct inpcb *local_wild = NULL; + const struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + struct inpcblbgroup *grp_local_wild; + + INP_HASH_LOCK_ASSERT(pcbinfo); + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; + + /* + * Order of socket selection: + * 1. non-wild. + * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). + * + * NOTE: + * - Load balanced group does not contain jailed sockets + * - Load balanced group does not contain IPv4 mapped INET6 wild sockets + */ + LIST_FOREACH(grp, hdr, il_list) { +#ifdef INET6 + if (!(grp->il_vflag & INP_IPV4)) + continue; +#endif + + if (grp->il_lport == lport) { + + uint32_t idx = 0; + int pkt_hash = INP_PCBLBGROUP_PKTHASH(faddr->s_addr, + lport, fport); + + idx = pkt_hash % grp->il_inpcnt; + + if (grp->il_laddr.s_addr == laddr->s_addr) { + return (grp->il_inp[idx]); + } else { + if (grp->il_laddr.s_addr == INADDR_ANY && + (lookupflags & INPLOOKUP_WILDCARD)) { + local_wild = grp->il_inp[idx]; + grp_local_wild = grp; + } + } + } + } + if (local_wild != NULL) { + return (local_wild); + } + return (NULL); +} + #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -1984,6 +2274,18 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st return (tmpinp); /* + * Then look in lb group (for wildcard match). + */ + if (pcbinfo->ipi_lbgrouphashbase != NULL && + (lookupflags & INPLOOKUP_WILDCARD)) { + inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr, + fport, lookupflags); + if (inp != NULL) { + return (inp); + } + } + + /* * Then look for a wildcard match, if requested. */ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { @@ -2200,6 +2502,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct inpcbport *phd; u_int32_t hashkey_faddr; + int so_options; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -2221,6 +2524,19 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_porthashmask)]; /* + * Add entry to load balance group. + * Only do this if SO_REUSEPORT_LB is set. + */ + so_options = inp_so_options(inp); + if (so_options & SO_REUSEPORT_LB) { + int ret = in_pcbinslbgrouphash(inp); + if (ret) { + /* pcb lb group malloc fail (ret=ENOBUFS). */ + return (ret); + } + } + + /* * Go through port list and look for a head for this lport. */ LIST_FOREACH(phd, pcbporthash, phd_hash) { @@ -2346,6 +2662,10 @@ in_pcbremlists(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(pcbinfo); + + /* XXX: Only do if SO_REUSEPORT_LB set? */ + in_pcbremlbgrouphash(inp); + LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet/in_pcb.h Wed Jun 6 15:45:57 2018 (r334719) @@ -79,6 +79,11 @@ struct in_addr_4in6 { struct in_addr ia46_addr4; }; +union in_dependaddr { + struct in_addr_4in6 id46_addr; + struct in6_addr id6_addr; +}; + /* * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has * some extra padding to accomplish this. @@ -89,22 +94,14 @@ struct in_endpoints { u_int16_t ie_fport; /* foreign port */ u_int16_t ie_lport; /* local port */ /* protocol dependent part, local and foreign addr */ - union { - /* foreign host table entry */ - struct in_addr_4in6 ie46_foreign; - struct in6_addr ie6_foreign; - } ie_dependfaddr; - union { - /* local host table entry */ - struct in_addr_4in6 ie46_local; - struct in6_addr ie6_local; - } ie_dependladdr; + union in_dependaddr ie_dependfaddr; /* foreign host table entry */ + union in_dependaddr ie_dependladdr; /* local host table entry */ +#define ie_faddr ie_dependfaddr.id46_addr.ia46_addr4 +#define ie_laddr ie_dependladdr.id46_addr.ia46_addr4 +#define ie6_faddr ie_dependfaddr.id6_addr +#define ie6_laddr ie_dependladdr.id6_addr u_int32_t ie6_zoneid; /* scope zone id */ }; -#define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4 -#define ie_laddr ie_dependladdr.ie46_local.ia46_addr4 -#define ie6_faddr ie_dependfaddr.ie6_foreign -#define ie6_laddr ie_dependladdr.ie6_local /* * XXX The defines for inc_* are hacks and should be changed to direct @@ -508,6 +505,13 @@ struct inpcbinfo { u_long ipi_wildmask; /* (p) */ /* + * Load balance groups used for the SO_REUSEPORT_LB option, + * hashed by local port. + */ + struct inpcblbgrouphead *ipi_lbgrouphashbase; /* (h) */ + u_long ipi_lbgrouphashmask; /* (h) */ + + /* * Pointer to network stack instance */ struct vnet *ipi_vnet; /* (c) */ @@ -549,6 +553,27 @@ struct inpcbgroup { struct mtx ipg_lock; } __aligned(CACHE_LINE_SIZE); +/* + * Load balance groups used for the SO_REUSEPORT_LB socket option. Each group + * (or unique address:port combination) can be re-used at most + * INPCBLBGROUP_SIZMAX (256) times. The inpcbs are stored in il_inp which + * is dynamically resized as processes bind/unbind to that specific group. + */ +struct inpcblbgroup { + LIST_ENTRY(inpcblbgroup) il_list; + uint16_t il_lport; /* (c) */ + u_char il_vflag; /* (c) */ + u_char il_pad; + uint32_t il_pad2; + union in_dependaddr il_dependladdr; /* (c) */ +#define il_laddr il_dependladdr.id46_addr.ia46_addr4 +#define il6_laddr il_dependladdr.id6_addr + uint32_t il_inpsiz; /* max count in il_inp[] (h) */ + uint32_t il_inpcnt; /* cur count in il_inp[] (h) */ + struct inpcb *il_inp[]; /* (h) */ +}; +LIST_HEAD(inpcblbgrouphead, inpcblbgroup); + #define INP_LOCK_INIT(inp, d, t) \ rw_init_flags(&(inp)->inp_lock, (t), RW_RECURSE | RW_DUPOK) #define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock) @@ -593,7 +618,7 @@ struct tcpcb * inp_inpcbtotcpcb(struct inpcb *inp); void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp); -short inp_so_options(const struct inpcb *inp); +int inp_so_options(const struct inpcb *inp); #endif /* _KERNEL */ @@ -656,6 +681,10 @@ short inp_so_options(const struct inpcb *inp); (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) #define INP_PCBPORTHASH(lport, mask) \ (ntohs((lport)) & (mask)) +#define INP_PCBLBGROUP_PORTHASH(lport, mask) \ + (ntohs((lport)) & (mask)) +#define INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \ + ((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) #define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) /* @@ -724,6 +753,7 @@ short inp_so_options(const struct inpcb *inp); #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ #define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ #define INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ +#define INP_REUSEPORT_LB 0x00002000 /* SO_REUSEPORT_LB option is set */ /* * Flags passed to in_pcblookup*() functions. Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet/ip_output.c Wed Jun 6 15:45:57 2018 (r334719) @@ -992,6 +992,15 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) INP_WUNLOCK(inp); error = 0; break; + case SO_REUSEPORT_LB: + INP_WLOCK(inp); + if ((so->so_options & SO_REUSEPORT_LB) != 0) + inp->inp_flags2 |= INP_REUSEPORT_LB; + else + inp->inp_flags2 &= ~INP_REUSEPORT_LB; + INP_WUNLOCK(inp); + error = 0; + break; case SO_SETFIB: INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet/udp_usrreq.c Wed Jun 6 15:45:57 2018 (r334719) @@ -612,7 +612,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) * will never clear these options after setting them. */ if ((last->inp_socket->so_options & - (SO_REUSEPORT|SO_REUSEADDR)) == 0) + (SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) break; } Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet6/in6_pcb.c Wed Jun 6 15:45:57 2018 (r334719) @@ -125,6 +125,12 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, int error, lookupflags = 0; int reuseport = (so->so_options & SO_REUSEPORT); + /* + * XXX: Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here + * so that we don't have to add to the (already messy) code below. + */ + int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); + INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -132,7 +138,7 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip6(cred, &inp->in6p_laddr, @@ -166,6 +172,13 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; + /* + * XXX: How to deal with SO_REUSEPORT_LB here? + * Treat same as SO_REUSEPORT for now. + */ + if ((so->so_options & + (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) + reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; @@ -215,7 +228,8 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_flags2 & INP_REUSEPORT) == 0) && + (t->inp_flags2 & INP_REUSEPORT) || + (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -265,9 +279,11 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ tw = intotw(t); if (tw == NULL || - (reuseport & tw->tw_so_options) == 0) + ((reuseport & tw->tw_so_options) == 0 && + (reuseport_lb & tw->tw_so_options) == 0)) return (EADDRINUSE); - } else if (t && (reuseport & inp_so_options(t)) == 0) { + } else if (t && (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0) { return (EADDRINUSE); } #ifdef INET @@ -277,22 +293,25 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, in6_sin6_2_sin(&sin, sin6); t = in_pcblookup_local(pcbinfo, sin.sin_addr, - lport, lookupflags, cred); + lport, lookupflags, cred); if (t && t->inp_flags & INP_TIMEWAIT) { tw = intotw(t); if (tw == NULL) return (EADDRINUSE); if ((reuseport & tw->tw_so_options) == 0 + && (reuseport_lb & tw->tw_so_options) == 0 && (ntohl(t->inp_laddr.s_addr) != - INADDR_ANY || ((inp->inp_vflag & - INP_IPV6PROTO) == - (t->inp_vflag & INP_IPV6PROTO)))) + INADDR_ANY || ((inp->inp_vflag & + INP_IPV6PROTO) == + (t->inp_vflag & INP_IPV6PROTO)))) return (EADDRINUSE); } else if (t && (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0 && (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_vflag & INP_IPV6PROTO) != 0)) + (t->inp_vflag & INP_IPV6PROTO) != 0)) { return (EADDRINUSE); + } } #endif } @@ -856,6 +875,56 @@ in6_rtchange(struct inpcb *inp, int errno) return inp; } +static struct inpcb * +in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, + const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, + uint16_t fport, int lookupflags) +{ + struct inpcb *local_wild = NULL; + const struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + struct inpcblbgroup *grp_local_wild; + uint32_t idx; + + INP_HASH_LOCK_ASSERT(pcbinfo); + + hdr = &pcbinfo->ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH( + lport, pcbinfo->ipi_lbgrouphashmask)]; + + /* + * Order of socket selection: + * 1. non-wild. + * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). + * + * NOTE: + * - Load balanced group does not contain jailed sockets. + * - Load balanced does not contain IPv4 mapped INET6 wild sockets. + */ + LIST_FOREACH(grp, hdr, il_list) { + if (grp->il_lport == lport) { + idx = 0; + int pkt_hash = INP_PCBLBGROUP_PKTHASH( + INP6_PCBHASHKEY(faddr), lport, fport); + + idx = pkt_hash % grp->il_inpcnt; + + if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { + return (grp->il_inp[idx]); + } else { + if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && + (lookupflags & INPLOOKUP_WILDCARD)) { + local_wild = grp->il_inp[idx]; + grp_local_wild = grp; + } + } + } + } + if (local_wild != NULL) { + return (local_wild); + } + return (NULL); +} + #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -1101,6 +1170,18 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s } if (tmpinp != NULL) return (tmpinp); + + /* + * Then look in lb group (for wildcard match). + */ + if (pcbinfo->ipi_lbgrouphashbase != NULL && + (lookupflags & INPLOOKUP_WILDCARD)) { + inp = in6_pcblookup_lbgroup(pcbinfo, laddr, lport, faddr, + fport, lookupflags); + if (inp != NULL) { + return (inp); + } + } /* * Then look for a wildcard match, if requested. Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet6/in6_src.c Wed Jun 6 15:45:57 2018 (r334719) @@ -973,7 +973,7 @@ in6_pcbsetport(struct in6_addr *laddr, struct inpcb *i return(error); /* XXX: this is redundant when called from in6_pcbbind */ - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; inp->inp_flags |= INP_ANONPORT; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet6/ip6_output.c Wed Jun 6 15:45:57 2018 (r334719) @@ -1446,6 +1446,15 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) INP_WUNLOCK(in6p); error = 0; break; + case SO_REUSEPORT_LB: + INP_WLOCK(in6p); + if ((so->so_options & SO_REUSEPORT_LB) != 0) + in6p->inp_flags2 |= INP_REUSEPORT_LB; + else + in6p->inp_flags2 &= ~INP_REUSEPORT_LB; + INP_WUNLOCK(in6p); + error = 0; + break; case SO_SETFIB: INP_WLOCK(in6p); in6p->inp_inc.inc_fibnum = so->so_fibnum; Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/netinet6/udp6_usrreq.c Wed Jun 6 15:45:57 2018 (r334719) @@ -399,7 +399,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) * will never clear these options after setting them. */ if ((last->inp_socket->so_options & - (SO_REUSEPORT|SO_REUSEADDR)) == 0) + (SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) break; } Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/sys/socket.h Wed Jun 6 15:45:57 2018 (r334719) @@ -126,26 +126,27 @@ typedef __uintptr_t uintptr_t; /* * Option flags per-socket. */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#define SO_DEBUG 0x00000001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x00000002 /* socket has had listen() */ +#define SO_REUSEADDR 0x00000004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x00000008 /* keep connections alive */ +#define SO_DONTROUTE 0x00000010 /* just use interface addresses */ +#define SO_BROADCAST 0x00000020 /* permit sending of broadcast msgs */ #if __BSD_VISIBLE -#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ +#define SO_USELOOPBACK 0x00000040 /* bypass hardware when possible */ #endif -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ +#define SO_LINGER 0x00000080 /* linger on close if data present */ +#define SO_OOBINLINE 0x00000100 /* leave received OOB data in line */ #if __BSD_VISIBLE -#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ -#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ -#define SO_NOSIGPIPE 0x0800 /* no SIGPIPE from EPIPE */ -#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ -#define SO_BINTIME 0x2000 /* timestamp received dgram traffic */ +#define SO_REUSEPORT 0x00000200 /* allow local address & port reuse */ +#define SO_TIMESTAMP 0x00000400 /* timestamp received dgram traffic */ +#define SO_NOSIGPIPE 0x00000800 /* no SIGPIPE from EPIPE */ +#define SO_ACCEPTFILTER 0x00001000 /* there is an accept filter */ +#define SO_BINTIME 0x00002000 /* timestamp received dgram traffic */ #endif -#define SO_NO_OFFLOAD 0x4000 /* socket cannot be offloaded */ -#define SO_NO_DDP 0x8000 /* disable direct data placement */ +#define SO_NO_OFFLOAD 0x00004000 /* socket cannot be offloaded */ +#define SO_NO_DDP 0x00008000 /* disable direct data placement */ +#define SO_REUSEPORT_LB 0x00010000 /* reuse with load balancing */ /* * Additional options, not kept in so_options. Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Wed Jun 6 15:31:47 2018 (r334718) +++ head/sys/sys/socketvar.h Wed Jun 6 15:45:57 2018 (r334719) @@ -84,7 +84,7 @@ struct socket { struct selinfo so_rdsel; /* (b/cr) for so_rcv/so_comp */ struct selinfo so_wrsel; /* (b/cs) for so_snd */ short so_type; /* (a) generic type, see socket.h */ - short so_options; /* (b) from socket call, see socket.h */ + int so_options; /* (b) from socket call, see socket.h */ short so_linger; /* time to linger close(2) */ short so_state; /* (b) internal state flags SS_* */ void *so_pcb; /* protocol control block */ From owner-svn-src-head@freebsd.org Wed Jun 6 15:49:02 2018 Return-Path: Delivered-To: svn-src-head@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 300E9FD3323; Wed, 6 Jun 2018 15:49:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8DB57AF04; Wed, 6 Jun 2018 15:49:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A295C5072; Wed, 6 Jun 2018 15:49:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56Fn16J077168; Wed, 6 Jun 2018 15:49:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56Fn1Xe077167; Wed, 6 Jun 2018 15:49:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806061549.w56Fn1Xe077167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334720 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:49:02 -0000 Author: hselasky Date: Wed Jun 6 15:49:01 2018 New Revision: 334720 URL: https://svnweb.freebsd.org/changeset/base/334720 Log: Make some list functions RCU safe in the LinuxKPI. While at it rename hlist_add_after() into hlist_add_behind(). Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/list.h Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Wed Jun 6 15:45:57 2018 (r334719) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Wed Jun 6 15:49:01 2018 (r334720) @@ -337,16 +337,16 @@ static inline int hlist_empty(const struct hlist_head *h) { - return !h->first; + return !READ_ONCE(h->first); } static inline void hlist_del(struct hlist_node *n) { - if (n->next) + WRITE_ONCE(*(n->pprev), n->next); + if (n->next != NULL) n->next->pprev = n->pprev; - *n->pprev = n->next; } static inline void @@ -364,9 +364,9 @@ hlist_add_head(struct hlist_node *n, struct hlist_head { n->next = h->first; - if (h->first) + if (h->first != NULL) h->first->pprev = &n->next; - h->first = n; + WRITE_ONCE(h->first, n); n->pprev = &h->first; } @@ -377,18 +377,19 @@ hlist_add_before(struct hlist_node *n, struct hlist_no n->pprev = next->pprev; n->next = next; next->pprev = &n->next; - *(n->pprev) = n; + WRITE_ONCE(*(n->pprev), n); } static inline void -hlist_add_after(struct hlist_node *n, struct hlist_node *next) +hlist_add_behind(struct hlist_node *n, struct hlist_node *prev) { - next->next = n->next; - n->next = next; - next->pprev = &n->next; - if (next->next) - next->next->pprev = &next->next; + n->next = prev->next; + WRITE_ONCE(prev->next, n); + n->pprev = &prev->next; + + if (n->next != NULL) + n->next->pprev = &n->next; } static inline void From owner-svn-src-head@freebsd.org Wed Jun 6 15:50:06 2018 Return-Path: Delivered-To: svn-src-head@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 232BFFD33C1; Wed, 6 Jun 2018 15:50:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 B51D87B063; Wed, 6 Jun 2018 15:50:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 97091260113; Wed, 6 Jun 2018 17:49:57 +0200 (CEST) Subject: Re: svn commit: r334712 - head/sys/compat/linuxkpi/common/include/asm To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806061359.w56DxpSZ020224@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <36f5f6e5-5ad6-5159-22f8-96570a66ed10@selasky.org> Date: Wed, 6 Jun 2018 17:49:43 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.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: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 15:50:06 -0000 On 06/06/18 17:06, Mateusz Guzik wrote: > On Wed, Jun 6, 2018 at 3:59 PM, Hans Petter Selasky > wrote: > > cmpset loops are crap since they require an explicit re-read of the target > value > > see fcmpset and refcount_acquire_if_not_zero for an example use > See r334718. Thank you! --HPS From owner-svn-src-head@freebsd.org Wed Jun 6 16:25:01 2018 Return-Path: Delivered-To: svn-src-head@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 4C62CFD43BD; Wed, 6 Jun 2018 16:25:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F26EF7C19D; Wed, 6 Jun 2018 16:25:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEBB256E1; Wed, 6 Jun 2018 16:25:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56GP0kx097604; Wed, 6 Jun 2018 16:25:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56GP0ug097603; Wed, 6 Jun 2018 16:25:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806061625.w56GP0ug097603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Jun 2018 16:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334721 - head/lib/msun/man X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/msun/man X-SVN-Commit-Revision: 334721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 16:25:01 -0000 Author: cem Date: Wed Jun 6 16:25:00 2018 New Revision: 334721 URL: https://svnweb.freebsd.org/changeset/base/334721 Log: clog.3, complex.3: Fix typos and igor style issues PR: 228783 Reported by: Karsten Modified: head/lib/msun/man/clog.3 head/lib/msun/man/complex.3 Modified: head/lib/msun/man/clog.3 ============================================================================== --- head/lib/msun/man/clog.3 Wed Jun 6 15:49:01 2018 (r334720) +++ head/lib/msun/man/clog.3 Wed Jun 6 16:25:00 2018 (r334721) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2017 +.Dd June 6, 2018 .Dt CLOG 3 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nm clogf , and .Nm clogl -.Nd complex natural logrithm functions +.Nd complex natural logarithm functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS @@ -47,9 +47,9 @@ and The .Fn clog , .Fn clogf , -and +and .Fn clogl -functions compute the complex natural logrithm of +functions compute the complex natural logarithm of .Fa z . with a branch cut along the negative real axis . .Sh RETURN VALUES @@ -58,14 +58,13 @@ The function returns the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-I* \*(Pi , +I* \*(Pi ] along the imaginary axis. -The function satisfies the relationship: +The function satisfies the relationship: .Fo clog .Fn conj "z" Fc = .Fo conj .Fn clog "z" Fc . .Pp - .\" Table is formatted for an 80-column xterm. .Bl -column ".Sy +\*(If + I*\*(Na" ".Sy Return value" ".Sy Divide-by-zero exception" .It Sy Argument Ta Sy Return value Ta Sy Comment @@ -86,9 +85,8 @@ The function satisfies the relationship: .It Ta Ta floating-point exception .It Ta Ta for finite y .It \*(Na + I*\*(If Ta +\*(If + I*\*(Na -.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na +.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na .El - .Sh SEE ALSO .Xr complex 3 , .Xr log 3 , Modified: head/lib/msun/man/complex.3 ============================================================================== --- head/lib/msun/man/complex.3 Wed Jun 6 15:49:01 2018 (r334720) +++ head/lib/msun/man/complex.3 Wed Jun 6 16:25:00 2018 (r334721) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2018 +.Dd June 6, 2018 .Dt COMPLEX 3 .Os .Sh NAME @@ -63,28 +63,28 @@ and .Fn cabsl "long double complex z" , respectively. .de Cl -.Bl -column "csqrt" "complex absolute value (i.e. norm, modulus, magnitude)" +.Bl -column "csqrt" "complex absolute value (i.e., norm, modulus, magnitude)" .Em "Name Description" .. .\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS .\" Section 7.3.8 of ISO C99 standard .Ss Absolute-value Functions .Cl -cabs complex absolute value (i.e. norm, modulus, magnitude) +cabs complex absolute value (i.e., norm, modulus, magnitude) csqrt complex square root .El .Ss Exponential Function .Cl cexp exponential base e .El -.Ss Natural logrithm Function +.Ss Natural logarithm Function .Cl -clog natural logrithm +clog natural logarithm .El .\" Section 7.3.9 of ISO C99 standard .Ss Manipulation Functions .Cl -carg compute the argument (i.e. phase angle) +carg compute the argument (i.e., phase angle) cimag compute the imaginary part conj compute the complex conjugate cproj compute projection onto Riemann sphere From owner-svn-src-head@freebsd.org Wed Jun 6 16:47:34 2018 Return-Path: Delivered-To: svn-src-head@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 35B1EFD52F0; Wed, 6 Jun 2018 16:47:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD1887D185; Wed, 6 Jun 2018 16:47:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE5A25A3A; Wed, 6 Jun 2018 16:47:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56GlXKj007741; Wed, 6 Jun 2018 16:47:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56GlXCK007740; Wed, 6 Jun 2018 16:47:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806061647.w56GlXCK007740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Jun 2018 16:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334722 - head/sys/dev/puc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/puc X-SVN-Commit-Revision: 334722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 16:47:34 -0000 Author: cem Date: Wed Jun 6 16:47:33 2018 New Revision: 334722 URL: https://svnweb.freebsd.org/changeset/base/334722 Log: puc(4): Add provisional support for Exar XR17V352 Reportedly, this is sufficient for 4800bps use, but maybe not any better. PR: 228781 Submitted by: peo AT nethead.se Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Wed Jun 6 16:25:00 2018 (r334721) +++ head/sys/dev/puc/pucdata.c Wed Jun 6 16:47:33 2018 (r334722) @@ -689,6 +689,13 @@ const struct puc_cfg puc_pci_devices[] = { .config_function = puc_config_exar }, + { 0x13a8, 0x0352, 0xffff, 0, + "Exar XR17V352", + 125000000, + PUC_PORT_2S, 0x10, 0, -1, + .config_function = puc_config_exar_pcie + }, + /* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */ { 0x13a8, 0x0358, 0xffff, 0, "Exar XR17V358", From owner-svn-src-head@freebsd.org Wed Jun 6 17:24:19 2018 Return-Path: Delivered-To: svn-src-head@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 D8C00FDB817; Wed, 6 Jun 2018 17:24:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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 783157E668; Wed, 6 Jun 2018 17:24:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f53.google.com with SMTP id v83-v6so9075948itc.3; Wed, 06 Jun 2018 10:24:18 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=8VBGrRDXya9AunICKUbDFcGazcepTOS7Tkt0zVUDZ48=; b=f2C71j4tPLU9R1okl3QP7wbKULo4rfxBUR6bxTrPK7Fnvf6NqRgoLJ/llbbNQOuPg7 UJcg4cPz3B2egSSC1EzJzV3hAwUZWzr2XeYAlUZsMVP7N8wb8SxxRiD5I1vLn6s0IFd9 uxtsBQwr9LadY0dThwi6PE9vtfytyYo+fj/vUYz5iqtszjcVWxJLAs5uRC6DoVAIqCd6 ZDmNj0ALbndmmRhubAUp9xa+ZkcaaSEfZ/WspwlSs9WbEgTeuUtHlbsU6IfNkwTiLGh1 DOQlX3zMjHowZJDN9AlsDDGQQCcwvTus/BZ1LEnkqLnMK9LycszSKNSBbuogozZ8i2q7 6rlQ== X-Gm-Message-State: APt69E3asi1LwJPWavliwsIuofg5lqiZ307gADCB9sxZM316tJxU/vdE tBffxL4sol5C+1KZlQ/rQvtN9MmU X-Google-Smtp-Source: ADUXVKKBnBn0+BShbN+uc3TgrGE5Nr/BjdgCLNEO/CjFxqwjuPnX/q2D0pxf9ypN9ONAwc3Rm/j8iA== X-Received: by 2002:a24:f6c2:: with SMTP id u185-v6mr3387094ith.146.1528304002851; Wed, 06 Jun 2018 09:53:22 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id 63-v6sm7074686ioz.71.2018.06.06.09.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 09:53:22 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id 76-v6so9060233itx.4; Wed, 06 Jun 2018 09:53:22 -0700 (PDT) X-Received: by 2002:a24:19ca:: with SMTP id b193-v6mr3451409itb.135.1528304002374; Wed, 06 Jun 2018 09:53:22 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 09:53:21 -0700 (PDT) In-Reply-To: References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> From: Conrad Meyer Date: Wed, 6 Jun 2018 09:53:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334702 - head/sys/sys To: Benjamin Kaduk , Ravi Pokala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 17:24:19 -0000 Hi Ben, Ravi, GCC/Clang are fine with the just curly braces, or just do/while(0). The core benefit of the ({ }) syntax is to allow multiple-statement macros to have expression syntax externally (i.e., yield a value) =E2=80=94 which is not possible in standard C due to concession to simplistic parsers. Ben's link is a good one and does cover this in more detail. The URL ("Statement-Exprs") is a hint ;-). Best, Conrad On Wed, Jun 6, 2018 at 4:40 AM, Benjamin Kaduk wrote: > On Wed, Jun 6, 2018 at 6:35 AM, Ravi Pokala wrote: >> >> Hi Mateusz, >> >> =EF=BB=BF-----Original Message----- >> From: on behalf of Mateusz Guzik >> >> Date: 2018-06-06, Wednesday at 01:08 >> To: , , >> >> Subject: svn commit: r334702 - head/sys/sys >> >> > ... >> > #ifdef _KERNEL >> > #define malloc(size, type, flags) ({ >> > \ >> >> Now that I'm taking another look at this, I'm confused as to why the >> entire macro expansion is inside parentheses? (The braces make sense, si= nce >> this is a block with local variables which need to be contained.) > > > This is a gcc (and clang) extension to allow the macro body to be a code > block -- standard C gets unhappy with just the curly braces. > https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html is a maybe-releva= nt > page that google found me. > > -Ben From owner-svn-src-head@freebsd.org Wed Jun 6 18:26:29 2018 Return-Path: Delivered-To: svn-src-head@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 D9321FDD76A; Wed, 6 Jun 2018 18:26:28 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001: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 76D14808F9; Wed, 6 Jun 2018 18:26:28 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id g7-v6so8728277ioh.11; Wed, 06 Jun 2018 11:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OTBMT/ooCYELZ/1XVABfAehR0N51ftQfYRgM5U8KDyk=; b=uzUjAEjHdy1l96y6hQvvzCqJrpzULrhweituvsKUlsZYINxmXEVAueKhILs4saKSpT TtyxMXuWd+ZDhojKwl2sxkRJoCIon8I3aRLO+gG7EeHIItflAvQTv7cdxMWbro3lGSRc cRXbr+Vy+pPIizdSAOScRwM2Jye9nF0flAP+YBuzOJoG7XfLXFCpIxfOmJOoq6crZ/x4 OHt3HIZMyZuMehGjfU5UKp9CPqFN9JxnGfCsGSgVUimgvhRmF6Zy1tzLwFyHofHrBY5M 3XoR5MP49S3MIh3QAhCGAY4Mz10A7elhpb6Ouh5pphUG8s6YJHV/tDGTr5488jsWJ7na 0/uQ== 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=OTBMT/ooCYELZ/1XVABfAehR0N51ftQfYRgM5U8KDyk=; b=V7kfVadMk3P359Z7wbNoysRs1fCm9n9DvPWXPGMPS6EtOrC8PknEgWUQk4jHa0z1sW eY/zlhiUQegsxhxL3zDqDPhh2vfHIW9EKVqrd3Q849Xu2+G30ZMBsPdKR6rISFKy5Wwi 7wkdVb+08by7YFoCXquHqOUOqg8tZJryE9H/8aiQPX6MwEmnJGZTIOAf8wZhR8ixTnYN WtuEnL30w0alZP1RN2xaADyDCFtv7uHTZI/G4UWNreFLaIAcTBNBYbEA3mMKsQWaPd47 HRdHjtAId+m/JFyErzmB8htJ8mj3CDS3n2cq/cp4upewusTlYcoddtLDoygpYHuvlmsb XjWA== X-Gm-Message-State: APt69E31Da47RYu/4H8O5av5j/31bAO9DNbMxbMHXTqvvplXOpAHVpEp olPsIAtWMh5+WCXLq0iSij3JEHmI/23GxKKH6I8= X-Google-Smtp-Source: ADUXVKK0rCjEOzAfice9pFTsxEiNzZMsQBJi3JQSEPZ7yfUPU8C29dXlvfXJupNHTPLGnAH/vRrxYDrI+bz3xksvOgc= X-Received: by 2002:a6b:582:: with SMTP id 124-v6mr3837799iof.94.1528309587493; Wed, 06 Jun 2018 11:26:27 -0700 (PDT) MIME-Version: 1.0 References: <201805252146.w4PLk7vL009258@repo.freebsd.org> <06289a72-2948-083f-d208-d9f36d88699e@FreeBSD.org> In-Reply-To: <06289a72-2948-083f-d208-d9f36d88699e@FreeBSD.org> From: Matthew Macy Date: Wed, 6 Jun 2018 11:26:16 -0700 Message-ID: Subject: Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events To: Bryan Drewery Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 18:26:29 -0000 pmu events hasn't been in libpmcstat for a while On Wed, Jun 6, 2018 at 08:36 Bryan Drewery wrote: > On 6/5/18 12:32 AM, Kyle Evans wrote: > > On Mon, Jun 4, 2018 at 10:11 PM, Kyle Evans wrote: > >> On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery > wrote: > >>> Author: bdrewery > >>> Date: Fri May 25 21:46:07 2018 > >>> New Revision: 334226 > >>> URL: https://svnweb.freebsd.org/changeset/base/334226 > >>> > >>> Log: > >>> Cleanup style > >>> > >>> Modified: > >>> head/lib/libpmcstat/pmu-events/Makefile > >>> > >>> Modified: head/lib/libpmcstat/pmu-events/Makefile > >>> > ============================================================================== > >>> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 > 2018 (r334225) > >>> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 > 2018 (r334226) > >>> @@ -1,9 +1,10 @@ > >>> # $FreeBSD$ > >>> > >>> -PROG=jevents > >>> -SRCS=jevents.c jsmn.c json.c > >>> +PROG= jevents > >>> +SRCS= jevents.c jsmn.c json.c > >>> CFLAGS+= -Wno-cast-qual > >>> -.PATH: ${.CURDIR} > >>> -build-tools: jevents > >>> MAN= > >>> + > >>> +build-tools: jevents > >>> + > >>> .include > >>> > >> > >> Hi Bryan, > >> > >> Something about this appears to be subtly wrong, but I can't quite pin > >> down what. I'm getting a failure in the lib32 build of libpmc: > >> > >> sh: ./pmu-events/jevents: not found > > I believe this was fixed by r334455. > > >> > >> My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents > >> exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents. > >> ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and > >> libpmc_events.c.meta. I'm guessing this is the problem- that > >> obj-lib32/... doesn't have the built jevents, but it's not obvious to > >> me why this is the case. > > > > Some additional context: > > > > SRCCONF is defined to a file that looks like this: > > > > WITH_BSD_GREP="YES" > > WITHOUT_BSD_GREP_FASTMATCH="YES" > > WITH_LOADER_LUA="YES" > > WITHOUT_FORTH="YES" > > > > _SRC_ENV_CONF and __MAKE_CONF are set to /dev/null; all three set in > > arguments to make(1). OBJDIR has been completely wiped before-hand. > > > > > -- > Regards, > Bryan Drewery > > From owner-svn-src-head@freebsd.org Wed Jun 6 18:28:18 2018 Return-Path: Delivered-To: svn-src-head@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 9A191FDD900; Wed, 6 Jun 2018 18:28:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40B2380B87; Wed, 6 Jun 2018 18:28:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F8056A47; Wed, 6 Jun 2018 18:28:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56ISI83059575; Wed, 6 Jun 2018 18:28:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56ISH8Y059574; Wed, 6 Jun 2018 18:28:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806061828.w56ISH8Y059574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 6 Jun 2018 18:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334723 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 18:28:18 -0000 Author: kevans Date: Wed Jun 6 18:28:17 2018 New Revision: 334723 URL: https://svnweb.freebsd.org/changeset/base/334723 Log: lualoader: Add a loaded hook for others to execute upon config load This will not be executed on reload, though later work could allow for that. It's intended/expected that later work won't generally need to happen on every config load, just once (for, e.g., menu initialization) or just when config is reloaded but not upon the initial load. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Wed Jun 6 16:47:33 2018 (r334722) +++ head/stand/lua/config.lua Wed Jun 6 18:28:17 2018 (r334723) @@ -458,7 +458,7 @@ function config.selectKernel(kernel) config.kernel_selected = kernel end -function config.load(file) +function config.load(file, reloading) if not file then file = "/boot/defaults/loader.conf" end @@ -485,13 +485,16 @@ function config.load(file) config.module_path = loader.getenv("module_path") local verbose = loader.getenv("verbose_loading") or "no" config.verbose = verbose:lower() == "yes" + if not reloading then + hook.runAll("config.loaded") + end end -- Reload configuration function config.reload(file) modules = {} restoreEnv() - config.load(file) + config.load(file, true) hook.runAll("config.reloaded") end @@ -512,5 +515,6 @@ function config.loadelf() end end +hook.registerType("config.loaded") hook.registerType("config.reloaded") return config From owner-svn-src-head@freebsd.org Wed Jun 6 18:33:52 2018 Return-Path: Delivered-To: svn-src-head@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 B35F8FDDCC9; Wed, 6 Jun 2018 18:33:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21D8D81012; Wed, 6 Jun 2018 18:33:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w56IXYH4006289; Wed, 6 Jun 2018 11:33:34 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w56IXWBC006288; Wed, 6 Jun 2018 11:33:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <1528231489.2440725.1397620864.5987B9ED@webmail.messagingengine.com> To: Brad Davis Date: Wed, 6 Jun 2018 11:33:32 -0700 (PDT) CC: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , rgrimes@FreeBSD.org, Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 18:33:52 -0000 > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > >>> I find it often very useful to do > > > >>> (cd src/etc/rc.d && make install) > > > >>> Same for defaults and several other directories which in fact > > > >>> contains> > >>> non-editable content. Is this planned to keep working ? > > > >> > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > >> of the program they start.> > >> > > > >> That said, if there is a big need for this, we can see about > > > >> options to keep them working.> > >> > > > >> What are you trying to accomplish when you do this? Just verify > > > >> the rc.d scripts match your src tree?> > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > > binaries> > > provided by the project not for the user editing. > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > by this> > > procedure and avoid any editing and implied conflict resolution > > > > for real> > > configs. > > > > > > > > Not being able to easily install clean copies of these scripts > > > > would> > > be very inconvenient and time consuming. > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > including mentioned rc* scripts just fine.> > That is, it automatically refreshes unchanged files without any > > > silly questions just for change of $FreeBSD$.> > > No, you missed the point. Whatever nice is the handling of > > unchanged files,> use of mergemaster forces me to handle changed files, which is exactly> what I do not want/need to do. Yes, I update crashboxes very > > often, and> I want to get all new code, including the startup scripts, when > > I update. > The startup scripts will be installed as part of installworld. So each installworld would wipe over the top of any localmod /etc/rc.d/ and other stuff that mght exist? One of the reasons that etc/Makefile is detached from Installword is so that /etc does not get perturbuted unless specifically requested. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jun 6 18:52:34 2018 Return-Path: Delivered-To: svn-src-head@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 F0629FDE85E; Wed, 6 Jun 2018 18:52:33 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98BB281F52; Wed, 6 Jun 2018 18:52:33 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A29F6F11; Wed, 6 Jun 2018 18:52:33 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56IqXSR075106; Wed, 6 Jun 2018 18:52:33 GMT (envelope-from romain@FreeBSD.org) Received: (from romain@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56IqXdv075105; Wed, 6 Jun 2018 18:52:33 GMT (envelope-from romain@FreeBSD.org) Message-Id: <201806061852.w56IqXdv075105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: romain set sender to romain@FreeBSD.org using -f From: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Date: Wed, 6 Jun 2018 18:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334724 - head/usr.sbin/gpioctl X-SVN-Group: head X-SVN-Commit-Author: romain X-SVN-Commit-Paths: head/usr.sbin/gpioctl X-SVN-Commit-Revision: 334724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 18:52:34 -0000 Author: romain (ports committer) Date: Wed Jun 6 18:52:33 2018 New Revision: 334724 URL: https://svnweb.freebsd.org/changeset/base/334724 Log: gpioctl.8: Fix man page section Reviewed by: manu Approved by: manu Modified: head/usr.sbin/gpioctl/gpioctl.8 Modified: head/usr.sbin/gpioctl/gpioctl.8 ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.8 Wed Jun 6 18:28:17 2018 (r334723) +++ head/usr.sbin/gpioctl/gpioctl.8 Wed Jun 6 18:52:33 2018 (r334724) @@ -27,8 +27,8 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2016 -.Dt GPIOCTL 1 +.Dd June 6, 2018 +.Dt GPIOCTL 8 .Os .Sh NAME .Nm gpioctl From owner-svn-src-head@freebsd.org Wed Jun 6 19:02:26 2018 Return-Path: Delivered-To: svn-src-head@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 9E6F0FDEF02; Wed, 6 Jun 2018 19:02:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 41C7682824; Wed, 6 Jun 2018 19:02:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C447621D34; Wed, 6 Jun 2018 15:02:25 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Wed, 06 Jun 2018 15:02:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=twrDNn oCEqVzV7fPv+bAyXYTJvlbfvZTKO+318Xfiik=; b=M+/WAjXa+O5BUyPCuzlO26 rnwtJef+4fZUP8nDxiR195zFG2DC6ITO7qcmtfYbkLmdAngDdQB7gYIfhGBkkTbv nkF+48WIfosBRLurfxOiUEK8/mBr95ttz/TVQa5OrJFm+pGH73AAgTeFsmwWpkdB z0lqhGE3MPJVinya13EtfDbUu/ufdr7Huib2p5j4tA7S99HE8keajenDbJDn25dH vv2nQToXVb/9+AD7vZUgUr4VS/yi+/mTraZe4yKYaBncVOGlIEQ9I8/xa1HIB7mK LY4DBvYWYsihwAngv4tHLgKGGq/IECGcRcdaAqdEy/RHvTaDmhyHLv8khVhCp1tA == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 68D1CBA50D; Wed, 6 Jun 2018 15:02:25 -0400 (EDT) Message-Id: <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> From: Brad Davis To: rgrimes@FreeBSD.org Cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , "src-committers" , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Subject: Re: svn commit: r334617 - in head: . etc Date: Wed, 06 Jun 2018 13:02:25 -0600 References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:02:27 -0000 On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > > > >>> I find it often very useful to do > > > > >>> (cd src/etc/rc.d && make install) > > > > >>> Same for defaults and several other directories which in fact > > > > >>> contains> > >>> non-editable content. Is this planned to keep working ? > > > > >> > > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > > >> of the program they start.> > >> > > > > >> That said, if there is a big need for this, we can see about > > > > >> options to keep them working.> > >> > > > > >> What are you trying to accomplish when you do this? Just verify > > > > >> the rc.d scripts match your src tree?> > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > > > binaries> > > provided by the project not for the user editing. > > > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > > by this> > > procedure and avoid any editing and implied conflict resolution > > > > > for real> > > configs. > > > > > > > > > > Not being able to easily install clean copies of these scripts > > > > > would> > > be very inconvenient and time consuming. > > > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > including mentioned rc* scripts just fine.> > That is, it automatically refreshes unchanged files without any > > > > silly questions just for change of $FreeBSD$.> > > > No, you missed the point. Whatever nice is the handling of > > > unchanged files,> use of mergemaster forces me to handle changed files, which is exactly> what I do not want/need to do. Yes, I update crashboxes very > > > often, and> I want to get all new code, including the startup scripts, when > > > I update. > > The startup scripts will be installed as part of installworld. > > So each installworld would wipe over the top of any localmod /etc/rc.d/ > and other stuff > that mght exist? > One of the reasons that etc/Makefile is detached from Installword is so > that > /etc does not get perturbuted unless specifically requested. Yes, this is by design. If people need custom tweaks for that stuff they should be upstreamed or moved into /usr/local/etc/rc.d as a custom startup script. Regards, Brad Davis From owner-svn-src-head@freebsd.org Wed Jun 6 19:03:57 2018 Return-Path: Delivered-To: svn-src-head@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 2A491FDF00E; Wed, 6 Jun 2018 19:03:57 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 D146A82A77; Wed, 6 Jun 2018 19:03:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 5D874D010C3; Wed, 6 Jun 2018 15:03:55 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.15.2/8.15.2) with ESMTPS id w56J3rfs080913 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jun 2018 21:03:53 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.15.2/8.15.2/Submit) id w56J3ro6080912; Wed, 6 Jun 2018 21:03:53 +0200 (CEST) (envelope-from pho) Date: Wed, 6 Jun 2018 21:03:53 +0200 From: Peter Holm To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333744 - in head/sys: kern sys Message-ID: <20180606190353.GA80061@x2.osted.lan> References: <201805171759.w4HHxZpe069821@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805171759.w4HHxZpe069821@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:03:57 -0000 On Thu, May 17, 2018 at 05:59:35PM +0000, Matt Macy wrote: > Author: mmacy > Date: Thu May 17 17:59:35 2018 > New Revision: 333744 > URL: https://svnweb.freebsd.org/changeset/base/333744 > > Log: > AF_UNIX: make unix socket locking finer grained > > This change moves to using a reference count across lock drop / reacquire > to guarantee liveness. > > Currently sends on unix sockets contend heavily on read locking the list lock. > unix1_processes in will-it-scale peaks at 6 processes and then declines. > > With this change I get a substantial improvement in number of operations per second > with 96 processes: > > x before > + after > N Min Max Median Avg Stddev > x 11 1688420 1696389 1693578 1692766.3 2971.1702 > + 10 63417955 71030114 70662504 69576423 2374684.6 > Difference at 95.0% confidence > 6.78837e+07 +/- 1.49463e+06 > 4010.22% +/- 88.4246% > (Student's t, pooled s = 1.63437e+06) > > And even for 2 processes shows a ~18% improvement. > "Small" iron changes (1, 2, and 4 processes): > > x before1 > + after1.2 > +------------------------------------------------------------------------+ > | + | > | x + | > | x + | > | x + | > | x ++ | > | xx ++ | > |x x xx ++ | > | |__________________A_____M_____AM____|| > +------------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 10 1131648 1197750 1197138.5 1190369.3 20651.839 > + 10 1203840 1205056 1204919 1204827.9 353.27404 > Difference at 95.0% confidence > 14458.6 +/- 13723 > 1.21463% +/- 1.16683% > (Student's t, pooled s = 14605.2) > > x before2 > + after2.2 > +------------------------------------------------------------------------+ > | +| > | +| > | +| > | +| > | +| > | +| > | x +| > | x +| > | x xx +| > |x xxxx +| > | |___AM_| A| > +------------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 10 1972843 2045866 2038186.5 2030443.8 21367.694 > + 10 2400853 2402196 2401043.5 2401172.7 385.40024 > Difference at 95.0% confidence > 370729 +/- 14198.9 > 18.2585% +/- 0.826943% > (Student's t, pooled s = 15111.7) > > x before4 > + after4.2 > N Min Max Median Avg Stddev > x 10 3986994 3991728 3990137.5 3989985.2 1300.0164 > + 10 4799990 4806664 4806116.5 4805194 1990.6625 > Difference at 95.0% confidence > 815209 +/- 1579.64 > 20.4314% +/- 0.0421713% > (Student's t, pooled s = 1681.19) > > Tested by: pho > Reported by: mjg > Approved by: sbruno > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15430 > > Modified: > head/sys/kern/uipc_usrreq.c > head/sys/sys/unpcb.h > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Thu May 17 17:57:41 2018 (r333743) This commit seems to cause this: 20180606 20:44:37 all (1/1): datagram.sh panic: _mtx_lock_sleep: recursed on non-recursive mutex unp_mtx @ ../../../kern/uipc_usrreq.c:354 cpuid = 91 time = 1528310678 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f3a2bcd0 vpanic() at vpanic+0x1a3/frame 0xfffffe00f3a2bd30 doadump() at doadump/frame 0xfffffe00f3a2bdb0 __mtx_lock_sleep() at __mtx_lock_sleep+0x49d/frame 0xfffffe00f3a2be30 __mtx_lock_flags() at __mtx_lock_flags+0xf9/frame 0xfffffe00f3a2be80 unp_connectat() at unp_connectat+0x2ec/frame 0xfffffe00f3a2c110 soconnectat() at soconnectat+0xe8/frame 0xfffffe00f3a2c160 kern_connectat() at kern_connectat+0x10f/frame 0xfffffe00f3a2c1c0 sys_connect() at sys_connect+0x77/frame 0xfffffe00f3a2c200 amd64_syscall() at amd64_syscall+0x2a7/frame 0xfffffe00f3a2c330 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00f3a2c330 --- syscall (98, FreeBSD ELF64, sys_connect), rip = 0x80040081a, rsp = 0x7fffffffe2e8, rbp = 0x7fffffffe770 --- KDB: enter: panic [ thread pid 1276 tid 100966 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> x/s version version: FreeBSD 12.0-CURRENT #0 r333744: Wed Jun 6 20:35:18 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 db> The stack trace is different on HEAD: panic: mutex unp not owned at ../../../kern/uipc_usrreq.c:879 cpuid = 47 time = 1528311629 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ee593ca0 vpanic() at vpanic+0x1a3/frame 0xfffffe00ee593d00 panic() at panic+0x43/frame 0xfffffe00ee593d60 __mtx_assert() at __mtx_assert+0xb4/frame 0xfffffe00ee593d70 uipc_disconnect() at uipc_disconnect+0x93/frame 0xfffffe00ee593dc0 soclose() at soclose+0xa5/frame 0xfffffe00ee593e30 closef() at closef+0x1f5/frame 0xfffffe00ee593ec0 fdescfree_fds() at fdescfree_fds+0x90/frame 0xfffffe00ee593f10 fdescfree() at fdescfree+0x480/frame 0xfffffe00ee593fd0 exit1() at exit1+0x500/frame 0xfffffe00ee594040 sigexit() at sigexit+0xae8/frame 0xfffffe00ee594220 postsig() at postsig+0x1cf/frame 0xfffffe00ee5942f0 ast() at ast+0x4b8/frame 0xfffffe00ee594330 doreti_ast() at doreti_ast+0x1f/frame 0x7fffffffe760 KDB: enter: panic [ thread pid 1013 tid 100834 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> x/s version version: FreeBSD 12.0-CURRENT #0 r334723: Wed Jun 6 20:53:32 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 db> - Peter From owner-svn-src-head@freebsd.org Wed Jun 6 19:18:14 2018 Return-Path: Delivered-To: svn-src-head@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 31FC7FDF639; Wed, 6 Jun 2018 19:18:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 575D8830A1; Wed, 6 Jun 2018 19:18:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QdwXfpoW0uYopQdwYfUWOk; Wed, 06 Jun 2018 13:18:06 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=pwxSU7ffAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=YjCoiEArSPlB2yaFbwoA:9 a=CjuIK1q_8ugA:10 a=fPZJm5J38vnTTye--D-X:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id BAB2355A; Wed, 6 Jun 2018 12:18:00 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w56JI0sK045205; Wed, 6 Jun 2018 12:18:00 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w56JI0kk045200; Wed, 6 Jun 2018 12:18:00 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806061918.w56JI0kk045200@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Brad Davis cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , rgrimes@freebsd.org, Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: Message from Brad Davis of "Tue, 05 Jun 2018 14:44:49 -0600." <1528231489.2440725.1397620864.5987B9ED@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 06 Jun 2018 12:18:00 -0700 X-CMAE-Envelope: MS4wfOVWSbuP+aH4KJGjNyRNhEFCB+Vv57cCTOGBbS2qGbMoYYbiRR7jA4agjwkeGL+XzIKOAVihS8YF+vDgjMqpDSuTzYAvvb14/Wc1QO70Cw1eKDTwyki+ lzlTgI3SXa7Z9oQG6FSmOtZrHKIxTNIqj77nt3Ejad4kL4oj/x/0H0Blq2SiMyeHc634817mS3uDsQnnp56DzTpinUQSKabNCKFNtBmVdjDO6RHmfhmDp1lv llAqzZ/DpmDqNRmZp8kRkLcbHfAwe6WFFKeCiDYPUaw1hsKVUR3fer10RJN+fgirt+VsPw3Ih++MUBqKOMmfvZc7GALyLVIxKlAJ2sWleXUUYNahe5GhiNMk i69rjkODxSszNfiiM+wnW+dqGCA8+OG8Zk1/L91n+8z70t1jF14oaK8lyksxDA7/elgfkWk589TfDS0UaxCKqg+dr9RS62g15tkjn8V/NFtDevI25RYcPKpX WbMLr5qCgmVsqzDe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:18:14 -0000 In message <1528231489.2440725.1397620864.5987B9ED@webmail.messagingengi ne.com> , Brad Davis writes: > This is a multi-part message in MIME format. > > --_----------=_152823148924407253 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; charset="utf-8" > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > >>> I find it often very useful to do > > > >>> (cd src/etc/rc.d && make install) > > > >>> Same for defaults and several other directories which in fact > > > >>> contains> > >>> non-editable content. Is this planned to keep workin > g ? > > > >> > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > >> of the program they start.> > >> > > > >> That said, if there is a big need for this, we can see about > > > >> options to keep them working.> > >> > > > >> What are you trying to accomplish when you do this? Just verify > > > >> the rc.d scripts match your src tree?> > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > > binaries> > > provided by the project not for the user editing. > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > by this> > > procedure and avoid any editing and implied conflict resol > ution > > > > for real> > > configs. > > > > > > > > Not being able to easily install clean copies of these scripts > > > > would> > > be very inconvenient and time consuming. > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > including mentioned rc* scripts just fine.> > That is, it automatically r > efreshes unchanged files without any > > > silly questions just for change of $FreeBSD$.> > > No, you missed the point. Whatever nice is the handling of > > unchanged files,> use of mergemaster forces me to handle changed files, whi > ch is exactly> what I do not want/need to do. Yes, I update crashboxes very > > often, and> I want to get all new code, including the startup scripts, when > > I update. > The startup scripts will be installed as part of installworld. Shouldn't this be worked out in a phab review first? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Jun 6 19:27:08 2018 Return-Path: Delivered-To: svn-src-head@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 D110FFDFAE6; Wed, 6 Jun 2018 19:27:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA0683716; Wed, 6 Jun 2018 19:27:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F87E73E3; Wed, 6 Jun 2018 19:27:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56JR7r1090828; Wed, 6 Jun 2018 19:27:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56JR7xc090826; Wed, 6 Jun 2018 19:27:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806061927.w56JR7xc090826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 19:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334725 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 334725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:27:08 -0000 Author: tuexen Date: Wed Jun 6 19:27:06 2018 New Revision: 334725 URL: https://svnweb.freebsd.org/changeset/base/334725 Log: Improve compliance with RFC 4895 and RFC 6458. Silently dicard SCTP chunks which have been requested to be authenticated but are received unauthenticated no matter if support for SCTP authentication has been negotiated. This improves compliance with RFC 4895. When the application uses the SCTP_AUTH_CHUNK socket option to request a chunk to be received in an authenticated way, enable the SCTP authentication extension for the end-point. This improves compliance with RFC 6458. Discussed with: Peter Lei MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Jun 6 18:52:33 2018 (r334724) +++ head/sys/netinet/sctp_input.c Wed Jun 6 19:27:06 2018 (r334725) @@ -4809,7 +4809,6 @@ process_control_chunks: /* check to see if this chunk required auth, but isn't */ if ((stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ @@ -5698,7 +5697,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph * chunks */ if ((stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); @@ -5740,7 +5738,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph */ if ((length > offset) && (stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jun 6 18:52:33 2018 (r334724) +++ head/sys/netinet/sctp_usrreq.c Wed Jun 6 19:27:06 2018 (r334725) @@ -4250,6 +4250,8 @@ sctp_setopt(struct socket *so, int optname, void *optv if (sctp_auth_add_chunk(sauth->sauth_chunk, inp->sctp_ep.local_auth_chunks)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; + } else { + inp->auth_supported = 1; } SCTP_INP_WUNLOCK(inp); break; From owner-svn-src-head@freebsd.org Wed Jun 6 19:36:39 2018 Return-Path: Delivered-To: svn-src-head@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 182D9FDFF13; Wed, 6 Jun 2018 19:36:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFABF83D52; Wed, 6 Jun 2018 19:36:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E11F7578; Wed, 6 Jun 2018 19:36:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56JacDq096242; Wed, 6 Jun 2018 19:36:38 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56Jab6X096238; Wed, 6 Jun 2018 19:36:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806061936.w56Jab6X096238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 6 Jun 2018 19:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334726 - in head: etc/rc.d sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: etc/rc.d sbin/pfctl X-SVN-Commit-Revision: 334726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:36:39 -0000 Author: kp Date: Wed Jun 6 19:36:37 2018 New Revision: 334726 URL: https://svnweb.freebsd.org/changeset/base/334726 Log: pf: Return non-zero from 'status' if pf is not enabled In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf onestatus` always provided an exit status of zero. This made it fiddly to programmatically determine if pf was running or not. Return a non-zero status if the pf module is not loaded, extend pfctl to have an option to return an error status if pf is not enabled. PR: 228632 Submitted by: James Park-Watt MFC after: 1 week Modified: head/etc/rc.d/pf head/sbin/pfctl/pfctl.8 head/sbin/pfctl/pfctl.c head/sbin/pfctl/pfctl_parser.c head/sbin/pfctl/pfctl_parser.h Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Wed Jun 6 19:27:06 2018 (r334725) +++ head/etc/rc.d/pf Wed Jun 6 19:36:37 2018 (r334726) @@ -66,8 +66,10 @@ pf_status() { if ! [ -c /dev/pf ] ; then echo "pf.ko is not loaded" + return 1 else $pf_program -s info + $pf_program -s Running >/dev/null fi } Modified: head/sbin/pfctl/pfctl.8 ============================================================================== --- head/sbin/pfctl/pfctl.8 Wed Jun 6 19:27:06 2018 (r334725) +++ head/sbin/pfctl/pfctl.8 Wed Jun 6 19:36:37 2018 (r334726) @@ -412,6 +412,8 @@ Show filter information (statistics and counters). When used together with .Fl v , source tracking statistics are also shown. +.It Fl s Cm Running +Show the running status and provide a non-zero exit status when disabled. .It Fl s Cm labels Show per-rule statistics (label, evaluations, packets total, bytes total, packets in, bytes in, packets out, bytes out, state creations) of Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Wed Jun 6 19:27:06 2018 (r334725) +++ head/sbin/pfctl/pfctl.c Wed Jun 6 19:36:37 2018 (r334726) @@ -96,6 +96,7 @@ int pfctl_show_nat(int, int, char *); int pfctl_show_src_nodes(int, int); int pfctl_show_states(int, const char *, int); int pfctl_show_status(int, int); +int pfctl_show_running(int); int pfctl_show_timeouts(int, int); int pfctl_show_limits(int, int); void pfctl_debug(int, u_int32_t, int); @@ -217,7 +218,7 @@ static const char * const clearopt_list[] = { static const char * const showopt_list[] = { "nat", "queue", "rules", "Anchors", "Sources", "states", "info", "Interfaces", "labels", "timeouts", "memory", "Tables", "osfp", - "all", NULL + "Running", "all", NULL }; static const char * const tblcmdopt_list[] = { @@ -1155,6 +1156,20 @@ pfctl_show_status(int dev, int opts) } int +pfctl_show_running(int dev) +{ + struct pf_status status; + + if (ioctl(dev, DIOCGETSTATUS, &status)) { + warn("DIOCGETSTATUS"); + return (-1); + } + + print_running(&status); + return (!status.running); +} + +int pfctl_show_timeouts(int dev, int opts) { struct pfioc_tm pt; @@ -2273,6 +2288,9 @@ main(int argc, char *argv[]) break; case 'i': pfctl_show_status(dev, opts); + break; + case 'R': + error = pfctl_show_running(dev); break; case 't': pfctl_show_timeouts(dev, opts); Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Wed Jun 6 19:27:06 2018 (r334725) +++ head/sbin/pfctl/pfctl_parser.c Wed Jun 6 19:36:37 2018 (r334726) @@ -615,6 +615,12 @@ print_status(struct pf_status *s, int opts) } void +print_running(struct pf_status *status) +{ + printf("%s\n", status->running ? "Enabled" : "Disabled"); +} + +void print_src_node(struct pf_src_node *sn, int opts) { struct pf_addr_wrap aw; Modified: head/sbin/pfctl/pfctl_parser.h ============================================================================== --- head/sbin/pfctl/pfctl_parser.h Wed Jun 6 19:27:06 2018 (r334725) +++ head/sbin/pfctl/pfctl_parser.h Wed Jun 6 19:36:37 2018 (r334726) @@ -257,6 +257,7 @@ void print_src_node(struct pf_src_node *, int); void print_rule(struct pf_rule *, const char *, int, int); void print_tabledef(const char *, int, int, struct node_tinithead *); void print_status(struct pf_status *, int); +void print_running(struct pf_status *); int eval_pfaltq(struct pfctl *, struct pf_altq *, struct node_queue_bw *, struct node_queue_opt *); From owner-svn-src-head@freebsd.org Wed Jun 6 20:07:00 2018 Return-Path: Delivered-To: svn-src-head@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 DCC75FE1664 for ; Wed, 6 Jun 2018 20:06:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 5B9408549D for ; Wed, 6 Jun 2018 20:06:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 257793c3-69c5-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 257793c3-69c5-11e8-8837-614b7c574d04; Wed, 06 Jun 2018 20:06:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w56K6mkh041751; Wed, 6 Jun 2018 14:06:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528315608.25377.3.camel@freebsd.org> Subject: Re: svn commit: r334617 - in head: . etc From: Ian Lepore To: rgrimes@FreeBSD.org, Brad Davis Cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Wed, 06 Jun 2018 14:06:48 -0600 In-Reply-To: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:07:00 -0000 On Wed, 2018-06-06 at 11:33 -0700, Rodney W. Grimes wrote: > > > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I find it often very useful to do > > > > > > >  (cd src/etc/rc.d && make install) > > > > > > > Same for defaults and several other directories which in > > > > > > > fact > > > > > > > contains> > >>> non-editable content.  Is this planned to > > > > > > > keep working ? > > > > > > The short answer is, no.  All rc.d scripts get moved to the > > > > > > src > > > > > > of the program they start.> > >> > > > > > > That said, if there is a big need for this, we can see > > > > > > about > > > > > > options to keep them working.> > >> > > > > > > What are you trying to accomplish when you do this?  Just > > > > > > verify > > > > > > the rc.d scripts match your src tree?> > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and > > > > > /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable > > > > > to etc, they are > > > > > binaries> > > provided by the project not for the user > > > > > editing. > > > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh > > > > > scripts > > > > > by this> > > procedure and avoid any editing and implied > > > > > conflict resolution > > > > > for real> > > configs. > > > > > > > > > > Not being able to easily install clean copies of these > > > > > scripts > > > > > would> > > be very inconvenient and time consuming. > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > including mentioned rc* scripts just fine.> > That is, it > > > > automatically refreshes unchanged files without any > > > > silly questions just for change of $FreeBSD$.> > > > No, you missed the point.  Whatever nice is the handling of > > > unchanged files,> use of mergemaster forces me to handle changed > > > files, which is exactly> what I do not want/need to do.  Yes, I > > > update crashboxes very > > > often, and> I want to get all new code, including the startup > > > scripts, when > > > I update. > > The startup scripts will be installed as part of installworld. > So each installworld would wipe over the top of any localmod > /etc/rc.d/ and other stuff > that mght exist? > One of the reasons that etc/Makefile is detached from Installword is > so that > /etc does not get perturbuted unless specifically requested. > I don't understand the drama over this.  rc.d startup scripts are *binaries*. Users are not expected to modify the system installed binaries, and if they do, it is expected that the next installworld will replace them with the system binaries again. -- Ian From owner-svn-src-head@freebsd.org Wed Jun 6 20:09:22 2018 Return-Path: Delivered-To: svn-src-head@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 ADD8BFE1740; Wed, 6 Jun 2018 20:09:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9A0857DD; Wed, 6 Jun 2018 20:09:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B6347A36; Wed, 6 Jun 2018 20:09:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56K9MKv011865; Wed, 6 Jun 2018 20:09:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56K9MtH011864; Wed, 6 Jun 2018 20:09:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806062009.w56K9MtH011864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Jun 2018 20:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334733 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 334733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:09:22 -0000 Author: cem Date: Wed Jun 6 20:09:21 2018 New Revision: 334733 URL: https://svnweb.freebsd.org/changeset/base/334733 Log: strcpy.3: Improve legibility and clarity In the DESCRIPTION, put the more commonly used functions first in the corresponding sentence, to help catch the eye. Pull out the note about overlapping buffers to its own paragraph, as it applies to all routines documented by this page. Emphasize the potentially surprising strncpy(3) behavior of zero-filling the remainder of a buffer larger than the source string. Encourage strlcpy use; remove portability note about strlcpy(3). Adapting a strlcpy-using code base to a platform that does not provide strlcpy in libc is so trivial as to not be worth mentioning. (Just copy strlcpy.c out of any BSD libc, or include and link the pre-packaged libbsd library on non-BSD platforms.) Likewise, expand the page's warning about ease of potential misuse to cover all functions documented herein, and explicitly suggest using strlcpy most of the time. The text was mostly cribbed from a similar suggestion in gets(3). Finally, document the remaining valid use of strncpy -- the rare fixed-length record with no expectation of nul-termination. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/string/strcpy.3 Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Wed Jun 6 20:03:35 2018 (r334732) +++ head/lib/libc/string/strcpy.3 Wed Jun 6 20:09:21 2018 (r334733) @@ -32,7 +32,7 @@ .\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 28, 2009 +.Dd June 6, 2018 .Dt STRCPY 3 .Os .Sh NAME @@ -55,9 +55,9 @@ .Fn strncpy "char * restrict dst" "const char * restrict src" "size_t len" .Sh DESCRIPTION The -.Fn stpcpy -and .Fn strcpy +and +.Fn stpcpy functions copy the string .Fa src @@ -66,22 +66,18 @@ to (including the terminating .Ql \e0 character.) -If -.Fa src -and -.Fa dst -overlap, the results are undefined. .Pp The -.Fn stpncpy -and .Fn strncpy +and +.Fn stpncpy functions copy at most .Fa len characters from .Fa src into .Fa dst . +.Bf Sy If .Fa src is less than @@ -92,16 +88,25 @@ the remainder of is filled with .Ql \e0 characters. +.Ef Otherwise, .Fa dst is .Em not terminated. -If +.Pp +For all of +.Fn strcpy , +.Fn strncpy , +.Fn stpcpy , +and +.Fn stpncpy , +the result is undefined +if .Fa src and .Fa dst -overlap, the results are undefined. +overlap. .Sh RETURN VALUES The .Fn strcpy @@ -182,11 +187,6 @@ This could be better achieved using as shown in the following example: .Pp .Dl "(void)strlcpy(buf, input, sizeof(buf));" -.Pp -Note that because -.Xr strlcpy 3 -is not defined in any standards, it should -only be used when portability is not a concern. .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 , @@ -218,8 +218,16 @@ and was added in .Fx 8.0 . .Sh SECURITY CONSIDERATIONS -The -.Fn strcpy -function is easily misused in a manner which enables malicious users -to arbitrarily change a running program's functionality through a -buffer overflow attack. +All of the functions documented in this manual page are easily misused in a +manner which enables malicious users to arbitrarily change a running program's +functionality through a buffer overflow attack. +.Pp +It is strongly suggested that the +.Fn strlcpy +function be used in almost all cases. +.Pp +For some, but not all, fixed-length records, non-terminated strings may be both +valid and desirable. +In that specific case, the +.Fn strncpy +function may be most sensible. From owner-svn-src-head@freebsd.org Wed Jun 6 20:27:46 2018 Return-Path: Delivered-To: svn-src-head@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 8307FFE1E56; Wed, 6 Jun 2018 20:27:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 09A9B86046; Wed, 6 Jun 2018 20:27:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w56KRKrD010175; Wed, 6 Jun 2018 23:27:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w56KRKrD010175 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w56KRK4w010174; Wed, 6 Jun 2018 23:27:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 6 Jun 2018 23:27:20 +0300 From: Konstantin Belousov To: Ian Lepore Cc: rgrimes@FreeBSD.org, Brad Davis , Eugene Grosbein , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180606202720.GD2450@kib.kiev.ua> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1528315608.25377.3.camel@freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:27:46 -0000 On Wed, Jun 06, 2018 at 02:06:48PM -0600, Ian Lepore wrote: > On Wed, 2018-06-06 at 11:33 -0700, Rodney W. Grimes wrote: > > > > > > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > > > > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > > > > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I find it often very useful to do > > > > > > > > š(cd src/etc/rc.d && make install) > > > > > > > > Same for defaults and several other directories which in > > > > > > > > fact > > > > > > > > contains> > >>> non-editable content.ššIs this planned to > > > > > > > > keep working ? > > > > > > > The short answer is, no.ššAll rc.d scripts get moved to the > > > > > > > src > > > > > > > of the program they start.> > >> > > > > > > > That said, if there is a big need for this, we can see > > > > > > > about > > > > > > > options to keep them working.> > >> > > > > > > > What are you trying to accomplish when you do this?ššJust > > > > > > > verify > > > > > > > the rc.d scripts match your src tree?> > > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and > > > > > > /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable > > > > > > to etc, they are > > > > > > binaries> > > provided by the project not for the user > > > > > > editing. > > > > > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh > > > > > > scripts > > > > > > by this> > > procedure and avoid any editing and implied > > > > > > conflict resolution > > > > > > for real> > > configs. > > > > > > > > > > > > Not being able to easily install clean copies of these > > > > > > scripts > > > > > > would> > > be very inconvenient and time consuming. > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > > including mentioned rc* scripts just fine.> > That is, it > > > > > automatically refreshes unchanged files without any > > > > > silly questions just for change of $FreeBSD$.> > > > > No, you missed the point.ššWhatever nice is the handling of > > > > unchanged files,> use of mergemaster forces me to handle changed > > > > files, which is exactly> what I do not want/need to do.ššYes, I > > > > update crashboxes very > > > > often, and> I want to get all new code, including the startup > > > > scripts, when > > > > I update. > > > The startup scripts will be installed as part of installworld. > > So each installworld would wipe over the top of any localmod > > /etc/rc.d/ and other stuff > > that mght exist? > > One of the reasons that etc/Makefile is detached from Installword is > > so that > > /etc does not get perturbuted unless specifically requested. > > > > I don't understand the drama over this.ššrc.d startup scripts are > *binaries*. Users are not expected to modify the system installed > binaries, and if they do, it is expected that the next installworld > will replace them with the system binaries again. I agree with this, but the scripts are installed into /etc. I proposed to move them somewhere, e.g. to /sbin/rc* or to /libexec/rc*. If moved first, then the proposed change would be much more logical and probably easier to fit into the workflows of FreeBSD consumers. From owner-svn-src-head@freebsd.org Wed Jun 6 20:36:05 2018 Return-Path: Delivered-To: svn-src-head@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 EC7A7FE2495; Wed, 6 Jun 2018 20:36:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 727EF86A63; Wed, 6 Jun 2018 20:36:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w56KZiZZ006722; Wed, 6 Jun 2018 13:35:44 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w56KZhV8006721; Wed, 6 Jun 2018 13:35:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806062035.w56KZhV8006721@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> To: Brad Davis Date: Wed, 6 Jun 2018 13:35:43 -0700 (PDT) CC: rgrimes@freebsd.org, Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:36:05 -0000 > On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: > > > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > > > > > >>> I find it often very useful to do > > > > > >>> (cd src/etc/rc.d && make install) > > > > > >>> Same for defaults and several other directories which in fact > > > > > >>> contains> > >>> non-editable content. Is this planned to keep working ? > > > > > >> > > > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > > > >> of the program they start.> > >> > > > > > >> That said, if there is a big need for this, we can see about > > > > > >> options to keep them working.> > >> > > > > > >> What are you trying to accomplish when you do this? Just verify > > > > > >> the rc.d scripts match your src tree?> > > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > > > > binaries> > > provided by the project not for the user editing. > > > > > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > > > by this> > > procedure and avoid any editing and implied conflict resolution > > > > > > for real> > > configs. > > > > > > > > > > > > Not being able to easily install clean copies of these scripts > > > > > > would> > > be very inconvenient and time consuming. > > > > > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > > including mentioned rc* scripts just fine.> > That is, it automatically refreshes unchanged files without any > > > > > silly questions just for change of $FreeBSD$.> > > > > No, you missed the point. Whatever nice is the handling of > > > > unchanged files,> use of mergemaster forces me to handle changed files, which is exactly> what I do not want/need to do. Yes, I update crashboxes very > > > > often, and> I want to get all new code, including the startup scripts, when > > > > I update. > > > The startup scripts will be installed as part of installworld. > > > > So each installworld would wipe over the top of any localmod /etc/rc.d/ > > and other stuff > > that mght exist? > > One of the reasons that etc/Makefile is detached from Installword is so > > that > > /etc does not get perturbuted unless specifically requested. > > Yes, this is by design. This is going to have a great amount of push back, and this is by your NEW design, the existing design does not cause this pain. > > If people need custom tweaks for that stuff they should be upstreamed or moved into /usr/local/etc/rc.d as a custom startup script. I doubt very much this is a practical solution. I have changes that I doubt belong in FreeBSD, and are not restricted to etc/rc.d. And from reading this thread thus far so do others. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jun 6 21:32:50 2018 Return-Path: Delivered-To: svn-src-head@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 52389FE3ECE; Wed, 6 Jun 2018 21:32:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0297C68583; Wed, 6 Jun 2018 21:32:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D893510872; Wed, 6 Jun 2018 21:32:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56LWn10056858; Wed, 6 Jun 2018 21:32:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56LWnor056857; Wed, 6 Jun 2018 21:32:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806062132.w56LWnor056857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Jun 2018 21:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334738 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 334738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 21:32:50 -0000 Author: cem Date: Wed Jun 6 21:32:49 2018 New Revision: 334738 URL: https://svnweb.freebsd.org/changeset/base/334738 Log: strdup.3: Document standardization in POSIX Sponsored by: Dell EMC Isilon Modified: head/lib/libc/string/strdup.3 Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Wed Jun 6 21:23:42 2018 (r334737) +++ head/lib/libc/string/strdup.3 Wed Jun 6 21:32:49 2018 (r334738) @@ -28,7 +28,7 @@ .\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 5, 2008 +.Dd June 6, 2018 .Dt STRDUP 3 .Os .Sh NAME @@ -73,6 +73,15 @@ terminating the copied string. .Xr free 3 , .Xr malloc 3 , .Xr wcsdup 3 +.Sh STANDARDS +The +.Fn strdup +function is specified by +.St -p1003.1-2001 . +The +.Fn strndup +function is specified by +.St -p1003.1-2008 . .Sh HISTORY The .Fn strdup From owner-svn-src-head@freebsd.org Wed Jun 6 23:12:37 2018 Return-Path: Delivered-To: svn-src-head@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 5DAE6FE64BB; Wed, 6 Jun 2018 23:12:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A976714A7; Wed, 6 Jun 2018 23:12:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0FB717FB6; Wed, 6 Jun 2018 23:12:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56NCaoR007825; Wed, 6 Jun 2018 23:12:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56NCZWF007819; Wed, 6 Jun 2018 23:12:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806062312.w56NCZWF007819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 6 Jun 2018 23:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334744 - in head: . tools/build/mk usr.bin/grep usr.bin/grep/nls X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . tools/build/mk usr.bin/grep usr.bin/grep/nls X-SVN-Commit-Revision: 334744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 23:12:37 -0000 Author: bapt Date: Wed Jun 6 23:12:35 2018 New Revision: 334744 URL: https://svnweb.freebsd.org/changeset/base/334744 Log: Remove NLS support from BSD grep GNU grep as in actually in base does not have any translations support compiled in, so no functionnality loss. We do support 193 locales in base, we will never catch up on that number of translation with bsd grep. Removing NLS support make bsd grep consistent with the other binaries in base which are not translated, and also reduce a little bit the code. Reviewed by: kevans Approved by: kevans Discussed with: kevans @BSDCan Differential Revision: https://reviews.freebsd.org/D15682 Deleted: head/usr.bin/grep/nls/ Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jun 6 22:34:20 2018 (r334743) +++ head/ObsoleteFiles.inc Wed Jun 6 23:12:35 2018 (r334744) @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20180607: remove nls support from grep +OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.SJIS/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.eucJP/grep.cat +OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/zh_CN.UTF-8/grep.cat +OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat +OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat # 20180517: retire vxge OLD_FILES+=usr/share/man/man4/if_vxge.4.gz OLD_FILES+=usr/share/man/man4/vxge.4.gz Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 6 22:34:20 2018 (r334743) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 6 23:12:35 2018 (r334744) @@ -6277,7 +6277,6 @@ OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/tcsh.cat OLD_FILES+=usr/share/nls/el_GR.UTF-8/tcsh.cat OLD_FILES+=usr/share/nls/en_US.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/en_US.ISO8859-15/ee.cat -OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-15/tcsh.cat @@ -6309,10 +6308,8 @@ OLD_FILES+=usr/share/nls/fr_FR.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/tcsh.cat OLD_FILES+=usr/share/nls/fr_FR.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/ee.cat -OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/libc.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/sort.cat OLD_FILES+=usr/share/nls/it_CH.ISO8859-1/tcsh.cat @@ -6322,12 +6319,9 @@ OLD_FILES+=usr/share/nls/it_IT.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/libc.cat OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/tcsh.cat OLD_FILES+=usr/share/nls/it_IT.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.SJIS/grep.cat OLD_FILES+=usr/share/nls/ja_JP.SJIS/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/libc.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.eucJP/grep.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/libc.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/tcsh.cat OLD_FILES+=usr/share/nls/ko_KR.UTF-8/libc.cat @@ -6338,14 +6332,12 @@ OLD_FILES+=usr/share/nls/no_NO.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/ee.cat OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/libc.cat OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/ee.cat -OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/pt_PT.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/ru_RU.CP1251/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.CP866/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.ISO8859-5/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee.cat -OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/libc.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.UTF-8/tcsh.cat @@ -6354,12 +6346,10 @@ OLD_FILES+=usr/share/nls/sv_SE.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/uk_UA.ISO8859-5/tcsh.cat OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/tcsh.cat -OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/libc.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat OLD_FILES+=usr/share/nls/zh_CN.GB18030/libc.cat OLD_FILES+=usr/share/nls/zh_CN.GB2312/libc.cat -OLD_FILES+=usr/share/nls/zh_CN.UTF-8/grep.cat OLD_FILES+=usr/share/nls/zh_CN.UTF-8/libc.cat OLD_FILES+=usr/tests/bin/sh/builtins/locale1.0 .endif Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Wed Jun 6 22:34:20 2018 (r334743) +++ head/usr.bin/grep/Makefile Wed Jun 6 23:12:35 2018 (r334744) @@ -65,12 +65,6 @@ CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWI LIBADD+= gnuregex .endif -.if ${MK_NLS} != "no" -.include "${.CURDIR}/nls/Makefile.inc" -.else -CFLAGS+= -DWITHOUT_NLS -.endif - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Wed Jun 6 22:34:20 2018 (r334743) +++ head/usr.bin/grep/grep.c Wed Jun 6 23:12:35 2018 (r334744) @@ -53,15 +53,6 @@ __FBSDID("$FreeBSD$"); #include "grep.h" -#ifndef WITHOUT_NLS -#include -nl_catd catalog; -#endif - -/* - * Default messags to use when NLS is disabled or no catalogue - * is found. - */ const char *errstr[] = { "", /* 1*/ "(standard input)", @@ -162,10 +153,10 @@ bool file_err; /* file reading error */ static void usage(void) { - fprintf(stderr, getstr(3), getprogname()); - fprintf(stderr, "%s", getstr(4)); - fprintf(stderr, "%s", getstr(5)); - fprintf(stderr, "%s", getstr(6)); + fprintf(stderr, errstr[3], getprogname()); + fprintf(stderr, "%s", errstr[4]); + fprintf(stderr, "%s", errstr[5]); + fprintf(stderr, "%s", errstr[6]); exit(2); } @@ -351,10 +342,6 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); -#ifndef WITHOUT_NLS - catalog = catopen("grep", NL_CAT_LOCALE); -#endif - /* Check what is the program name of the binary. In this way we can have all the funcionalities in one binary without the need of scripting and using ugly hacks. */ @@ -470,7 +457,7 @@ main(int argc, char *argv[]) else if (strcasecmp(optarg, "read") == 0) devbehave = DEV_READ; else - errx(2, getstr(2), "--devices"); + errx(2, errstr[2], "--devices"); break; case 'd': if (strcasecmp("recurse", optarg) == 0) { @@ -481,7 +468,7 @@ main(int argc, char *argv[]) else if (strcasecmp("read", optarg) == 0) dirbehave = DIR_READ; else - errx(2, getstr(2), "--directories"); + errx(2, errstr[2], "--directories"); break; case 'E': grepbehave = GREP_EXTENDED; @@ -577,9 +564,9 @@ main(int argc, char *argv[]) break; case 'V': #ifdef WITH_GNU - printf(getstr(9), getprogname(), VERSION); + printf(errstr[9], getprogname(), VERSION); #else - printf(getstr(8), getprogname(), VERSION); + printf(errstr[8], getprogname(), VERSION); #endif exit(0); case 'v': @@ -604,7 +591,7 @@ main(int argc, char *argv[]) else if (strcasecmp("text", optarg) == 0) binbehave = BINFILE_TEXT; else - errx(2, getstr(2), "--binary-files"); + errx(2, errstr[2], "--binary-files"); break; case COLOR_OPT: color = NULL; @@ -624,7 +611,7 @@ main(int argc, char *argv[]) } else if (strcasecmp("never", optarg) != 0 && strcasecmp("none", optarg) != 0 && strcasecmp("no", optarg) != 0) - errx(2, getstr(2), "--color"); + errx(2, errstr[2], "--color"); cflags &= ~REG_NOSUB; break; case LABEL_OPT: @@ -745,10 +732,6 @@ main(int argc, char *argv[]) continue; c+= procfile(*aargv); } - -#ifndef WITHOUT_NLS - catclose(catalog); -#endif /* Find out the correct return value according to the results and the command line option. */ Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Wed Jun 6 22:34:20 2018 (r334743) +++ head/usr.bin/grep/grep.h Wed Jun 6 23:12:35 2018 (r334744) @@ -38,15 +38,6 @@ #include #include -#ifdef WITHOUT_NLS -#define getstr(n) errstr[n] -#else -#include - -extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) -#endif - extern const char *errstr[]; #define VERSION "2.6.0-FreeBSD" Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Wed Jun 6 22:34:20 2018 (r334743) +++ head/usr.bin/grep/util.c Wed Jun 6 23:12:35 2018 (r334744) @@ -299,7 +299,7 @@ procfile(const char *fn) int c, t; if (strcmp(fn, "-") == 0) { - fn = label != NULL ? label : getstr(1); + fn = label != NULL ? label : errstr[1]; f = grep_open(NULL); } else { if (stat(fn, &sb) == 0) { @@ -386,7 +386,7 @@ procfile(const char *fn) printf("%s%c", fn, nullflag ? 0 : '\n'); if (c && !cflag && !lflag && !Lflag && binbehave == BINFILE_BIN && f->binary && !qflag) - printf(getstr(7), fn); + printf(errstr[7], fn); free(pc.ln.file); free(f); From owner-svn-src-head@freebsd.org Thu Jun 7 00:21:00 2018 Return-Path: Delivered-To: svn-src-head@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 6E5C3FE8B77 for ; Thu, 7 Jun 2018 00:21:00 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E309E73201 for ; Thu, 7 Jun 2018 00:20:59 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w570KhIW060876 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Jun 2018 02:20:44 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w570KXv2017831 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 7 Jun 2018 07:20:33 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Ian Lepore , rgrimes@FreeBSD.org, Brad Davis References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Eugene Grosbein Message-ID: <5B187A4C.4080009@grosbein.net> Date: Thu, 7 Jun 2018 07:20:28 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1528315608.25377.3.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:21:00 -0000 07.06.2018 3:06, Ian Lepore wrote: > I don't understand the drama over this. rc.d startup scripts are > *binaries*. This is plain wrong. Example: before introduction of rcNG we had /etc/rc.serial supposed to be user-modified to contain local settings for serial ports (uncluding USB serial). Now it is moved to /etc/rc.d/serial largely unchanged and is still supposed to be user-modified. From owner-svn-src-head@freebsd.org Thu Jun 7 00:24:11 2018 Return-Path: Delivered-To: svn-src-head@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 65A26FE8F3C; Thu, 7 Jun 2018 00:24:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BA2273561; Thu, 7 Jun 2018 00:24:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88CA18ABE; Thu, 7 Jun 2018 00:24:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w570OAId042998; Thu, 7 Jun 2018 00:24:10 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w570OAoi042997; Thu, 7 Jun 2018 00:24:10 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806070024.w570OAoi042997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 7 Jun 2018 00:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334745 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 334745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:24:11 -0000 Author: jhibbits Date: Thu Jun 7 00:24:10 2018 New Revision: 334745 URL: https://svnweb.freebsd.org/changeset/base/334745 Log: Add partition scheme for mpc85xx devices Some mpc85xx devices with u-boot need MBR partitioning with a FAT boot partition. Since the infrastructure is already in place to have a dedicated boot partition, this adds the necessary bits to use that infrastructure with mpc85xx boards. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15664 Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Wed Jun 6 23:12:35 2018 (r334744) +++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Thu Jun 7 00:24:10 2018 (r334745) @@ -44,7 +44,8 @@ default_scheme(void) { if (strcmp(platform, "powermac") == 0) return ("APM"); - if (strcmp(platform, "chrp") == 0 || strcmp(platform, "ps3") == 0) + if (strcmp(platform, "chrp") == 0 || strcmp(platform, "ps3") == 0 || + strcmp(platform, "mpc85xx") == 0) return ("MBR"); /* Pick GPT as a generic default */ @@ -65,6 +66,8 @@ is_scheme_bootable(const char *part_type) { (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 || strcmp(part_type, "GPT") == 0)) return (1); + if (strcmp(platform, "mpc85xx") == 0 && strcmp(part_type, "MBR") == 0) + return (1); return (0); } @@ -91,7 +94,8 @@ bootpart_size(const char *part_type) return (0); if (strcmp(platform, "chrp") == 0) return (800*1024); - if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0) + if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0 || + strcmp(platform, "mpc85xx") == 0) return (512*1024*1024); return (0); } @@ -107,7 +111,8 @@ bootpart_type(const char *scheme, const char **mountpo return ("prep-boot"); if (strcmp(platform, "powermac") == 0) return ("apple-boot"); - if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0) { + if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0 || + strcmp(platform, "mpc85xx") == 0) { *mountpoint = "/boot"; if (strcmp(scheme, "GPT") == 0) return ("ms-basic-data"); From owner-svn-src-head@freebsd.org Thu Jun 7 00:28:06 2018 Return-Path: Delivered-To: svn-src-head@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 AB682FE922C for ; Thu, 7 Jun 2018 00:28:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 27CF0737CE for ; Thu, 7 Jun 2018 00:28:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 9fa42548-69e9-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 9fa42548-69e9-11e8-b829-b3adae557cda; Thu, 07 Jun 2018 00:27:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w570RtiH042243; Wed, 6 Jun 2018 18:27:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528331275.25377.4.camel@freebsd.org> Subject: Re: svn commit: r334617 - in head: . etc From: Ian Lepore To: Eugene Grosbein , rgrimes@FreeBSD.org, Brad Davis Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Wed, 06 Jun 2018 18:27:55 -0600 In-Reply-To: <5B187A4C.4080009@grosbein.net> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:28:06 -0000 On Thu, 2018-06-07 at 07:20 +0700, Eugene Grosbein wrote: > 07.06.2018 3:06, Ian Lepore wrote: > > > > > I don't understand the drama over this.  rc.d startup scripts are > > *binaries*. > This is plain wrong. Example: before introduction of rcNG we had > /etc/rc.serial > supposed to be user-modified to contain local settings for serial > ports (uncluding USB serial). > Now it is moved to /etc/rc.d/serial largely unchanged and is still > supposed to be user-modified. > You're holding up mostly-obsolete badly-written script as the example of why nothing can ever change? -- Ian From owner-svn-src-head@freebsd.org Thu Jun 7 00:49:22 2018 Return-Path: Delivered-To: svn-src-head@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 A3EE4FEA436 for ; Thu, 7 Jun 2018 00:49:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 27EFD74740 for ; Thu, 7 Jun 2018 00:49:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w570n1We061078 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Jun 2018 02:49:02 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w570mwXC018133 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 7 Jun 2018 07:48:58 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Ian Lepore , rgrimes@FreeBSD.org, Brad Davis References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528331275.25377.4.camel@freebsd.org> Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Eugene Grosbein Message-ID: <5B1880F5.4030201@grosbein.net> Date: Thu, 7 Jun 2018 07:48:53 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1528331275.25377.4.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:49:22 -0000 07.06.2018 7:27, Ian Lepore wrote: >>> I don't understand the drama over this. rc.d startup scripts are >>> *binaries*. >> This is plain wrong. Example: before introduction of rcNG we had >> /etc/rc.serial >> supposed to be user-modified to contain local settings for serial >> ports (uncluding USB serial). >> Now it is moved to /etc/rc.d/serial largely unchanged and is still >> supposed to be user-modified. >> > > You're holding up mostly-obsolete badly-written script as the example > of why nothing can ever change? I have not said nothing can ever change :-) Just that scripts are not binaries at all. And discussed move will break things without working alternative proposal. From owner-svn-src-head@freebsd.org Thu Jun 7 00:54:12 2018 Return-Path: Delivered-To: svn-src-head@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 D1914FEA837; Thu, 7 Jun 2018 00:54:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8439874BF7; Thu, 7 Jun 2018 00:54:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A3318F91; Thu, 7 Jun 2018 00:54:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w570sCI1059111; Thu, 7 Jun 2018 00:54:12 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w570sCAK059109; Thu, 7 Jun 2018 00:54:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070054.w570sCAK059109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 00:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334746 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 334746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:54:13 -0000 Author: mmacy Date: Thu Jun 7 00:54:11 2018 New Revision: 334746 URL: https://svnweb.freebsd.org/changeset/base/334746 Log: cpufunc: add rdtscp for x86 Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Thu Jun 7 00:24:10 2018 (r334745) +++ head/sys/amd64/include/cpufunc.h Thu Jun 7 00:54:11 2018 (r334746) @@ -386,6 +386,15 @@ rdtsc(void) return (low | ((uint64_t)high << 32)); } +static __inline uint64_t +rdtscp(void) +{ + uint32_t low, high; + + __asm __volatile("rdtscp" : "=a" (low), "=d" (high)); + return (low | ((uint64_t)high << 32)); +} + static __inline uint32_t rdtsc32(void) { Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Thu Jun 7 00:24:10 2018 (r334745) +++ head/sys/i386/include/cpufunc.h Thu Jun 7 00:54:11 2018 (r334746) @@ -368,6 +368,15 @@ rdtsc(void) return (rv); } +static __inline uint64_t +rdtscp(void) +{ + uint64_t rv; + + __asm __volatile("rdtscp" : "=A" (rv)); + return (rv); +} + static __inline uint32_t rdtsc32(void) { From owner-svn-src-head@freebsd.org Thu Jun 7 00:54:43 2018 Return-Path: Delivered-To: svn-src-head@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 DDBC0FEA8C4; Thu, 7 Jun 2018 00:54:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D57574D47; Thu, 7 Jun 2018 00:54:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F71B18F92; Thu, 7 Jun 2018 00:54:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w570shPC059176; Thu, 7 Jun 2018 00:54:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w570shiE059175; Thu, 7 Jun 2018 00:54:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070054.w570shiE059175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 00:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334747 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:54:44 -0000 Author: mmacy Date: Thu Jun 7 00:54:43 2018 New Revision: 334747 URL: https://svnweb.freebsd.org/changeset/base/334747 Log: hwpmc: don't log pid->name more than once Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Thu Jun 7 00:54:11 2018 (r334746) +++ head/sys/dev/hwpmc/hwpmc_mod.c Thu Jun 7 00:54:43 2018 (r334747) @@ -1821,7 +1821,8 @@ pmc_log_kernel_mappings(struct pmc *pm) if (po->po_flags & PMC_PO_INITIAL_MAPPINGS_DONE) return; - + if (PMC_TO_MODE(pm) == PMC_MODE_SS) + pmc_process_allproc(pm); /* * Log the current set of kernel modules. */ @@ -4041,8 +4042,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a pmc = NULL; break; } - if (mode == PMC_MODE_SS) - pmc_process_allproc(pmc); + /* * Return the allocated index. From owner-svn-src-head@freebsd.org Thu Jun 7 00:55:18 2018 Return-Path: Delivered-To: svn-src-head@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 1BB70FEA94B; Thu, 7 Jun 2018 00:55:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2E2E74E79; Thu, 7 Jun 2018 00:55:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A404718F93; Thu, 7 Jun 2018 00:55:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w570tHWu059273; Thu, 7 Jun 2018 00:55:17 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w570tH71059272; Thu, 7 Jun 2018 00:55:17 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070055.w570tH71059272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 00:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334748 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 334748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:55:18 -0000 Author: mmacy Date: Thu Jun 7 00:55:17 2018 New Revision: 334748 URL: https://svnweb.freebsd.org/changeset/base/334748 Log: libpmc: simplify lookup by idx Modified: head/lib/libpmc/libpmc_pmu_util.c (contents, props changed) Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Thu Jun 7 00:54:43 2018 (r334747) +++ head/lib/libpmc/libpmc_pmu_util.c Thu Jun 7 00:55:17 2018 (r334748) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "pmu-events/pmu-events.h" @@ -165,13 +166,11 @@ const char * pmc_pmu_event_get_by_idx(const char *cpuid, int idx) { const struct pmu_events_map *pme; - const struct pmu_event *pe; - int i; if ((pme = pmu_events_map_get(cpuid)) == NULL) return (NULL); - for (i = 0, pe = pme->table; (pe->name || pe->desc || pe->event) && i < idx; pe++, i++); - return (pe->name); + assert(pme->table[idx].name); + return (pme->table[idx].name); } static int From owner-svn-src-head@freebsd.org Thu Jun 7 02:05:02 2018 Return-Path: Delivered-To: svn-src-head@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 71B8DFEE02B; Thu, 7 Jun 2018 02:05:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8F887724A; Thu, 7 Jun 2018 02:03:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA24119B7E; Thu, 7 Jun 2018 02:03:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5723OO0093960; Thu, 7 Jun 2018 02:03:24 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5723Mcn093949; Thu, 7 Jun 2018 02:03:22 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070203.w5723Mcn093949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 02:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334749 - in head: lib lib/libpmc sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmc usr.sbin/pmccontrol usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib lib/libpmc sys/dev/hwpmc sys/sys usr.sbin usr.sbin/pmc usr.sbin/pmccontrol usr.sbin/pmcstat X-SVN-Commit-Revision: 334749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 02:05:02 -0000 Author: mmacy Date: Thu Jun 7 02:03:22 2018 New Revision: 334749 URL: https://svnweb.freebsd.org/changeset/base/334749 Log: pmc: convert native to jsonl and track TSC value of samples - add '-j' options to filter to enable converting native pmc log format to json lines format to enable the use of scripts and external tooling % pmc filter -j pmc.log pmc.jsonl - Record the tsc value in sampling interrupts as opposed to recording nanotime when the sample is copied to a global log in hardclock - potentially many milliseconds later. - At initialize record the tsc_freq and the time of day to give us an offset for translating the tsc values in callchain records Added: head/lib/libpmc/libpmc_json.cc (contents, props changed) head/lib/libpmc/pmcformat.h (contents, props changed) Modified: head/lib/Makefile head/lib/libpmc/Makefile head/lib/libpmc/pmclog.c head/lib/libpmc/pmclog.h head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/sys/pmc.h head/sys/sys/pmclog.h head/usr.sbin/Makefile head/usr.sbin/pmc/Makefile (contents, props changed) head/usr.sbin/pmc/cmd_pmc_filter.cc head/usr.sbin/pmccontrol/Makefile head/usr.sbin/pmcstat/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Jun 7 00:55:17 2018 (r334748) +++ head/lib/Makefile Thu Jun 7 02:03:22 2018 (r334749) @@ -202,7 +202,9 @@ _libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) SUBDIR.${MK_PMC}+= libpmc libpmcstat +.endif SUBDIR.${MK_RADIUS_SUPPORT}+= libradius SUBDIR.${MK_SENDMAIL}+= libmilter libsm libsmdb libsmutil SUBDIR.${MK_TELNET}+= libtelnet Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Thu Jun 7 00:55:17 2018 (r334748) +++ head/lib/libpmc/Makefile Thu Jun 7 02:03:22 2018 (r334749) @@ -3,8 +3,8 @@ PACKAGE=lib${LIB} LIB= pmc -SRCS= libpmc.c pmclog.c libpmc_pmu_util.c -INCS= pmc.h pmclog.h +SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc +INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} Added: head/lib/libpmc/libpmc_json.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/libpmc_json.cc Thu Jun 7 02:03:22 2018 (r334749) @@ -0,0 +1,393 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::string; + +static const char *typenames[] = { + "", + "{\"type\": \"closelog\"}\n", + "{\"type\": \"dropnotify\"}\n", + "{\"type\": \"initialize\"", + "", + "{\"type\": \"pmcallocate\"", + "{\"type\": \"pmcattach\"", + "{\"type\": \"pmcdetach\"", + "{\"type\": \"proccsw\"", + "{\"type\": \"procexec\"", + "{\"type\": \"procexit\"", + "{\"type\": \"procfork\"", + "{\"type\": \"sysexit\"", + "{\"type\": \"userdata\"", + "{\"type\": \"map_in\"", + "{\"type\": \"map_out\"", + "{\"type\": \"callchain\"", + "{\"type\": \"pmcallocatedyn\"", + "{\"type\": \"thr_create\"", + "{\"type\": \"thr_exit\"", + "{\"type\": \"proc_create\"", +}; + +static string +startentry(struct pmclog_ev *ev) +{ + char eventbuf[128]; + + snprintf(eventbuf, sizeof(eventbuf), "%s, \"tsc\": \"%jd\"", + typenames[ev->pl_type], (intmax_t)ev->pl_ts.tv_sec); + return (string(eventbuf)); +} + +static string +initialize_to_json(struct pmclog_ev *ev) +{ + char eventbuf[256]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"version\": \"0x%08x\", \"arch\": \"0x%08x\", \"cpuid\": \"%s\", " + "\"tsc_freq\": \"%jd\", \"sec\": \"%jd\", \"nsec\": \"%jd\"}\n", + startent.c_str(), ev->pl_u.pl_i.pl_version, ev->pl_u.pl_i.pl_arch, + ev->pl_u.pl_i.pl_cpuid, (uintmax_t)ev->pl_u.pl_i.pl_tsc_freq, + (uintmax_t)ev->pl_u.pl_i.pl_ts.tv_sec, (uintmax_t)ev->pl_u.pl_i.pl_ts.tv_nsec); + return string(eventbuf); +} + +static string +pmcallocate_to_json(struct pmclog_ev *ev) +{ + char eventbuf[256]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"event\": \"0x%08x\", \"flags\": \"0x%08x\", " + "\"rate\": \"%jd\"}\n", + startent.c_str(), ev->pl_u.pl_a.pl_pmcid, ev->pl_u.pl_a.pl_event, + ev->pl_u.pl_a.pl_flags, (intmax_t)ev->pl_u.pl_a.pl_rate); + return string(eventbuf); +} + +static string +pmcattach_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\", \"pathname\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_t.pl_pmcid, ev->pl_u.pl_t.pl_pid, + ev->pl_u.pl_t.pl_pathname); + return string(eventbuf); +} + +static string +pmcdetach_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\"}\n", + startent.c_str(), ev->pl_u.pl_d.pl_pmcid, ev->pl_u.pl_d.pl_pid); + return string(eventbuf); +} + + +static string +proccsw_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\" " + "\"tid\": \"%d\", \"value\": \"0x%016jx\"}\n", + startent.c_str(), ev->pl_u.pl_c.pl_pmcid, ev->pl_u.pl_c.pl_pid, + ev->pl_u.pl_c.pl_tid, (uintmax_t)ev->pl_u.pl_c.pl_value); + return string(eventbuf); +} + +static string +procexec_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\", " + "\"start\": \"0x%016jx\", \"pathname\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_x.pl_pmcid, ev->pl_u.pl_x.pl_pid, + ev->pl_u.pl_x.pl_entryaddr, ev->pl_u.pl_x.pl_pathname); + return string(eventbuf); +} + +static string +procexit_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\", " + "\"value\": \"0x%016jx\"}\n", + startent.c_str(), ev->pl_u.pl_e.pl_pmcid, ev->pl_u.pl_e.pl_pid, + (uintmax_t)ev->pl_u.pl_e.pl_value); + return string(eventbuf); +} + +static string +procfork_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"oldpid\": \"%d\", \"newpid\": \"%d\"}\n", + startent.c_str(), ev->pl_u.pl_f.pl_oldpid, ev->pl_u.pl_f.pl_newpid); + return string(eventbuf); +} + +static string +sysexit_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"pid\": \"%d\"}\n", + startent.c_str(), ev->pl_u.pl_se.pl_pid); + return string(eventbuf); +} + +static string +userdata_to_json(struct pmclog_ev *ev) +{ + char eventbuf[128]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"userdata\": \"0x%08x\"}\n", + startent.c_str(), ev->pl_u.pl_u.pl_userdata); + return string(eventbuf); +} + +static string +map_in_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"pid\": \"%d\", " + "\"start\": \"0x%016jx\", \"pathname\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_mi.pl_pid, + (uintmax_t)ev->pl_u.pl_mi.pl_start, ev->pl_u.pl_mi.pl_pathname); + return string(eventbuf); +} + +static string +map_out_to_json(struct pmclog_ev *ev) +{ + char eventbuf[256]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"pid\": \"%d\", " + "\"start\": \"0x%016jx\", \"end\": \"0x%016jx\"}\n", + startent.c_str(), ev->pl_u.pl_mi.pl_pid, + (uintmax_t)ev->pl_u.pl_mi.pl_start, + (uintmax_t)ev->pl_u.pl_mo.pl_end); + return string(eventbuf); +} + +static string +callchain_to_json(struct pmclog_ev *ev) +{ + char eventbuf[1024]; + string result; + uint32_t i; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\", \"tid\": \"%d\", " + "\"cpuflags\": \"0x%08x\", \"cpuflags2\": \"0x%08x\", \"pc\": [ ", + startent.c_str(), ev->pl_u.pl_cc.pl_pmcid, ev->pl_u.pl_cc.pl_pid, + ev->pl_u.pl_cc.pl_tid, ev->pl_u.pl_cc.pl_cpuflags, ev->pl_u.pl_cc.pl_cpuflags2); + result = string(eventbuf); + for (i = 0; i < ev->pl_u.pl_cc.pl_npc - 1; i++) { + snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\", ", ev->pl_u.pl_cc.pl_pc[i]); + result += string(eventbuf); + } + snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\"]}\n", ev->pl_u.pl_cc.pl_pc[i]); + result += string(eventbuf); + return (result); +} + +static string +pmcallocatedyn_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pmcid\": \"0x%08x\", \"event\": \"%d\", \"flags\": \"0x%08x\", \"evname\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_ad.pl_pmcid, ev->pl_u.pl_ad.pl_event, + ev->pl_u.pl_ad.pl_flags, ev->pl_u.pl_ad.pl_evname); + return string(eventbuf); +} + +static string +proccreate_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"pid\": \"%d\", \"flags\": \"0x%08x\", \"pcomm\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_pc.pl_pid, + ev->pl_u.pl_pc.pl_flags, ev->pl_u.pl_pc.pl_pcomm); + return string(eventbuf); +} + +static string +threadcreate_to_json(struct pmclog_ev *ev) +{ + char eventbuf[2048]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), + "%s, \"tid\": \"%d\", \"pid\": \"%d\", \"flags\": \"0x%08x\", \"tdname\": \"%s\"}\n", + startent.c_str(), ev->pl_u.pl_tc.pl_tid, ev->pl_u.pl_tc.pl_pid, + ev->pl_u.pl_tc.pl_flags, ev->pl_u.pl_tc.pl_tdname); + return string(eventbuf); +} + +static string +threadexit_to_json(struct pmclog_ev *ev) +{ + char eventbuf[256]; + string startent; + + startent = startentry(ev); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"tid\": \"%d\"}\n", + startent.c_str(), ev->pl_u.pl_te.pl_tid); + return string(eventbuf); +} + +static string +stub_to_json(struct pmclog_ev *ev) +{ + string startent; + + startent = startentry(ev); + startent += string("}\n"); + return startent; +} + +typedef string (*jconv) (struct pmclog_ev*); + +static jconv jsonconvert[] = { + NULL, + stub_to_json, + stub_to_json, + initialize_to_json, + NULL, + pmcallocate_to_json, + pmcattach_to_json, + pmcdetach_to_json, + proccsw_to_json, + procexec_to_json, + procexit_to_json, + procfork_to_json, + sysexit_to_json, + userdata_to_json, + map_in_to_json, + map_out_to_json, + callchain_to_json, + pmcallocatedyn_to_json, + threadcreate_to_json, + threadexit_to_json, + proccreate_to_json, +}; + +string +event_to_json(struct pmclog_ev *ev){ + + switch (ev->pl_type) { + case PMCLOG_TYPE_DROPNOTIFY: + case PMCLOG_TYPE_CLOSELOG: + case PMCLOG_TYPE_INITIALIZE: + case PMCLOG_TYPE_PMCALLOCATE: + case PMCLOG_TYPE_PMCATTACH: + case PMCLOG_TYPE_PMCDETACH: + case PMCLOG_TYPE_PROCCSW: + case PMCLOG_TYPE_PROCEXEC: + case PMCLOG_TYPE_PROCEXIT: + case PMCLOG_TYPE_PROCFORK: + case PMCLOG_TYPE_SYSEXIT: + case PMCLOG_TYPE_USERDATA: + case PMCLOG_TYPE_MAP_IN: + case PMCLOG_TYPE_MAP_OUT: + case PMCLOG_TYPE_CALLCHAIN: + case PMCLOG_TYPE_PMCALLOCATEDYN: + case PMCLOG_TYPE_THR_CREATE: + case PMCLOG_TYPE_THR_EXIT: + case PMCLOG_TYPE_PROC_CREATE: + return jsonconvert[ev->pl_type](ev); + default: + errx(EX_USAGE, "ERROR: unrecognized event type: %d\n", ev->pl_type); + } +} + Added: head/lib/libpmc/pmcformat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmcformat.h Thu Jun 7 02:03:22 2018 (r334749) @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ +#ifndef __PMCFORMAT_H_ +#define __PMCFORMAT_H_ +std::string event_to_json(struct pmclog_ev *ev); +#endif Modified: head/lib/libpmc/pmclog.c ============================================================================== --- head/lib/libpmc/pmclog.c Thu Jun 7 00:55:17 2018 (r334748) +++ head/lib/libpmc/pmclog.c Thu Jun 7 02:03:22 2018 (r334749) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "libpmcinternal.h" -#define PMCLOG_BUFFER_SIZE 4096 +#define PMCLOG_BUFFER_SIZE 512*1024 /* * API NOTES @@ -260,6 +260,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l uint32_t h, *le, npc, noop; enum pmclog_parser_state e; struct pmclog_parse_state *ps; + struct pmclog_header *ph; ps = (struct pmclog_parse_state *) cookie; @@ -278,8 +279,9 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_INITIALIZE_READER(le, ps->ps_saved); ev->pl_data = le; - PMCLOG_READ32(le,h); + ph = (struct pmclog_header *)(uintptr_t)le; + h = ph->pl_header; if (!PMCLOG_HEADER_CHECK_MAGIC(h)) { printf("bad magic\n"); ps->ps_state = PL_STATE_ERROR; @@ -288,8 +290,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l } /* copy out the time stamp */ - PMCLOG_READ32(le,ev->pl_ts.tv_sec); - PMCLOG_READ32(le,ev->pl_ts.tv_nsec); + ev->pl_ts.tv_sec = ph->pl_tsc; + le += sizeof(*ph)/4; evlen = PMCLOG_HEADER_TO_LENGTH(h); @@ -310,7 +312,6 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_cc.pl_tid); PMCLOG_READ32(le,ev->pl_u.pl_cc.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_cc.pl_cpuflags); - PMCLOG_READ32(le,ev->pl_u.pl_cc.pl_cpuflags2); PMCLOG_GET_CALLCHAIN_SIZE(ev->pl_u.pl_cc.pl_npc,evlen); for (npc = 0; npc < ev->pl_u.pl_cc.pl_npc; npc++) PMCLOG_READADDR(le,ev->pl_u.pl_cc.pl_pc[npc]); @@ -326,6 +327,9 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_INITIALIZE: PMCLOG_READ32(le,ev->pl_u.pl_i.pl_version); PMCLOG_READ32(le,ev->pl_u.pl_i.pl_arch); + PMCLOG_READ64(le,ev->pl_u.pl_i.pl_tsc_freq); + memcpy(&ev->pl_u.pl_i.pl_ts, le, sizeof(struct timespec)); + le += sizeof(struct timespec)/4; PMCLOG_READSTRING(le, ev->pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN); memcpy(ev->pl_u.pl_i.pl_cpuid, le, PMC_CPUID_LEN); ps->ps_cpuid = strdup(ev->pl_u.pl_i.pl_cpuid); @@ -336,11 +340,13 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_MAP_IN: PMCLOG_GET_PATHLEN(pathlen,evlen,pmclog_map_in); PMCLOG_READ32(le,ev->pl_u.pl_mi.pl_pid); + PMCLOG_READ32(le,noop); PMCLOG_READADDR(le,ev->pl_u.pl_mi.pl_start); PMCLOG_READSTRING(le, ev->pl_u.pl_mi.pl_pathname, pathlen); break; case PMCLOG_TYPE_MAP_OUT: PMCLOG_READ32(le,ev->pl_u.pl_mo.pl_pid); + PMCLOG_READ32(le,noop); PMCLOG_READADDR(le,ev->pl_u.pl_mo.pl_start); PMCLOG_READADDR(le,ev->pl_u.pl_mo.pl_end); break; @@ -348,6 +354,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_a.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_event); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags); + PMCLOG_READ32(le,noop); PMCLOG_READ64(le,ev->pl_u.pl_a.pl_rate); ev->pl_u.pl_a.pl_evname = pmc_pmu_event_get_by_idx(ps->ps_cpuid, ev->pl_u.pl_a.pl_event); if (ev->pl_u.pl_a.pl_evname != NULL) @@ -363,6 +370,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_event); PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_flags); + PMCLOG_READ32(le,noop); PMCLOG_READSTRING(le,ev->pl_u.pl_ad.pl_evname,PMC_NAME_MAX); break; case PMCLOG_TYPE_PMCATTACH: @@ -376,8 +384,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_d.pl_pid); break; case PMCLOG_TYPE_PROCCSW: - PMCLOG_READ32(le,ev->pl_u.pl_c.pl_pmcid); PMCLOG_READ64(le,ev->pl_u.pl_c.pl_value); + PMCLOG_READ32(le,ev->pl_u.pl_c.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_c.pl_pid); PMCLOG_READ32(le,ev->pl_u.pl_c.pl_tid); break; @@ -385,14 +393,12 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_GET_PATHLEN(pathlen,evlen,pmclog_procexec); PMCLOG_READ32(le,ev->pl_u.pl_x.pl_pid); PMCLOG_READ32(le,ev->pl_u.pl_x.pl_pmcid); - PMCLOG_READ32(le,noop); PMCLOG_READADDR(le,ev->pl_u.pl_x.pl_entryaddr); PMCLOG_READSTRING(le,ev->pl_u.pl_x.pl_pathname,pathlen); break; case PMCLOG_TYPE_PROCEXIT: PMCLOG_READ32(le,ev->pl_u.pl_e.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_e.pl_pid); - PMCLOG_READ32(le,noop); PMCLOG_READ64(le,ev->pl_u.pl_e.pl_value); break; case PMCLOG_TYPE_PROCFORK: @@ -409,6 +415,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_tid); PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_pid); PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_flags); + PMCLOG_READ32(le,noop); memcpy(ev->pl_u.pl_tc.pl_tdname, le, MAXCOMLEN+1); break; case PMCLOG_TYPE_THR_EXIT: @@ -417,7 +424,6 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l case PMCLOG_TYPE_PROC_CREATE: PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_pid); PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_flags); - PMCLOG_READ32(le,noop); memcpy(ev->pl_u.pl_pc.pl_pcomm, le, MAXCOMLEN+1); break; default: /* unknown record type */ Modified: head/lib/libpmc/pmclog.h ============================================================================== --- head/lib/libpmc/pmclog.h Thu Jun 7 00:55:17 2018 (r334748) +++ head/lib/libpmc/pmclog.h Thu Jun 7 02:03:22 2018 (r334749) @@ -64,6 +64,8 @@ struct pmclog_ev_closelog { struct pmclog_ev_initialize { uint32_t pl_version; uint32_t pl_arch; + uint64_t pl_tsc_freq; + struct timespec pl_ts; char pl_cpuid[PATH_MAX]; }; Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Thu Jun 7 00:55:17 2018 (r334748) +++ head/sys/dev/hwpmc/hwpmc_logging.c Thu Jun 7 02:03:22 2018 (r334749) @@ -61,6 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__i386__) || defined(__amd64__) +#include +#endif + #ifdef NUMA #define NDOMAINS vm_ndomains #define curdomain PCPU_GET(domain) @@ -124,29 +128,38 @@ static struct mtx pmc_kthread_mtx; /* sleep lock */ ((L) & 0xFFFF)) /* reserve LEN bytes of space and initialize the entry header */ -#define _PMCLOG_RESERVE_SAFE(PO,TYPE,LEN,ACTION) do { \ +#define _PMCLOG_RESERVE_SAFE(PO,TYPE,LEN,ACTION, TSC) do { \ uint32_t *_le; \ int _len = roundup((LEN), sizeof(uint32_t)); \ + struct pmclog_header *ph; \ if ((_le = pmclog_reserve((PO), _len)) == NULL) { \ - ACTION; \ - } \ - *_le = _PMCLOG_TO_HEADER(TYPE,_len); \ - _le += 3 /* skip over timestamp */ + ACTION; \ + } \ + ph = (struct pmclog_header *)_le; \ + ph->pl_header =_PMCLOG_TO_HEADER(TYPE,_len); \ + ph->pl_tsc = (TSC); \ + _le += sizeof(*ph)/4 /* skip over timestamp */ /* reserve LEN bytes of space and initialize the entry header */ #define _PMCLOG_RESERVE(PO,TYPE,LEN,ACTION) do { \ uint32_t *_le; \ - int _len = roundup((LEN), sizeof(uint32_t)); \ + int _len = roundup((LEN), sizeof(uint32_t)); \ + uint64_t tsc; \ + struct pmclog_header *ph; \ + tsc = pmc_rdtsc(); \ spinlock_enter(); \ if ((_le = pmclog_reserve((PO), _len)) == NULL) { \ spinlock_exit(); \ ACTION; \ } \ - *_le = _PMCLOG_TO_HEADER(TYPE,_len); \ - _le += 3 /* skip over timestamp */ + ph = (struct pmclog_header *)_le; \ + ph->pl_header =_PMCLOG_TO_HEADER(TYPE,_len); \ + ph->pl_tsc = tsc; \ + _le += sizeof(*ph)/4 /* skip over timestamp */ -#define PMCLOG_RESERVE_SAFE(P,T,L) _PMCLOG_RESERVE_SAFE(P,T,L,return) + +#define PMCLOG_RESERVE_SAFE(P,T,L,TSC) _PMCLOG_RESERVE_SAFE(P,T,L,return,TSC) #define PMCLOG_RESERVE(P,T,L) _PMCLOG_RESERVE(P,T,L,return) #define PMCLOG_RESERVE_WITH_ERROR(P,T,L) _PMCLOG_RESERVE(P,T,L, \ error=ENOMEM;goto error) @@ -181,32 +194,32 @@ static struct mtx pmc_kthread_mtx; /* sleep lock */ } while (0) +#define TSDELTA 4 /* * Assertions about the log file format. */ - -CTASSERT(sizeof(struct pmclog_callchain) == 8*4 + +CTASSERT(sizeof(struct pmclog_callchain) == 7*4 + TSDELTA + PMC_CALLCHAIN_DEPTH_MAX*sizeof(uintfptr_t)); -CTASSERT(sizeof(struct pmclog_closelog) == 4*4); -CTASSERT(sizeof(struct pmclog_dropnotify) == 4*4); -CTASSERT(sizeof(struct pmclog_map_in) == PATH_MAX + - 4*4 + sizeof(uintfptr_t)); +CTASSERT(sizeof(struct pmclog_closelog) == 3*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_dropnotify) == 3*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_map_in) == PATH_MAX + TSDELTA + + 5*4 + sizeof(uintfptr_t)); CTASSERT(offsetof(struct pmclog_map_in,pl_pathname) == - 4*4 + sizeof(uintfptr_t)); -CTASSERT(sizeof(struct pmclog_map_out) == 4*4 + 2*sizeof(uintfptr_t)); -CTASSERT(sizeof(struct pmclog_pmcallocate) == 8*4); -CTASSERT(sizeof(struct pmclog_pmcattach) == 6*4 + PATH_MAX); -CTASSERT(offsetof(struct pmclog_pmcattach,pl_pathname) == 6*4); -CTASSERT(sizeof(struct pmclog_pmcdetach) == 6*4); -CTASSERT(sizeof(struct pmclog_proccsw) == 6*4 + 8); -CTASSERT(sizeof(struct pmclog_procexec) == 6*4 + PATH_MAX + + 5*4 + TSDELTA + sizeof(uintfptr_t)); +CTASSERT(sizeof(struct pmclog_map_out) == 5*4 + 2*sizeof(uintfptr_t) + TSDELTA); +CTASSERT(sizeof(struct pmclog_pmcallocate) == 9*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_pmcattach) == 5*4 + PATH_MAX + TSDELTA); +CTASSERT(offsetof(struct pmclog_pmcattach,pl_pathname) == 5*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_pmcdetach) == 5*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_proccsw) == 7*4 + 8 + TSDELTA); +CTASSERT(sizeof(struct pmclog_procexec) == 5*4 + PATH_MAX + + sizeof(uintfptr_t) + TSDELTA); +CTASSERT(offsetof(struct pmclog_procexec,pl_pathname) == 5*4 + TSDELTA + sizeof(uintfptr_t)); -CTASSERT(offsetof(struct pmclog_procexec,pl_pathname) == 6*4 + - sizeof(uintfptr_t)); -CTASSERT(sizeof(struct pmclog_procexit) == 6*4 + 8); -CTASSERT(sizeof(struct pmclog_procfork) == 6*4); -CTASSERT(sizeof(struct pmclog_sysexit) == 4*4); -CTASSERT(sizeof(struct pmclog_userdata) == 4*4); +CTASSERT(sizeof(struct pmclog_procexit) == 5*4 + 8 + TSDELTA); +CTASSERT(sizeof(struct pmclog_procfork) == 5*4 + TSDELTA); +CTASSERT(sizeof(struct pmclog_sysexit) == 6*4); +CTASSERT(sizeof(struct pmclog_userdata) == 6*4); /* * Log buffer structure @@ -545,8 +558,6 @@ static uint32_t * pmclog_reserve(struct pmc_owner *po, int length) { uintptr_t newptr, oldptr; - uint32_t *lh; - struct timespec ts; struct pmclog_buffer *plb, **pplb; PMCDBG2(LOG,ALL,1, "po=%p len=%d", po, length); @@ -612,11 +623,6 @@ pmclog_reserve(struct pmc_owner *po, int length) oldptr = (uintptr_t) plb->plb_ptr; done: - lh = (uint32_t *) oldptr; - lh++; /* skip header */ - getnanotime(&ts); /* fill in the timestamp */ - *lh++ = ts.tv_sec & 0xFFFFFFFF; - *lh++ = ts.tv_nsec & 0xFFFFFFF; return ((uint32_t *) oldptr); fail: return (NULL); @@ -693,6 +699,8 @@ int pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) { struct proc *p; + struct timespec ts; + uint64_t tsc; int error; sx_assert(&pmc_sx, SA_XLOCKED); @@ -720,12 +728,21 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o PROC_LOCK(p); p->p_flag |= P_HWPMC; PROC_UNLOCK(p); - + nanotime(&ts); + tsc = pmc_rdtsc(); /* create a log initialization entry */ PMCLOG_RESERVE_WITH_ERROR(po, INITIALIZE, sizeof(struct pmclog_initialize)); PMCLOG_EMIT32(PMC_VERSION); PMCLOG_EMIT32(md->pmd_cputype); +#if defined(__i386__) || defined(__amd64__) + PMCLOG_EMIT64(tsc_freq); +#else + /* other architectures will need to fill this in */ + PMCLOG_EMIT64(0); +#endif + memcpy(_le, &ts, sizeof(ts)); + _le += sizeof(ts)/4; PMCLOG_EMITSTRING(pmc_cpuid, PMC_CPUID_LEN); PMCLOG_DESPATCH_SYNC(po); @@ -917,13 +934,11 @@ pmclog_process_callchain(struct pmc *pm, struct pmc_sa ps->ps_nsamples * sizeof(uintfptr_t); po = pm->pm_owner; flags = PMC_CALLCHAIN_TO_CPUFLAGS(ps->ps_cpu,ps->ps_flags); - PMCLOG_RESERVE_SAFE(po, CALLCHAIN, recordlen); + PMCLOG_RESERVE_SAFE(po, CALLCHAIN, recordlen, ps->ps_tsc); PMCLOG_EMIT32(ps->ps_pid); PMCLOG_EMIT32(ps->ps_tid); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(flags); - /* unused for now */ - PMCLOG_EMIT32(0); for (n = 0; n < ps->ps_nsamples; n++) PMCLOG_EMITADDR(ps->ps_pc[n]); PMCLOG_DESPATCH_SAFE(po); @@ -957,6 +972,7 @@ pmclog_process_map_in(struct pmc_owner *po, pid_t pid, PMCLOG_RESERVE(po, MAP_IN, recordlen); PMCLOG_EMIT32(pid); + PMCLOG_EMIT32(0); PMCLOG_EMITADDR(start); PMCLOG_EMITSTRING(path,pathlen); PMCLOG_DESPATCH_SYNC(po); @@ -970,6 +986,7 @@ pmclog_process_map_out(struct pmc_owner *po, pid_t pid PMCLOG_RESERVE(po, MAP_OUT, sizeof(struct pmclog_map_out)); PMCLOG_EMIT32(pid); + PMCLOG_EMIT32(0); PMCLOG_EMITADDR(start); PMCLOG_EMITADDR(end); PMCLOG_DESPATCH(po); @@ -991,6 +1008,7 @@ pmclog_process_pmcallocate(struct pmc *pm) PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); PMCLOG_EMIT32(pm->pm_flags); + PMCLOG_EMIT32(0); PMCLOG_EMIT64(pm->pm_sc.pm_reloadcount); ps = pmc_soft_ev_acquire(pm->pm_event); if (ps != NULL) @@ -1005,6 +1023,7 @@ pmclog_process_pmcallocate(struct pmc *pm) PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pm->pm_event); PMCLOG_EMIT32(pm->pm_flags); + PMCLOG_EMIT32(0); PMCLOG_EMIT64(pm->pm_sc.pm_reloadcount); PMCLOG_DESPATCH_SYNC(po); } @@ -1026,7 +1045,6 @@ pmclog_process_pmcattach(struct pmc *pm, pid_t pid, ch PMCLOG_RESERVE(po, PMCATTACH, recordlen); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pid); - PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(path, pathlen); PMCLOG_DESPATCH_SYNC(po); } @@ -1053,14 +1071,12 @@ pmclog_process_proccreate(struct pmc_owner *po, struct PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); - PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { PMCLOG_RESERVE(po, PROC_CREATE, sizeof(struct pmclog_proccreate)); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); - PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(p->p_comm, MAXCOMLEN+1); PMCLOG_DESPATCH(po); } @@ -1083,11 +1099,12 @@ pmclog_process_proccsw(struct pmc *pm, struct pmc_proc po = pm->pm_owner; - PMCLOG_RESERVE_SAFE(po, PROCCSW, sizeof(struct pmclog_proccsw)); - PMCLOG_EMIT32(pm->pm_id); + PMCLOG_RESERVE_SAFE(po, PROCCSW, sizeof(struct pmclog_proccsw), pmc_rdtsc()); PMCLOG_EMIT64(v); + PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pp->pp_proc->p_pid); PMCLOG_EMIT32(td->td_tid); + PMCLOG_EMIT32(0); PMCLOG_DESPATCH_SCHED_LOCK(po); } @@ -1104,7 +1121,6 @@ pmclog_process_procexec(struct pmc_owner *po, pmc_id_t PMCLOG_RESERVE(po, PROCEXEC, recordlen); PMCLOG_EMIT32(pid); PMCLOG_EMIT32(pmid); - PMCLOG_EMIT32(0); PMCLOG_EMITADDR(startaddr); PMCLOG_EMITSTRING(path,pathlen); PMCLOG_DESPATCH_SYNC(po); @@ -1129,7 +1145,6 @@ pmclog_process_procexit(struct pmc *pm, struct pmc_pro PMCLOG_RESERVE(po, PROCEXIT, sizeof(struct pmclog_procexit)); PMCLOG_EMIT32(pm->pm_id); PMCLOG_EMIT32(pp->pp_proc->p_pid); - PMCLOG_EMIT32(0); PMCLOG_EMIT64(pp->pp_pmcs[ri].pp_pmcval); PMCLOG_DESPATCH(po); } @@ -1170,6 +1185,7 @@ pmclog_process_threadcreate(struct pmc_owner *po, stru PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); + PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); PMCLOG_DESPATCH_SYNC(po); } else { @@ -1177,6 +1193,7 @@ pmclog_process_threadcreate(struct pmc_owner *po, stru PMCLOG_EMIT32(td->td_tid); PMCLOG_EMIT32(p->p_pid); PMCLOG_EMIT32(p->p_flag); + PMCLOG_EMIT32(0); PMCLOG_EMITSTRING(td->td_name, MAXCOMLEN+1); PMCLOG_DESPATCH(po); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Thu Jun 7 00:55:17 2018 (r334748) +++ head/sys/dev/hwpmc/hwpmc_mod.c Thu Jun 7 02:03:22 2018 (r334749) @@ -809,6 +809,19 @@ pmc_force_context_switch(void) pause("pmcctx", 1); } +uint64_t +pmc_rdtsc(void) +{ +#if defined(__i386__) || defined(__amd64__) + if (__predict_true(amd_feature & AMDID_RDTSCP)) + return rdtscp(); + else + return rdtsc(); +#else + return get_cyclecount(); +#endif +} + /* * Get the file name for an executable. This is a simple wrapper * around vn_fullpath(9). @@ -4676,6 +4689,8 @@ pmc_add_sample(int cpu, int ring, struct pmc *pm, stru ps->ps_td = td; ps->ps_pid = td->td_proc->p_pid; ps->ps_tid = td->td_tid; + ps->ps_tsc = pmc_rdtsc(); + ps->ps_cpu = cpu; ps->ps_flags = inuserspace ? PMC_CC_F_USERSPACE : 0; Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Thu Jun 7 00:55:17 2018 (r334748) +++ head/sys/sys/pmc.h Thu Jun 7 02:03:22 2018 (r334749) @@ -61,7 +61,7 @@ * * The patch version is incremented for every bug fix. */ -#define PMC_VERSION_MAJOR 0x07 +#define PMC_VERSION_MAJOR 0x08 #define PMC_VERSION_MINOR 0x03 #define PMC_VERSION_PATCH 0x0000 @@ -939,6 +939,7 @@ struct pmc_sample { struct thread *ps_td; /* which thread */ struct pmc *ps_pmc; /* interrupting PMC */ uintptr_t *ps_pc; /* (const) callchain start */ + uint64_t ps_tsc; /* tsc value */ }; #define PMC_SAMPLE_FREE ((uint16_t) 0) @@ -1217,5 +1218,6 @@ int pmc_save_user_callchain(uintptr_t *_cc, int _maxsa struct pmc_mdep *pmc_mdep_alloc(int nclasses); void pmc_mdep_free(struct pmc_mdep *md); void pmc_flush_samples(int cpu); +uint64_t pmc_rdtsc(void); #endif /* _KERNEL */ #endif /* _SYS_PMC_H_ */ Modified: head/sys/sys/pmclog.h ============================================================================== --- head/sys/sys/pmclog.h Thu Jun 7 00:55:17 2018 (r334748) +++ head/sys/sys/pmclog.h Thu Jun 7 02:03:22 2018 (r334749) @@ -42,7 +42,7 @@ enum pmclog_type { PMCLOG_TYPE_CLOSELOG = 1, PMCLOG_TYPE_DROPNOTIFY = 2, PMCLOG_TYPE_INITIALIZE = 3, - PMCLOG_TYPE_MAPPINGCHANGE = 4, /* unused in v1 */ + PMCLOG_TYPE_PMCALLOCATE = 5, PMCLOG_TYPE_PMCATTACH = 6, PMCLOG_TYPE_PMCDETACH = 7, @@ -94,10 +94,13 @@ enum pmclog_type { */ #define PMCLOG_ENTRY_HEADER \ - uint32_t pl_header; \ - uint32_t pl_ts_sec; \ - uint32_t pl_ts_nsec; + uint32_t pl_header; \ + uint32_t pl_spare; \ + uint64_t pl_tsc; \ +struct pmclog_header { + PMCLOG_ENTRY_HEADER; +}; /* * The following structures are used to describe the size of each kind @@ -115,7 +118,6 @@ struct pmclog_callchain { uint32_t pl_tid; uint32_t pl_pmcid; uint32_t pl_cpuflags; - uint32_t pl_cpuflags2; /* 8 byte aligned */ uintptr_t pl_pc[PMC_CALLCHAIN_DEPTH_MAX]; } __packed; @@ -127,25 +129,25 @@ struct pmclog_callchain { struct pmclog_closelog { PMCLOG_ENTRY_HEADER - uint32_t pl_pad; }; struct pmclog_dropnotify { PMCLOG_ENTRY_HEADER - uint32_t pl_pad; }; struct pmclog_initialize { PMCLOG_ENTRY_HEADER uint32_t pl_version; /* driver version */ uint32_t pl_cpu; /* enum pmc_cputype */ - uint32_t pl_pad; + uint64_t pl_tsc_freq; + struct timespec pl_ts; char pl_cpuid[PMC_CPUID_LEN]; } __packed; struct pmclog_map_in { PMCLOG_ENTRY_HEADER uint32_t pl_pid; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 7 02:12:05 2018 Return-Path: Delivered-To: svn-src-head@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 14D02FEE6DB; Thu, 7 Jun 2018 02:12:05 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCA0D77815; Thu, 7 Jun 2018 02:12:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 7F2D3AF38; Thu, 7 Jun 2018 02:12:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f52.google.com with SMTP id p185-v6so10702759itp.4; Wed, 06 Jun 2018 19:12:04 -0700 (PDT) X-Gm-Message-State: APt69E1op67cIDYIBW9lo3oftOzJed5smVb5pHkxdTs126b1GiSjlS8C jCP8rQD3tizlw3UuEVhqIiPP5tSLyGhrZfL7VGE= X-Google-Smtp-Source: ADUXVKLZ99Kn95hWYSbVE3zKURJujeldlwhlkGVCKQMTGOrMKBHHKTiXdISsr94j55y3oR3U6RjmRr9gtQSHUuhyqZY= X-Received: by 2002:a24:459f:: with SMTP id c31-v6mr271584itd.132.1528337523243; Wed, 06 Jun 2018 19:12:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 19:12:02 -0700 (PDT) In-Reply-To: <20180606190353.GA80061@x2.osted.lan> References: <201805171759.w4HHxZpe069821@repo.freebsd.org> <20180606190353.GA80061@x2.osted.lan> From: Matthew Macy Date: Wed, 6 Jun 2018 19:12:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333744 - in head/sys: kern sys To: Peter Holm Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 02:12:05 -0000 On Wed, Jun 6, 2018 at 12:03 PM, Peter Holm wrote: > On Thu, May 17, 2018 at 05:59:35PM +0000, Matt Macy wrote: >> Author: mmacy >> Date: Thu May 17 17:59:35 2018 >> New Revision: 333744 >> URL: https://svnweb.freebsd.org/changeset/base/333744 >> >> Log: >> AF_UNIX: make unix socket locking finer grained >> >> This change moves to using a reference count across lock drop / reacquire >> to guarantee liveness. >> >> Currently sends on unix sockets contend heavily on read locking the list lock. >> unix1_processes in will-it-scale peaks at 6 processes and then declines. >> >> With this change I get a substantial improvement in number of operations per second >> with 96 processes: >> >> x before >> + after >> N Min Max Median Avg Stddev >> x 11 1688420 1696389 1693578 1692766.3 2971.1702 >> + 10 63417955 71030114 70662504 69576423 2374684.6 >> Difference at 95.0% confidence >> 6.78837e+07 +/- 1.49463e+06 >> 4010.22% +/- 88.4246% >> (Student's t, pooled s = 1.63437e+06) >> >> And even for 2 processes shows a ~18% improvement. >> "Small" iron changes (1, 2, and 4 processes): >> >> x before1 >> + after1.2 >> +------------------------------------------------------------------------+ >> | + | >> | x + | >> | x + | >> | x + | >> | x ++ | >> | xx ++ | >> |x x xx ++ | >> | |__________________A_____M_____AM____|| >> +------------------------------------------------------------------------+ >> N Min Max Median Avg Stddev >> x 10 1131648 1197750 1197138.5 1190369.3 20651.839 >> + 10 1203840 1205056 1204919 1204827.9 353.27404 >> Difference at 95.0% confidence >> 14458.6 +/- 13723 >> 1.21463% +/- 1.16683% >> (Student's t, pooled s = 14605.2) >> >> x before2 >> + after2.2 >> +------------------------------------------------------------------------+ >> | +| >> | +| >> | +| >> | +| >> | +| >> | +| >> | x +| >> | x +| >> | x xx +| >> |x xxxx +| >> | |___AM_| A| >> +------------------------------------------------------------------------+ >> N Min Max Median Avg Stddev >> x 10 1972843 2045866 2038186.5 2030443.8 21367.694 >> + 10 2400853 2402196 2401043.5 2401172.7 385.40024 >> Difference at 95.0% confidence >> 370729 +/- 14198.9 >> 18.2585% +/- 0.826943% >> (Student's t, pooled s = 15111.7) >> >> x before4 >> + after4.2 >> N Min Max Median Avg Stddev >> x 10 3986994 3991728 3990137.5 3989985.2 1300.0164 >> + 10 4799990 4806664 4806116.5 4805194 1990.6625 >> Difference at 95.0% confidence >> 815209 +/- 1579.64 >> 20.4314% +/- 0.0421713% >> (Student's t, pooled s = 1681.19) >> >> Tested by: pho >> Reported by: mjg >> Approved by: sbruno >> Sponsored by: Limelight Networks >> Differential Revision: https://reviews.freebsd.org/D15430 >> >> Modified: >> head/sys/kern/uipc_usrreq.c >> head/sys/sys/unpcb.h >> >> Modified: head/sys/kern/uipc_usrreq.c >> ============================================================================== >> --- head/sys/kern/uipc_usrreq.c Thu May 17 17:57:41 2018 (r333743) > > This commit seems to cause this: > > 20180606 20:44:37 all (1/1): datagram.sh > panic: _mtx_lock_sleep: recursed on non-recursive mutex unp_mtx @ ../../../kern/uipc_usrreq.c:354 > > cpuid = 91 > time = 1528310678 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f3a2bcd0 > vpanic() at vpanic+0x1a3/frame 0xfffffe00f3a2bd30 > doadump() at doadump/frame 0xfffffe00f3a2bdb0 > __mtx_lock_sleep() at __mtx_lock_sleep+0x49d/frame 0xfffffe00f3a2be30 > __mtx_lock_flags() at __mtx_lock_flags+0xf9/frame 0xfffffe00f3a2be80 > unp_connectat() at unp_connectat+0x2ec/frame 0xfffffe00f3a2c110 > soconnectat() at soconnectat+0xe8/frame 0xfffffe00f3a2c160 > kern_connectat() at kern_connectat+0x10f/frame 0xfffffe00f3a2c1c0 > sys_connect() at sys_connect+0x77/frame 0xfffffe00f3a2c200 > amd64_syscall() at amd64_syscall+0x2a7/frame 0xfffffe00f3a2c330 > fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00f3a2c330 > --- syscall (98, FreeBSD ELF64, sys_connect), rip = 0x80040081a, rsp = 0x7fffffffe2e8, rbp = 0x7fffffffe770 --- > KDB: enter: panic > [ thread pid 1276 tid 100966 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > db> x/s version > version: FreeBSD 12.0-CURRENT #0 r333744: Wed Jun 6 20:35:18 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 > db> I fixed this in 334175 and 334185. > > The stack trace is different on HEAD: > > panic: mutex unp not owned at ../../../kern/uipc_usrreq.c:879 > cpuid = 47 > time = 1528311629 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ee593ca0 > vpanic() at vpanic+0x1a3/frame 0xfffffe00ee593d00 > panic() at panic+0x43/frame 0xfffffe00ee593d60 > __mtx_assert() at __mtx_assert+0xb4/frame 0xfffffe00ee593d70 > uipc_disconnect() at uipc_disconnect+0x93/frame 0xfffffe00ee593dc0 > soclose() at soclose+0xa5/frame 0xfffffe00ee593e30 > closef() at closef+0x1f5/frame 0xfffffe00ee593ec0 > fdescfree_fds() at fdescfree_fds+0x90/frame 0xfffffe00ee593f10 > fdescfree() at fdescfree+0x480/frame 0xfffffe00ee593fd0 > exit1() at exit1+0x500/frame 0xfffffe00ee594040 > sigexit() at sigexit+0xae8/frame 0xfffffe00ee594220 > postsig() at postsig+0x1cf/frame 0xfffffe00ee5942f0 > ast() at ast+0x4b8/frame 0xfffffe00ee594330 > doreti_ast() at doreti_ast+0x1f/frame 0x7fffffffe760 > KDB: enter: panic > [ thread pid 1013 tid 100834 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > db> x/s version > version: FreeBSD 12.0-CURRENT #0 r334723: Wed Jun 6 20:53:32 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 > db> I'll take a look. -M From owner-svn-src-head@freebsd.org Thu Jun 7 02:14:16 2018 Return-Path: Delivered-To: svn-src-head@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 BAAB9FEE8B3; Thu, 7 Jun 2018 02:14:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EC3B77A45; Thu, 7 Jun 2018 02:14:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.20.12.186] (unknown [38.64.177.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 04E7DAF39; Thu, 7 Jun 2018 02:14:15 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Wed, 06 Jun 2018 22:14:14 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: Mateusz Guzik CC: Mateusz Guzik , src-committers , , Message-ID: <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 02:14:17 -0000 -----Original Message----- From: on behalf of Mateusz Guzik Date: 2018-06-06, Wednesday at 09:01 To: Ravi Pokala Cc: Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > >>> + * Passing the flag down requires malloc to blindly zero the entire object. >>> + * In practice a lot of the zeroing can be avoided if most of the object >>> + * gets explicitly initialized after the allocation. Letting the compiler >>> + * zero in place gives it the opportunity to take advantage of this state. >> >> This part, I still don't understand. :-( > > The call to bzero() is still for the full length passed in, so how does this help? > > bzero is: > #define bzero(buf, len) __builtin_memset((buf), 0, (len)) I'm afraid that doesn't answer my question; you're passing the full length to __builtin_memset() too. >>> ... >>> + * _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); >>> + * if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) >>> + * bzero(_malloc_item, _size); >>> + * >>> + * If the flag is set, the compiler knows the left side is always true, >>> + * therefore the entire statement is true and the callsite is: >> >> I think you mean "... the *right* side is always true ...", since the left side is the check for the flag being set. "If the flag is set, compiler knows (the check for the flag being set) is always true" is tautological. > > It explains how __builtin_constant_p(flags) being true allows the compiler > to optimize out the flags-based check. The __builtin_constant_p()s are in the conditional *before* the one I'm asking about. The test for M_WAITOK on the left being true, will cause the NULL-check on the right to be skipped because of the short-circuit semantics of binary ||. But because M_WAITOK is set, the NULL-check will pass anyway... Ah, and that's what you meant by "therefore the entire statement is true". I think the wording was throwing me; it might be clearer English to say something like "If the flag is set -- and we only get here if that can be determined at compile-time, because of __builtin_constant_p() -- then the entire statement is true. This skips the NULL-check, but it will always pass if the flag is set anyway." > I don't understand why this particular use runs into so much confusion. > Just above it there is a M_ZERO check relying on the same property and > receiving no attention. In that context, it's clearer what's the condition is: - "size" must be constant at compile-time - "flags" must be constant at compile-time - "flags" must have M_ZERO set >>> ... >>> + * If the flag is not set, the compiler knows the left size is always false >>> + * and the NULL check is needed, therefore the callsite is: >> >> Same issue here. And same answer here too. >>> ... >>> #ifdef _KERNEL >>> #define malloc(size, type, flags) ({ \ >> >> Now that I'm taking another look at this, I'm confused as to why the entire macro expansion is inside parentheses? (The braces make sense, since this is a block with local variables which need to be contained.) > > It is to return the value (the last expression). Yeah, Ben / Bruce / Conrad clarified that. >>> void *_malloc_item; \ >>> @@ -193,7 +228,8 @@ void *malloc(size_t size, struct malloc_type *type, in >>> if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ >>> ((flags) & M_ZERO) != 0) { \ >>> _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ >>> - if (((flags) & M_WAITOK) != 0 || _malloc_item != NULL) \ >>> + if (((flags) & M_WAITOK) != 0 || \ >>> + __predict_true(_malloc_item != NULL)) \ >>> bzero(_malloc_item, _size); \ >>> } else { \ >>> _malloc_item = malloc(_size, type, flags); \ >> >> This confuses me too. If the constant-size/constant-flags/M_ZERO-is-set test fails, then it falls down to calling malloc(). Which we are in the middle of defining. So what does that expand to? > > Expansion is not recursive, so this is an actual call to malloc. Ah, right. I swear I knew that at some point. :-) > -- > Mateusz Guzik > Thanks Mateusz, -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Thu Jun 7 02:20:28 2018 Return-Path: Delivered-To: svn-src-head@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 979EBFEED1F; Thu, 7 Jun 2018 02:20:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B4077CF3; Thu, 7 Jun 2018 02:20:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 259BC19D48; Thu, 7 Jun 2018 02:20:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w572KSjA098946; Thu, 7 Jun 2018 02:20:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w572KSSp098945; Thu, 7 Jun 2018 02:20:28 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070220.w572KSSp098945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 02:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334750 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 02:20:28 -0000 Author: mmacy Date: Thu Jun 7 02:20:27 2018 New Revision: 334750 URL: https://svnweb.freebsd.org/changeset/base/334750 Log: hwpmc: don't do EMIT64 on constant Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Thu Jun 7 02:03:22 2018 (r334749) +++ head/sys/dev/hwpmc/hwpmc_logging.c Thu Jun 7 02:20:27 2018 (r334750) @@ -739,7 +739,8 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o PMCLOG_EMIT64(tsc_freq); #else /* other architectures will need to fill this in */ - PMCLOG_EMIT64(0); + PMCLOG_EMIT32(0); + PMCLOG_EMIT32(0); #endif memcpy(_le, &ts, sizeof(ts)); _le += sizeof(ts)/4; From owner-svn-src-head@freebsd.org Thu Jun 7 02:54:13 2018 Return-Path: Delivered-To: svn-src-head@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 EBD65FF0B28; Thu, 7 Jun 2018 02:54:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88B727916B; Thu, 7 Jun 2018 02:54:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B3B91A448; Thu, 7 Jun 2018 02:54:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w572sCmR018462; Thu, 7 Jun 2018 02:54:12 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w572sC76018461; Thu, 7 Jun 2018 02:54:12 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201806070254.w572sC76018461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 7 Jun 2018 02:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334752 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 02:54:13 -0000 Author: alc Date: Thu Jun 7 02:54:11 2018 New Revision: 334752 URL: https://svnweb.freebsd.org/changeset/base/334752 Log: pidctrl_daemon() implements a variation on the classical, discrete PID controller that tries to handle early invocations of the controller, in other words, invocations before the expected end of the interval. However, there were some calculation errors in this early invocation case. Notably, if an early invocation occurred while the error was negative, the derivative term was off by a large amount. One visible effect of this error was that processes were being killed by the virtual memory system's OOM killer when in fact there was plentiful free memory. Correct a couple minor errors in the sysctl descriptions, and apply some style fixes. Reviewed by: jeff, markj Modified: head/sys/kern/subr_pidctrl.c Modified: head/sys/kern/subr_pidctrl.c ============================================================================== --- head/sys/kern/subr_pidctrl.c Thu Jun 7 02:30:48 2018 (r334751) +++ head/sys/kern/subr_pidctrl.c Thu Jun 7 02:54:11 2018 (r334752) @@ -59,14 +59,14 @@ pidctrl_init_sysctl(struct pidctrl *pc, struct sysctl_ &pc->pc_olderror, 0, "Error value from last interval"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "integral", CTLFLAG_RD, &pc->pc_integral, 0, "Accumulated error integral (I)"); - SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "derivative", - CTLFLAG_RD, &pc->pc_derivative, 0, "Error derivative (I)"); + SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "derivative", CTLFLAG_RD, + &pc->pc_derivative, 0, "Error derivative (D)"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "input", CTLFLAG_RD, &pc->pc_input, 0, "Last controller process variable input"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "output", CTLFLAG_RD, &pc->pc_output, 0, "Last controller output"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "ticks", CTLFLAG_RD, - &pc->pc_ticks, 0, "Last controler runtime"); + &pc->pc_ticks, 0, "Last controller runtime"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "setpoint", CTLFLAG_RW, &pc->pc_setpoint, 0, "Desired level for process variable"); SYSCTL_ADD_INT(NULL, parent, OID_AUTO, "interval", CTLFLAG_RD, @@ -96,21 +96,20 @@ pidctrl_classic(struct pidctrl *pc, int input) Kid = MAX(pc->pc_Kid, 1); Kdd = MAX(pc->pc_Kdd, 1); - /* Compute P (proportional error), I (integral), D (derivative) */ + /* Compute P (proportional error), I (integral), D (derivative). */ pc->pc_error = error; pc->pc_integral = MAX(MIN(pc->pc_integral + error, pc->pc_bound), -pc->pc_bound); pc->pc_derivative = error - pc->pc_olderror; /* Divide by inverse gain values to produce output. */ - output = ((pc->pc_error / Kpd) + - (pc->pc_integral / Kid)) + + output = (pc->pc_error / Kpd) + (pc->pc_integral / Kid) + (pc->pc_derivative / Kdd); /* Save for sysctl. */ pc->pc_output = output; pc->pc_input = input; - return output; + return (output); } int @@ -121,17 +120,18 @@ pidctrl_daemon(struct pidctrl *pc, int input) error = pc->pc_setpoint - input; /* - * When ticks expired we reset our variables and start a new + * When ticks expires we reset our variables and start a new * interval. If we're called multiple times during one interval * we attempt to report a target as if the entire error came at * the interval boundary. */ - if ((u_int)(ticks - pc->pc_ticks) >= pc->pc_interval) { + if ((u_int)ticks - pc->pc_ticks >= pc->pc_interval) { pc->pc_ticks = ticks; pc->pc_olderror = pc->pc_error; pc->pc_output = pc->pc_error = 0; } else { - error = MAX(error + pc->pc_error, 0); + /* Calculate the error relative to the last call. */ + error -= pc->pc_error - pc->pc_output; } /* Fetch gains and prevent divide by zero. */ @@ -139,19 +139,19 @@ pidctrl_daemon(struct pidctrl *pc, int input) Kid = MAX(pc->pc_Kid, 1); Kdd = MAX(pc->pc_Kdd, 1); - /* Compute P (proportional error), I (integral), D (derivative) */ - pc->pc_error = error; + /* Compute P (proportional error), I (integral), D (derivative). */ + pc->pc_error += error; pc->pc_integral = MAX(MIN(pc->pc_integral + error, pc->pc_bound), 0); - pc->pc_derivative = error - pc->pc_olderror; + pc->pc_derivative = pc->pc_error - pc->pc_olderror; /* Divide by inverse gain values to produce output. */ - output = ((error / Kpd) + - (pc->pc_integral / Kid)) + + output = (error / Kpd) + (pc->pc_integral / Kid) + (pc->pc_derivative / Kdd); output = MAX(output - pc->pc_output, 0); + /* Save for sysctl. */ pc->pc_output += output; pc->pc_input = input; - return output; + return (output); } From owner-svn-src-head@freebsd.org Thu Jun 7 03:00:00 2018 Return-Path: Delivered-To: svn-src-head@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 98388FF1096; Thu, 7 Jun 2018 03:00:00 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) (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 212B07936C; Thu, 7 Jun 2018 02:58:28 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f50.google.com with SMTP id r125-v6so15567405wmg.2; Wed, 06 Jun 2018 19:58:27 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AFHrg6D4w2yjk+3sJKDCXujRedTDBCBQ7ZqzdhSWe4Q=; b=FlS8XH1NKpILYU8N3j0noZEJar67w0onHKPD+9VUdaKAfJjdFVQgzgcbm49VsOZqtF FJqQibbhCh529JAUwtfwv0yTVTT9VqW79a0PGXoOShg7cZfZHrms57m5doPg7UXrH0FF p2Ih5PKqre3e0N/jXjlPKiOqnhmpthYYvoh//umJdHR9GHLzCMwbA+3mRExFbEFlVKEN v3rqydJZyeb6pUENuUZF3Qhlqwl1AKcnsQP6yjpeN7FaD0kfbFDW1GguXvjt+gzVCqvD Im2qsZn1kSZd+N3Mb8lbojOXAqizZYd16tF6G1/tJ2xRnW26QLJMEhj24K8Uum97WVOJ I3kA== X-Gm-Message-State: APt69E0/3Dl+0nBnRJBZaXbDovsZyhaR0CHYnb7XizgCAPEy3MhRyayj vr9rQVnTKnQcyz5Webg7K/s0zkM/XgY= X-Google-Smtp-Source: ADUXVKLNQMLT9NiDZQAj2hZIXKm9An9WQDDBpEbTOCgftfI0r2F5c0cYPoWwymjaMyNTA/TXbrq8RQ== X-Received: by 2002:aa7:d419:: with SMTP id z25-v6mr460209edq.203.1528340306897; Wed, 06 Jun 2018 19:58:26 -0700 (PDT) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id h2-v6sm3907865edq.6.2018.06.06.19.58.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 19:58:26 -0700 (PDT) Received: by mail-wr0-f176.google.com with SMTP id f16-v6so8327446wrm.3; Wed, 06 Jun 2018 19:58:26 -0700 (PDT) X-Received: by 2002:adf:fb43:: with SMTP id c3-v6mr59330wrs.32.1528340306578; Wed, 06 Jun 2018 19:58:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:98e2:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 19:58:26 -0700 (PDT) In-Reply-To: <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> From: "Jonathan T. Looney" Date: Wed, 6 Jun 2018 22:58:26 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334702 - head/sys/sys To: Ravi Pokala Cc: Mateusz Guzik , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 03:00:00 -0000 On Wed, Jun 6, 2018 at 10:14 PM, Ravi Pokala wrote: > > -----Original Message----- > From: on behalf of Mateusz Guzik < mjguzik@gmail.com> > Date: 2018-06-06, Wednesday at 09:01 > To: Ravi Pokala > Cc: Mateusz Guzik , src-committers < src-committers@freebsd.org>, , < svn-src-head@freebsd.org> > Subject: Re: svn commit: r334702 - head/sys/sys > > > On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote: > > > >>> + * Passing the flag down requires malloc to blindly zero the entire object. > >>> + * In practice a lot of the zeroing can be avoided if most of the object > >>> + * gets explicitly initialized after the allocation. Letting the compiler > >>> + * zero in place gives it the opportunity to take advantage of this state. > >> > >> This part, I still don't understand. :-( > > > > The call to bzero() is still for the full length passed in, so how does this help? > > > > bzero is: > > #define bzero(buf, len) __builtin_memset((buf), 0, (len)) > > I'm afraid that doesn't answer my question; you're passing the full length to __builtin_memset() too. I believe the theory is that the compiler (remember, this is __builtin_memset) can optimize away portions of the zeroing, or can optimize zeroing for small sizes. For example, imagine you do this: struct foo { uint32_t a; uint32_t b; }; struct foo * alloc_foo(void) { struct foo *rv; rv = malloc(sizeof(*rv), M_TMP, M_WAITOK|M_ZERO); rv->a = 1; rv->b = 2; return (rv); } In theory, the compiler can be smart enough to know that the entire structure is initialized, so it is not necessary to zero it. (I personally have not tested how well this works in practice. However, this change theoretically lets the compiler be smarter and optimize away unneeded work.) At minimum, it should let the compiler replace calls to memset() (and the loops there) with optimal instructions to zero the exact amount of memory that needs to be initialized. (Again, I haven't personally tested how smart the compilers we use are about producing optimal code in this situation.) Jonathan From owner-svn-src-head@freebsd.org Thu Jun 7 03:20:00 2018 Return-Path: Delivered-To: svn-src-head@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 B3CC7FF21F1; Thu, 7 Jun 2018 03:20:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A88317A29D; Thu, 7 Jun 2018 03:19:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A1901A86F; Thu, 7 Jun 2018 03:19:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w573JL3a029435; Thu, 7 Jun 2018 03:19:21 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w573JLAM029434; Thu, 7 Jun 2018 03:19:21 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070319.w573JLAM029434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 03:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334753 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 334753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 03:20:00 -0000 Author: mmacy Date: Thu Jun 7 03:19:21 2018 New Revision: 334753 URL: https://svnweb.freebsd.org/changeset/base/334753 Log: libpmc: add missed (uintmax_t) casts Modified: head/lib/libpmc/libpmc_json.cc (contents, props changed) Modified: head/lib/libpmc/libpmc_json.cc ============================================================================== --- head/lib/libpmc/libpmc_json.cc Thu Jun 7 02:54:11 2018 (r334752) +++ head/lib/libpmc/libpmc_json.cc Thu Jun 7 03:19:21 2018 (r334753) @@ -75,7 +75,7 @@ startentry(struct pmclog_ev *ev) char eventbuf[128]; snprintf(eventbuf, sizeof(eventbuf), "%s, \"tsc\": \"%jd\"", - typenames[ev->pl_type], (intmax_t)ev->pl_ts.tv_sec); + typenames[ev->pl_type], (uintmax_t)ev->pl_ts.tv_sec); return (string(eventbuf)); } @@ -163,7 +163,7 @@ procexec_to_json(struct pmclog_ev *ev) "%s, \"pmcid\": \"0x%08x\", \"pid\": \"%d\", " "\"start\": \"0x%016jx\", \"pathname\": \"%s\"}\n", startent.c_str(), ev->pl_u.pl_x.pl_pmcid, ev->pl_u.pl_x.pl_pid, - ev->pl_u.pl_x.pl_entryaddr, ev->pl_u.pl_x.pl_pathname); + (uintmax_t)ev->pl_u.pl_x.pl_entryaddr, ev->pl_u.pl_x.pl_pathname); return string(eventbuf); } @@ -264,10 +264,10 @@ callchain_to_json(struct pmclog_ev *ev) ev->pl_u.pl_cc.pl_tid, ev->pl_u.pl_cc.pl_cpuflags, ev->pl_u.pl_cc.pl_cpuflags2); result = string(eventbuf); for (i = 0; i < ev->pl_u.pl_cc.pl_npc - 1; i++) { - snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\", ", ev->pl_u.pl_cc.pl_pc[i]); + snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\", ", (uintmax_t)ev->pl_u.pl_cc.pl_pc[i]); result += string(eventbuf); } - snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\"]}\n", ev->pl_u.pl_cc.pl_pc[i]); + snprintf(eventbuf, sizeof(eventbuf), "\"0x%016jx\"]}\n", (uintmax_t)ev->pl_u.pl_cc.pl_pc[i]); result += string(eventbuf); return (result); } From owner-svn-src-head@freebsd.org Thu Jun 7 04:01:02 2018 Return-Path: Delivered-To: svn-src-head@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 368D5FF45B9; Thu, 7 Jun 2018 04:01:02 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E20D7BC4B; Thu, 7 Jun 2018 04:01:02 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.20.12.186] (unknown [38.64.177.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 913C8B950; Thu, 7 Jun 2018 04:01:01 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Thu, 07 Jun 2018 00:01:00 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: "Jonathan T. Looney" CC: Mateusz Guzik , Mateusz Guzik , src-committers , , Message-ID: <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 04:01:02 -0000 > I believe the theory is that the compiler (remember, this is __builtin_me= mset) can optimize away portions of the zeroing, or can optimize zeroing for= small sizes. Ahhh! I didn't consider that the compiler would be doing analysis of the la= rger context, and potentially skipping zeroing parts that are set immediatel= y after the call. Thanks! -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: "Jonathan T. Looney" Date: 2018-06-06, Wednesday at 22:58 To: Ravi Pokala Cc: Mateusz Guzik , Mateusz Guzik , src= -committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Wed, Jun 6, 2018 at 10:14 PM, Ravi Pokala wrote: >> >> -----Original Message----- >> From: on behalf of Mateusz Guzik >> Date: 2018-06-06, Wednesday at 09:01 >> To: Ravi Pokala >> Cc: Mateusz Guzik , src-committers , , >> Subject: Re: svn commit: r334702 - head/sys/sys >> >>> On Wed, Jun 6, 2018 at 1:35 PM, Ravi Pokala wrote= : >>> >>>>> + * Passing the flag down requires malloc to blindly zero the entire = object. >>>>> + * In practice a lot of the zeroing can be avoided if most of the ob= ject >>>>> + * gets explicitly initialized after the allocation. Letting the com= piler >>>>> + * zero in place gives it the opportunity to take advantage of this = state. >>>> >>>> This part, I still don't understand. :-( >>> >>> The call to bzero() is still for the full length passed in, so how does= this help? >>> >>> bzero is: >>> #define bzero(buf, len) __builtin_memset((buf), 0, (len)) >>=20 >> I'm afraid that doesn't answer my question; you're passing the full leng= th to __builtin_memset() too. >=20 > I believe the theory is that the compiler (remember, this is __builtin_me= mset) can optimize away portions of the zeroing, or can optimize zeroing for= small sizes. >=20 > For example, imagine you do this: >=20 > struct foo { > uint32_t a; > uint32_t b; > }; >=20 > struct foo * > alloc_foo(void) > { > struct foo *rv; >=20 > rv =3D malloc(sizeof(*rv), M_TMP, M_WAITOK|M_ZERO); > rv->a =3D 1; > rv->b =3D 2; > return (rv); > } >=20 > In theory, the compiler can be smart enough to know that the entire struc= ture is initialized, so it is not necessary to zero it. >=20 > (I personally have not tested how well this works in practice. However, t= his change theoretically lets the compiler be smarter and optimize away unne= eded work.) >=20 > At minimum, it should let the compiler replace calls to memset() (and the= loops there) with optimal instructions to zero the exact amount of memory t= hat needs to be initialized. (Again, I haven't personally tested how smart t= he compilers we use are about producing optimal code in this situation.) >=20 > Jonathan From owner-svn-src-head@freebsd.org Thu Jun 7 04:03:00 2018 Return-Path: Delivered-To: svn-src-head@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 47238FF4759; Thu, 7 Jun 2018 04:03:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3D8D7BE40; Thu, 7 Jun 2018 04:02:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C68DA1B0A8; Thu, 7 Jun 2018 04:02:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57429aY050059; Thu, 7 Jun 2018 04:02:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57429U1050058; Thu, 7 Jun 2018 04:02:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806070402.w57429U1050058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 7 Jun 2018 04:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334754 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 334754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 04:03:00 -0000 Author: jhibbits Date: Thu Jun 7 04:02:09 2018 New Revision: 334754 URL: https://svnweb.freebsd.org/changeset/base/334754 Log: Print Maximum Data Transfer Size as a long rather than int PowerPC has PAGE_SIZE as a long, not an int. This causes the compiler to throw a format mismatch warning on this print. To work around the difference, print it as a long instead of an int, and force the argument to a long. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D15653 Modified: head/sbin/nvmecontrol/identify.c Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Thu Jun 7 03:19:21 2018 (r334753) +++ head/sbin/nvmecontrol/identify.c Thu Jun 7 04:02:09 2018 (r334754) @@ -119,7 +119,7 @@ print_controller(struct nvme_controller_data *cdata) if (cdata->mdts == 0) printf("Unlimited\n"); else - printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); + printf("%ld\n", PAGE_SIZE * (1L << cdata->mdts)); printf("Controller ID: 0x%02x\n", cdata->ctrlr_id); printf("Version: %d.%d.%d\n", (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, From owner-svn-src-head@freebsd.org Thu Jun 7 04:03:19 2018 Return-Path: Delivered-To: svn-src-head@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 D4390FF47DD; Thu, 7 Jun 2018 04:03:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88DAB7BFA9; Thu, 7 Jun 2018 04:03:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A1591B0CC; Thu, 7 Jun 2018 04:03:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5743Ja6053997; Thu, 7 Jun 2018 04:03:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5743J32053996; Thu, 7 Jun 2018 04:03:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806070403.w5743J32053996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 7 Jun 2018 04:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334755 - head/sbin X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sbin X-SVN-Commit-Revision: 334755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 04:03:20 -0000 Author: jhibbits Date: Thu Jun 7 04:03:19 2018 New Revision: 334755 URL: https://svnweb.freebsd.org/changeset/base/334755 Log: Build nvmecontrol on powerpc64 The nvme driver is compiled for powerpc64 already, and the one fix required to build nvmecontrol on powerpc64 was fixed in r334754. Modified: head/sbin/Makefile.powerpc64 Modified: head/sbin/Makefile.powerpc64 ============================================================================== --- head/sbin/Makefile.powerpc64 Thu Jun 7 04:02:09 2018 (r334754) +++ head/sbin/Makefile.powerpc64 Thu Jun 7 04:03:19 2018 (r334755) @@ -2,3 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += nvmecontrol From owner-svn-src-head@freebsd.org Thu Jun 7 04:57:41 2018 Return-Path: Delivered-To: svn-src-head@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 A54FDFF6B59; Thu, 7 Jun 2018 04:57:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55DF87DA4A; Thu, 7 Jun 2018 04:57:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 355B91B904; Thu, 7 Jun 2018 04:57:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w574vf2t078645; Thu, 7 Jun 2018 04:57:41 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w574vfKg078644; Thu, 7 Jun 2018 04:57:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806070457.w574vfKg078644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 7 Jun 2018 04:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334756 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 04:57:41 -0000 Author: mmacy Date: Thu Jun 7 04:57:40 2018 New Revision: 334756 URL: https://svnweb.freebsd.org/changeset/base/334756 Log: AF_UNIX: check for unp == unp2 on disconnect Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jun 7 04:03:19 2018 (r334755) +++ head/sys/kern/uipc_usrreq.c Thu Jun 7 04:57:40 2018 (r334756) @@ -872,21 +872,19 @@ uipc_disconnect(struct socket *so) UNP_PCB_UNLOCK(unp); return (0); } - if (unp == unp2) { - if (unp_pcb_rele(unp) == 0) + if (__predict_true(unp != unp2)) { + unp_pcb_owned_lock2(unp, unp2, freed); + if (__predict_false(freed)) { UNP_PCB_UNLOCK(unp); + return (0); + } + unp_pcb_hold(unp2); } - unp_pcb_owned_lock2(unp, unp2, freed); - if (__predict_false(freed)) { - UNP_PCB_UNLOCK(unp); - return (0); - } - unp_pcb_hold(unp2); unp_pcb_hold(unp); unp_disconnect(unp, unp2); if (unp_pcb_rele(unp) == 0) UNP_PCB_UNLOCK(unp); - if (unp_pcb_rele(unp2) == 0) + if ((unp != unp2) && unp_pcb_rele(unp2) == 0) UNP_PCB_UNLOCK(unp2); return (0); } From owner-svn-src-head@freebsd.org Thu Jun 7 05:02:01 2018 Return-Path: Delivered-To: svn-src-head@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 1FE1AFF6F14; Thu, 7 Jun 2018 05:02:01 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFE577DBEB; Thu, 7 Jun 2018 05:00:49 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id AA09CC055; Thu, 7 Jun 2018 05:00:49 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f173.google.com with SMTP id d185-v6so10344898ioe.0; Wed, 06 Jun 2018 22:00:49 -0700 (PDT) X-Gm-Message-State: APt69E1YBqrnWnofMNshIM362eZeRj29cod/CWYT+jcXAaHN4f2gLoSC a101SzDwE+9z6XOiJxq3anQlA24FGaEnAwKx/JA= X-Google-Smtp-Source: ADUXVKKtqhENWllmZYkhI6Tzf9BH5/XvIlaXjFSktmUzeC7Jr2Nti4bTjgvgs7evV6/jBPSHHaJnUWiZ9g5DtAO/1Uo= X-Received: by 2002:a6b:3b49:: with SMTP id i70-v6mr254455ioa.133.1528347648805; Wed, 06 Jun 2018 22:00:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 22:00:48 -0700 (PDT) In-Reply-To: References: <201805171759.w4HHxZpe069821@repo.freebsd.org> <20180606190353.GA80061@x2.osted.lan> From: Matthew Macy Date: Wed, 6 Jun 2018 22:00:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333744 - in head/sys: kern sys To: Peter Holm Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 05:02:01 -0000 Try r334756 and then send me your scripts for any panics you can produce. -M On Wed, Jun 6, 2018 at 7:12 PM, Matthew Macy wrote: > On Wed, Jun 6, 2018 at 12:03 PM, Peter Holm wrote: >> On Thu, May 17, 2018 at 05:59:35PM +0000, Matt Macy wrote: >>> Author: mmacy >>> Date: Thu May 17 17:59:35 2018 >>> New Revision: 333744 >>> URL: https://svnweb.freebsd.org/changeset/base/333744 >>> >>> Log: >>> AF_UNIX: make unix socket locking finer grained >>> >>> This change moves to using a reference count across lock drop / reacquire >>> to guarantee liveness. >>> >>> Currently sends on unix sockets contend heavily on read locking the list lock. >>> unix1_processes in will-it-scale peaks at 6 processes and then declines. >>> >>> With this change I get a substantial improvement in number of operations per second >>> with 96 processes: >>> >>> x before >>> + after >>> N Min Max Median Avg Stddev >>> x 11 1688420 1696389 1693578 1692766.3 2971.1702 >>> + 10 63417955 71030114 70662504 69576423 2374684.6 >>> Difference at 95.0% confidence >>> 6.78837e+07 +/- 1.49463e+06 >>> 4010.22% +/- 88.4246% >>> (Student's t, pooled s = 1.63437e+06) >>> >>> And even for 2 processes shows a ~18% improvement. >>> "Small" iron changes (1, 2, and 4 processes): >>> >>> x before1 >>> + after1.2 >>> +------------------------------------------------------------------------+ >>> | + | >>> | x + | >>> | x + | >>> | x + | >>> | x ++ | >>> | xx ++ | >>> |x x xx ++ | >>> | |__________________A_____M_____AM____|| >>> +------------------------------------------------------------------------+ >>> N Min Max Median Avg Stddev >>> x 10 1131648 1197750 1197138.5 1190369.3 20651.839 >>> + 10 1203840 1205056 1204919 1204827.9 353.27404 >>> Difference at 95.0% confidence >>> 14458.6 +/- 13723 >>> 1.21463% +/- 1.16683% >>> (Student's t, pooled s = 14605.2) >>> >>> x before2 >>> + after2.2 >>> +------------------------------------------------------------------------+ >>> | +| >>> | +| >>> | +| >>> | +| >>> | +| >>> | +| >>> | x +| >>> | x +| >>> | x xx +| >>> |x xxxx +| >>> | |___AM_| A| >>> +------------------------------------------------------------------------+ >>> N Min Max Median Avg Stddev >>> x 10 1972843 2045866 2038186.5 2030443.8 21367.694 >>> + 10 2400853 2402196 2401043.5 2401172.7 385.40024 >>> Difference at 95.0% confidence >>> 370729 +/- 14198.9 >>> 18.2585% +/- 0.826943% >>> (Student's t, pooled s = 15111.7) >>> >>> x before4 >>> + after4.2 >>> N Min Max Median Avg Stddev >>> x 10 3986994 3991728 3990137.5 3989985.2 1300.0164 >>> + 10 4799990 4806664 4806116.5 4805194 1990.6625 >>> Difference at 95.0% confidence >>> 815209 +/- 1579.64 >>> 20.4314% +/- 0.0421713% >>> (Student's t, pooled s = 1681.19) >>> >>> Tested by: pho >>> Reported by: mjg >>> Approved by: sbruno >>> Sponsored by: Limelight Networks >>> Differential Revision: https://reviews.freebsd.org/D15430 >>> >>> Modified: >>> head/sys/kern/uipc_usrreq.c >>> head/sys/sys/unpcb.h >>> >>> Modified: head/sys/kern/uipc_usrreq.c >>> ============================================================================== >>> --- head/sys/kern/uipc_usrreq.c Thu May 17 17:57:41 2018 (r333743) >> >> This commit seems to cause this: >> >> 20180606 20:44:37 all (1/1): datagram.sh >> panic: _mtx_lock_sleep: recursed on non-recursive mutex unp_mtx @ ../../../kern/uipc_usrreq.c:354 >> >> cpuid = 91 >> time = 1528310678 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f3a2bcd0 >> vpanic() at vpanic+0x1a3/frame 0xfffffe00f3a2bd30 >> doadump() at doadump/frame 0xfffffe00f3a2bdb0 >> __mtx_lock_sleep() at __mtx_lock_sleep+0x49d/frame 0xfffffe00f3a2be30 >> __mtx_lock_flags() at __mtx_lock_flags+0xf9/frame 0xfffffe00f3a2be80 >> unp_connectat() at unp_connectat+0x2ec/frame 0xfffffe00f3a2c110 >> soconnectat() at soconnectat+0xe8/frame 0xfffffe00f3a2c160 >> kern_connectat() at kern_connectat+0x10f/frame 0xfffffe00f3a2c1c0 >> sys_connect() at sys_connect+0x77/frame 0xfffffe00f3a2c200 >> amd64_syscall() at amd64_syscall+0x2a7/frame 0xfffffe00f3a2c330 >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00f3a2c330 >> --- syscall (98, FreeBSD ELF64, sys_connect), rip = 0x80040081a, rsp = 0x7fffffffe2e8, rbp = 0x7fffffffe770 --- >> KDB: enter: panic >> [ thread pid 1276 tid 100966 ] >> Stopped at kdb_enter+0x3b: movq $0,kdb_why >> db> x/s version >> version: FreeBSD 12.0-CURRENT #0 r333744: Wed Jun 6 20:35:18 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 >> db> > > > I fixed this in 334175 and 334185. > >> >> The stack trace is different on HEAD: >> >> panic: mutex unp not owned at ../../../kern/uipc_usrreq.c:879 >> cpuid = 47 >> time = 1528311629 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ee593ca0 >> vpanic() at vpanic+0x1a3/frame 0xfffffe00ee593d00 >> panic() at panic+0x43/frame 0xfffffe00ee593d60 >> __mtx_assert() at __mtx_assert+0xb4/frame 0xfffffe00ee593d70 >> uipc_disconnect() at uipc_disconnect+0x93/frame 0xfffffe00ee593dc0 >> soclose() at soclose+0xa5/frame 0xfffffe00ee593e30 >> closef() at closef+0x1f5/frame 0xfffffe00ee593ec0 >> fdescfree_fds() at fdescfree_fds+0x90/frame 0xfffffe00ee593f10 >> fdescfree() at fdescfree+0x480/frame 0xfffffe00ee593fd0 >> exit1() at exit1+0x500/frame 0xfffffe00ee594040 >> sigexit() at sigexit+0xae8/frame 0xfffffe00ee594220 >> postsig() at postsig+0x1cf/frame 0xfffffe00ee5942f0 >> ast() at ast+0x4b8/frame 0xfffffe00ee594330 >> doreti_ast() at doreti_ast+0x1f/frame 0x7fffffffe760 >> KDB: enter: panic >> [ thread pid 1013 tid 100834 ] >> Stopped at kdb_enter+0x3b: movq $0,kdb_why >> db> x/s version >> version: FreeBSD 12.0-CURRENT #0 r334723: Wed Jun 6 20:53:32 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 >> db> > > I'll take a look. > -M From owner-svn-src-head@freebsd.org Thu Jun 7 07:29:58 2018 Return-Path: Delivered-To: svn-src-head@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 998C6FD1C23; Thu, 7 Jun 2018 07:29:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4849A82019; Thu, 7 Jun 2018 07:29:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 40CCF15A4A; Thu, 7 Jun 2018 07:29:58 +0000 (UTC) Date: Thu, 7 Jun 2018 07:29:58 +0000 From: Alexey Dokuchaev To: Brad Davis Cc: rgrimes@FreeBSD.org, src-committers , Kyle Evans , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Eugene Grosbein Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607072958.GA51308@FreeBSD.org> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:29:58 -0000 On Wed, Jun 06, 2018 at 01:02:25PM -0600, Brad Davis wrote: > On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: > > ... > > So each installworld would wipe over the top of any localmod /etc/rc.d/ > > and other stuff that mght exist? > > One of the reasons that etc/Makefile is detached from Installword is so > > that /etc does not get perturbuted unless specifically requested. > > Yes, this is by design. > > If people need custom tweaks for that stuff they should be upstreamed or > moved into /usr/local/etc/rc.d as a custom startup script. This is rather questionable design to me. I don't consider my scripts as binaries and like them in /etc/rc.d/ and managed via mergemaster -Fi. Everything was perfectly fine with it. What exactly the problem you're trying to solve here? ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 07:48:51 2018 Return-Path: Delivered-To: svn-src-head@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 1EF42FD3DD9; Thu, 7 Jun 2018 07:48:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB7448391F; Thu, 7 Jun 2018 07:48:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA311D472; Thu, 7 Jun 2018 07:48:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577mojR062345; Thu, 7 Jun 2018 07:48:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577mopW062344; Thu, 7 Jun 2018 07:48:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201806070748.w577mopW062344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 7 Jun 2018 07:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334769 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:48:51 -0000 Author: alc Date: Thu Jun 7 07:48:50 2018 New Revision: 334769 URL: https://svnweb.freebsd.org/changeset/base/334769 Log: When pidctrl_daemon() is called multiple times within an interval, it should use the cumulative error to calculate the output. Modified: head/sys/kern/subr_pidctrl.c Modified: head/sys/kern/subr_pidctrl.c ============================================================================== --- head/sys/kern/subr_pidctrl.c Thu Jun 7 07:48:26 2018 (r334768) +++ head/sys/kern/subr_pidctrl.c Thu Jun 7 07:48:50 2018 (r334769) @@ -146,7 +146,7 @@ pidctrl_daemon(struct pidctrl *pc, int input) pc->pc_derivative = pc->pc_error - pc->pc_olderror; /* Divide by inverse gain values to produce output. */ - output = (error / Kpd) + (pc->pc_integral / Kid) + + output = (pc->pc_error / Kpd) + (pc->pc_integral / Kid) + (pc->pc_derivative / Kdd); output = MAX(output - pc->pc_output, 0); /* Save for sysctl. */ From owner-svn-src-head@freebsd.org Thu Jun 7 10:06:00 2018 Return-Path: Delivered-To: svn-src-head@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 54B1BFDEE39; Thu, 7 Jun 2018 10:06:00 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 6775688AA8; Thu, 7 Jun 2018 10:04:49 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 9D508D00B50; Thu, 7 Jun 2018 06:04:48 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.15.2/8.15.2) with ESMTPS id w57A4keO096881 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Jun 2018 12:04:46 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.15.2/8.15.2/Submit) id w57A4kk6096880; Thu, 7 Jun 2018 12:04:46 +0200 (CEST) (envelope-from pho) Date: Thu, 7 Jun 2018 12:04:45 +0200 From: Peter Holm To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333744 - in head/sys: kern sys Message-ID: <20180607100445.GA96827@x2.osted.lan> References: <201805171759.w4HHxZpe069821@repo.freebsd.org> <20180606190353.GA80061@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 10:06:00 -0000 On Wed, Jun 06, 2018 at 10:00:48PM -0700, Matthew Macy wrote: > Try r334756 and then send me your scripts for any panics you can produce. > The datagram test now runs without issues. I ran the few (40) network test I have, without finding any problems. - Peter > -M > > On Wed, Jun 6, 2018 at 7:12 PM, Matthew Macy wrote: > > On Wed, Jun 6, 2018 at 12:03 PM, Peter Holm wrote: > >> On Thu, May 17, 2018 at 05:59:35PM +0000, Matt Macy wrote: > >>> Author: mmacy > >>> Date: Thu May 17 17:59:35 2018 > >>> New Revision: 333744 > >>> URL: https://svnweb.freebsd.org/changeset/base/333744 > >>> > >>> Log: > >>> AF_UNIX: make unix socket locking finer grained > >>> > >>> This change moves to using a reference count across lock drop / reacquire > >>> to guarantee liveness. > >>> > >>> Currently sends on unix sockets contend heavily on read locking the list lock. > >>> unix1_processes in will-it-scale peaks at 6 processes and then declines. > >>> > >>> With this change I get a substantial improvement in number of operations per second > >>> with 96 processes: > >>> > >>> x before > >>> + after > >>> N Min Max Median Avg Stddev > >>> x 11 1688420 1696389 1693578 1692766.3 2971.1702 > >>> + 10 63417955 71030114 70662504 69576423 2374684.6 > >>> Difference at 95.0% confidence > >>> 6.78837e+07 +/- 1.49463e+06 > >>> 4010.22% +/- 88.4246% > >>> (Student's t, pooled s = 1.63437e+06) > >>> > >>> And even for 2 processes shows a ~18% improvement. > >>> "Small" iron changes (1, 2, and 4 processes): > >>> > >>> x before1 > >>> + after1.2 > >>> +------------------------------------------------------------------------+ > >>> | + | > >>> | x + | > >>> | x + | > >>> | x + | > >>> | x ++ | > >>> | xx ++ | > >>> |x x xx ++ | > >>> | |__________________A_____M_____AM____|| > >>> +------------------------------------------------------------------------+ > >>> N Min Max Median Avg Stddev > >>> x 10 1131648 1197750 1197138.5 1190369.3 20651.839 > >>> + 10 1203840 1205056 1204919 1204827.9 353.27404 > >>> Difference at 95.0% confidence > >>> 14458.6 +/- 13723 > >>> 1.21463% +/- 1.16683% > >>> (Student's t, pooled s = 14605.2) > >>> > >>> x before2 > >>> + after2.2 > >>> +------------------------------------------------------------------------+ > >>> | +| > >>> | +| > >>> | +| > >>> | +| > >>> | +| > >>> | +| > >>> | x +| > >>> | x +| > >>> | x xx +| > >>> |x xxxx +| > >>> | |___AM_| A| > >>> +------------------------------------------------------------------------+ > >>> N Min Max Median Avg Stddev > >>> x 10 1972843 2045866 2038186.5 2030443.8 21367.694 > >>> + 10 2400853 2402196 2401043.5 2401172.7 385.40024 > >>> Difference at 95.0% confidence > >>> 370729 +/- 14198.9 > >>> 18.2585% +/- 0.826943% > >>> (Student's t, pooled s = 15111.7) > >>> > >>> x before4 > >>> + after4.2 > >>> N Min Max Median Avg Stddev > >>> x 10 3986994 3991728 3990137.5 3989985.2 1300.0164 > >>> + 10 4799990 4806664 4806116.5 4805194 1990.6625 > >>> Difference at 95.0% confidence > >>> 815209 +/- 1579.64 > >>> 20.4314% +/- 0.0421713% > >>> (Student's t, pooled s = 1681.19) > >>> > >>> Tested by: pho > >>> Reported by: mjg > >>> Approved by: sbruno > >>> Sponsored by: Limelight Networks > >>> Differential Revision: https://reviews.freebsd.org/D15430 > >>> > >>> Modified: > >>> head/sys/kern/uipc_usrreq.c > >>> head/sys/sys/unpcb.h > >>> > >>> Modified: head/sys/kern/uipc_usrreq.c > >>> ============================================================================== > >>> --- head/sys/kern/uipc_usrreq.c Thu May 17 17:57:41 2018 (r333743) > >> > >> This commit seems to cause this: > >> > >> 20180606 20:44:37 all (1/1): datagram.sh > >> panic: _mtx_lock_sleep: recursed on non-recursive mutex unp_mtx @ ../../../kern/uipc_usrreq.c:354 > >> > >> cpuid = 91 > >> time = 1528310678 > >> KDB: stack backtrace: > >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f3a2bcd0 > >> vpanic() at vpanic+0x1a3/frame 0xfffffe00f3a2bd30 > >> doadump() at doadump/frame 0xfffffe00f3a2bdb0 > >> __mtx_lock_sleep() at __mtx_lock_sleep+0x49d/frame 0xfffffe00f3a2be30 > >> __mtx_lock_flags() at __mtx_lock_flags+0xf9/frame 0xfffffe00f3a2be80 > >> unp_connectat() at unp_connectat+0x2ec/frame 0xfffffe00f3a2c110 > >> soconnectat() at soconnectat+0xe8/frame 0xfffffe00f3a2c160 > >> kern_connectat() at kern_connectat+0x10f/frame 0xfffffe00f3a2c1c0 > >> sys_connect() at sys_connect+0x77/frame 0xfffffe00f3a2c200 > >> amd64_syscall() at amd64_syscall+0x2a7/frame 0xfffffe00f3a2c330 > >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00f3a2c330 > >> --- syscall (98, FreeBSD ELF64, sys_connect), rip = 0x80040081a, rsp = 0x7fffffffe2e8, rbp = 0x7fffffffe770 --- > >> KDB: enter: panic > >> [ thread pid 1276 tid 100966 ] > >> Stopped at kdb_enter+0x3b: movq $0,kdb_why > >> db> x/s version > >> version: FreeBSD 12.0-CURRENT #0 r333744: Wed Jun 6 20:35:18 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 > >> db> > > > > > > I fixed this in 334175 and 334185. > > > >> > >> The stack trace is different on HEAD: > >> > >> panic: mutex unp not owned at ../../../kern/uipc_usrreq.c:879 > >> cpuid = 47 > >> time = 1528311629 > >> KDB: stack backtrace: > >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ee593ca0 > >> vpanic() at vpanic+0x1a3/frame 0xfffffe00ee593d00 > >> panic() at panic+0x43/frame 0xfffffe00ee593d60 > >> __mtx_assert() at __mtx_assert+0xb4/frame 0xfffffe00ee593d70 > >> uipc_disconnect() at uipc_disconnect+0x93/frame 0xfffffe00ee593dc0 > >> soclose() at soclose+0xa5/frame 0xfffffe00ee593e30 > >> closef() at closef+0x1f5/frame 0xfffffe00ee593ec0 > >> fdescfree_fds() at fdescfree_fds+0x90/frame 0xfffffe00ee593f10 > >> fdescfree() at fdescfree+0x480/frame 0xfffffe00ee593fd0 > >> exit1() at exit1+0x500/frame 0xfffffe00ee594040 > >> sigexit() at sigexit+0xae8/frame 0xfffffe00ee594220 > >> postsig() at postsig+0x1cf/frame 0xfffffe00ee5942f0 > >> ast() at ast+0x4b8/frame 0xfffffe00ee594330 > >> doreti_ast() at doreti_ast+0x1f/frame 0x7fffffffe760 > >> KDB: enter: panic > >> [ thread pid 1013 tid 100834 ] > >> Stopped at kdb_enter+0x3b: movq $0,kdb_why > >> db> x/s version > >> version: FreeBSD 12.0-CURRENT #0 r334723: Wed Jun 6 20:53:32 CEST 2018\012 pho@flix1a.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 > >> db> > > > > I'll take a look. > > -M From owner-svn-src-head@freebsd.org Thu Jun 7 00:30:18 2018 Return-Path: Delivered-To: svn-src-head@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 F38D5FE93EE; Thu, 7 Jun 2018 00:30:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A030273992; Thu, 7 Jun 2018 00:30:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 5457DA439; Thu, 7 Jun 2018 00:30:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 9EA4A46628; Thu, 7 Jun 2018 02:29:45 +0200 (CEST) Date: Thu, 7 Jun 2018 02:29:45 +0200 From: Baptiste Daroussin To: Konstantin Belousov Cc: Ian Lepore , src-committers , Kyle Evans , svn-src-all@FreeBSD.org, Brad Davis , rgrimes@FreeBSD.org, svn-src-head@FreeBSD.org, Alexander Leidinger , Eugene Grosbein Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607002945.noqhxo6cjli7jayh@ivaldir.net> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <20180606202720.GD2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dr74blaw63tj45yp" Content-Disposition: inline In-Reply-To: <20180606202720.GD2450@kib.kiev.ua> User-Agent: NeoMutt/20180323 X-Mailman-Approved-At: Thu, 07 Jun 2018 10:30:30 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 00:30:18 -0000 --dr74blaw63tj45yp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 06, 2018 at 11:27:20PM +0300, Konstantin Belousov wrote: > On Wed, Jun 06, 2018 at 02:06:48PM -0600, Ian Lepore wrote: > > On Wed, 2018-06-06 at 11:33 -0700, Rodney W. Grimes wrote: > > > >=20 > > > >=20 > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > > >=20 > > > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > > >=20 > > > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > >=20 > > > > > > >=20 > > > > > > > >=20 > > > > > > > > >=20 > > > > > > > > > I find it often very useful to do > > > > > > > > > =A0(cd src/etc/rc.d && make install) > > > > > > > > > Same for defaults and several other directories which in > > > > > > > > > fact > > > > > > > > > contains> > >>> non-editable content.=A0=A0Is this planne= d to > > > > > > > > > keep working ? > > > > > > > > The short answer is, no.=A0=A0All rc.d scripts get moved to= the > > > > > > > > src > > > > > > > > of the program they start.> > >> > > > > > > > > That said, if there is a big need for this, we can see > > > > > > > > about > > > > > > > > options to keep them working.> > >> > > > > > > > > What are you trying to accomplish when you do this?=A0=A0Ju= st > > > > > > > > verify > > > > > > > > the rc.d scripts match your src tree?> > > > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and > > > > > > > /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable > > > > > > > to etc, they are > > > > > > > binaries> > > provided by the project not for the user > > > > > > > editing. > > > > > > >=20 > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh > > > > > > > scripts > > > > > > > by this> > > procedure and avoid any editing and implied > > > > > > > conflict resolution > > > > > > > for real> > > configs. > > > > > > >=20 > > > > > > > Not being able to easily install clean copies of these > > > > > > > scripts > > > > > > > would> > > be very inconvenient and time consuming. > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > > > including mentioned rc* scripts just fine.> > That is, it > > > > > > automatically refreshes unchanged files without any > > > > > > silly questions just for change of $FreeBSD$.> > > > > > No, you missed the point.=A0=A0Whatever nice is the handling of > > > > > unchanged files,> use of mergemaster forces me to handle changed > > > > > files, which is exactly> what I do not want/need to do.=A0=A0Yes,= I > > > > > update crashboxes very > > > > > often, and> I want to get all new code, including the startup > > > > > scripts, when > > > > > I update. > > > > The startup scripts will be installed as part of installworld. > > > So each installworld would wipe over the top of any localmod > > > /etc/rc.d/ and other stuff > > > that mght exist? > > > One of the reasons that etc/Makefile is detached from Installword is > > > so that > > > /etc does not get perturbuted unless specifically requested. > > >=20 > >=20 > > I don't understand the drama over this.=A0=A0rc.d startup scripts are > > *binaries*. Users are not expected to modify the system installed > > binaries, and if they do, it is expected that the next installworld > > will replace them with the system binaries again. >=20 > I agree with this, but the scripts are installed into /etc. >=20 > I proposed to move them somewhere, e.g. to /sbin/rc* or to /libexec/rc*. > If moved first, then the proposed change would be much more logical and > probably easier to fit into the workflows of FreeBSD consumers. IMHO would be a good idea! Bapt --dr74blaw63tj45yp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlsYfHUACgkQY4mL3PG3 PlqXIhAAqZu3mXLlJDWiVaRLk7YRiChPna4dEcQUjlgubzM0rdyPwob1/jxFsIul bIIvcB0iYgXLM1N3FRzzZheS4WwA66QpwPOLdyR/l86AuBSfVvxDuVziEhXNzELb 0o1zmuLL5vXZs+J+FodfXI/b5pksXhTzg4/TR+96t2GEiDq5AOozjdgzp4vGiV61 F4HzplGJCT2nQGD6Fh/nYH9IjaSBtiZDtJdUaFXo8lGELZsmcCzV6HF7+xOLmNcY yuEmmerHuEsXz6acAZGGwSlEL0wXKCR4rI4z+x8B38SvkSzDglSurtLnqc5+YR0w mc+8jeySl0rHMZHAAYLnBmH4DE8yrjTX3pjevl1SGxKa+3XyT75XA+NsSBa4wZ/Z LeS8XRkpqrNV+LbX5SEnVZgjI5Mcbavkh8jz4UnLLaSsyLZMtt5wIBRbRV82DftF /QyfZpqv235x8TKJN1P1V3wH+uI/aNevgy1Z7YbPSVSHbGS0Ajg1S3G8fgaUYA1N Ufi29OGtbQp0rwJ8xE7jqbWkjPXR6U1rl3ZXMLTJXUASUvBqqt6mS067nb88fkBV ID2u3I4AB8pGLW2JdGKAhJZTId2Tm3a5QuF0bZ14s98ZplbhTJ6EiCCDgWrK3MLc zqcZ38bGB7KrebxAhS9+11MeKvT9TEGv7ZbLK+sKFrchzZgoTe4= =TWMt -----END PGP SIGNATURE----- --dr74blaw63tj45yp-- From owner-svn-src-head@freebsd.org Thu Jun 7 11:27:01 2018 Return-Path: Delivered-To: svn-src-head@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 87603FE1E0D; Thu, 7 Jun 2018 11:27:01 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1BD8B6B2; Thu, 7 Jun 2018 11:25:37 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F2471F7CC; Thu, 7 Jun 2018 11:25:37 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57BPbOv070385; Thu, 7 Jun 2018 11:25:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57BPbEt070383; Thu, 7 Jun 2018 11:25:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806071125.w57BPbEt070383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 7 Jun 2018 11:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334773 - in head: share/man/man4 sys/modules X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: share/man/man4 sys/modules X-SVN-Commit-Revision: 334773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:27:01 -0000 Author: jhibbits Date: Thu Jun 7 11:25:36 2018 New Revision: 334773 URL: https://svnweb.freebsd.org/changeset/base/334773 Log: Build nvme modules for powerpc, and install man pages NVMe builds for powerpc now, so just build modules for all powerpc targets, and install NVMe man pages for all powerpc targets. Modified: head/share/man/man4/Makefile head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jun 7 10:58:48 2018 (r334772) +++ head/share/man/man4/Makefile Thu Jun 7 11:25:36 2018 (r334773) @@ -888,6 +888,11 @@ _vmm.4= vmm.4 _nvram2env.4= nvram2env.4 .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_nvd.4= nvd.4 +_nvme.4= nvme.4 +.endif + .if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" _bcm283x_pwm.4= bcm283x_pwm.4 .endif Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Jun 7 10:58:48 2018 (r334772) +++ head/sys/modules/Makefile Thu Jun 7 11:25:36 2018 (r334773) @@ -781,6 +781,8 @@ _cpufreq= cpufreq _drm= drm _exca= exca _ffec= ffec +_nvd= nvd +_nvme= nvme _pccard= pccard _wi= wi .endif From owner-svn-src-head@freebsd.org Thu Jun 7 11:29:08 2018 Return-Path: Delivered-To: svn-src-head@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 7D1AFFE1FE6; Thu, 7 Jun 2018 11:29:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27E1D8B950; Thu, 7 Jun 2018 11:29:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00AD11F7E5; Thu, 7 Jun 2018 11:29:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57BT7UZ070526; Thu, 7 Jun 2018 11:29:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57BT70j070525; Thu, 7 Jun 2018 11:29:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806071129.w57BT70j070525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 11:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334774 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:29:08 -0000 Author: hselasky Date: Thu Jun 7 11:29:07 2018 New Revision: 334774 URL: https://svnweb.freebsd.org/changeset/base/334774 Log: Implement the dev_pm_set_driver_flags() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Thu Jun 7 11:25:36 2018 (r334773) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Thu Jun 7 11:29:07 2018 (r334774) @@ -461,6 +461,9 @@ device_destroy(struct class *class, dev_t devt) device_unregister(device_get_softc(bsddev)); } +#define dev_pm_set_driver_flags(dev, flags) do { \ +} while (0) + static inline void linux_class_kfree(struct class *class) { From owner-svn-src-head@freebsd.org Thu Jun 7 07:33:29 2018 Return-Path: Delivered-To: svn-src-head@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 CAE6FFD3060; Thu, 7 Jun 2018 07:33:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F379825CC; Thu, 7 Jun 2018 07:33:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5E5A815D7E; Thu, 7 Jun 2018 07:33:29 +0000 (UTC) Date: Thu, 7 Jun 2018 07:33:29 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: Ian Lepore , src-committers , Kyle Evans , svn-src-all@FreeBSD.org, Brad Davis , rgrimes@FreeBSD.org, svn-src-head@FreeBSD.org, Alexander Leidinger , Eugene Grosbein Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607073329.GB51308@FreeBSD.org> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <20180606202720.GD2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606202720.GD2450@kib.kiev.ua> User-Agent: Mutt/1.9.5 (2018-04-13) X-Mailman-Approved-At: Thu, 07 Jun 2018 11:31:52 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:33:30 -0000 On Wed, Jun 06, 2018 at 11:27:20PM +0300, Konstantin Belousov wrote: > On Wed, Jun 06, 2018 at 02:06:48PM -0600, Ian Lepore wrote: > > ... > > I don't understand the drama over this. rc.d startup scripts are > > *binaries*. No, they are not, they are scripts. > I proposed to move them somewhere, e.g. to /sbin/rc* or to /libexec/rc*. Please don't. Our huge selling point (vs. most GNU/Linux distros) is that everything is *not* spread across the entire hier(7) like butter on bread. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 11:35:01 2018 Return-Path: Delivered-To: svn-src-head@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 1BA05FE25C8; Thu, 7 Jun 2018 11:35:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E68378BF52; Thu, 7 Jun 2018 11:35:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B00B51F974; Thu, 7 Jun 2018 11:35:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57BZ0p1075112; Thu, 7 Jun 2018 11:35:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57BZ0Jb075110; Thu, 7 Jun 2018 11:35:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806071135.w57BZ0Jb075110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 11:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334775 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:35:01 -0000 Author: hselasky Date: Thu Jun 7 11:34:59 2018 New Revision: 334775 URL: https://svnweb.freebsd.org/changeset/base/334775 Log: Move the EXPORT_SYMBOL_XXX() function macros into own header file. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Added: head/sys/compat/linuxkpi/common/include/linux/export.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/linux/module.h Added: head/sys/compat/linuxkpi/common/include/linux/export.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/export.h Thu Jun 7 11:34:59 2018 (r334775) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2018 Johannes Lundberg + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_EXPORT_H +#define _LINUX_EXPORT_H + +#define EXPORT_SYMBOL(name) +#define EXPORT_SYMBOL_GPL(name) + +#endif Modified: head/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/module.h Thu Jun 7 11:29:07 2018 (r334774) +++ head/sys/compat/linuxkpi/common/include/linux/module.h Thu Jun 7 11:34:59 2018 (r334775) @@ -42,6 +42,7 @@ #include #include #include +#include #define MODULE_AUTHOR(name) #define MODULE_DESCRIPTION(name) @@ -51,8 +52,6 @@ #define THIS_MODULE ((struct module *)0) -#define EXPORT_SYMBOL(name) -#define EXPORT_SYMBOL_GPL(name) #define __MODULE_STRING(x) __stringify(x) /* OFED pre-module initialization */ From owner-svn-src-head@freebsd.org Thu Jun 7 11:35:46 2018 Return-Path: Delivered-To: svn-src-head@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 0FA28FE26E0; Thu, 7 Jun 2018 11:35:46 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4B718C0BE; Thu, 7 Jun 2018 11:35:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id ACECA19D9B; Thu, 7 Jun 2018 11:35:45 +0000 (UTC) Date: Thu, 7 Jun 2018 11:35:45 +0000 From: Alexey Dokuchaev To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607113545.GA77085@FreeBSD.org> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <20180606202720.GD2450@kib.kiev.ua> <20180607073329.GB51308@FreeBSD.org> <20180607131601.f53a86dec453dc07211f5691@bidouilliste.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607131601.f53a86dec453dc07211f5691@bidouilliste.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:35:46 -0000 [ CC list trimmed, was too long ] On Thu, Jun 07, 2018 at 01:16:01PM +0200, Emmanuel Vadot wrote: > On Thu, 7 Jun 2018 07:33:29 +0000 > Alexey Dokuchaev wrote: > > On Wed, Jun 06, 2018 at 11:27:20PM +0300, Konstantin Belousov wrote: > > > I proposed to move them somewhere, e.g. to /sbin/rc* or to /libexec/rc*. > > > > Please don't. Our huge selling point (vs. most GNU/Linux distros) is > > that everything is *not* spread across the entire hier(7) like butter > > on bread. > > Our huge selling point is startup scripts in /etc/rc.d ? Damn, we suck > at marketing ... Please don't twist my words. I was talking about coherent, nicely put together configuration mechanisms and /etc layout in particular. This is contrast with GNU/Linux, where I typically have to traverse through gazillion of compatibility symlinks before stumbling upon 30-byte shim saying "implemented in systemd now". ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 11:41:44 2018 Return-Path: Delivered-To: svn-src-head@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 EC48AFE2AE9; Thu, 7 Jun 2018 11:41:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95DB98C5F2; Thu, 7 Jun 2018 11:41:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78C341FAE1; Thu, 7 Jun 2018 11:41:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57Bfh3B076325; Thu, 7 Jun 2018 11:41:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57BfhEe076323; Thu, 7 Jun 2018 11:41:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806071141.w57BfhEe076323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 11:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334777 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:41:44 -0000 Author: hselasky Date: Thu Jun 7 11:41:42 2018 New Revision: 334777 URL: https://svnweb.freebsd.org/changeset/base/334777 Log: Wrap timespec64 into timespec in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h head/sys/compat/linuxkpi/common/include/linux/time.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Jun 7 11:40:13 2018 (r334776) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Jun 7 11:41:42 2018 (r334777) @@ -159,6 +159,7 @@ timeval_to_ktime(struct timeval tv) } #define ktime_to_timespec(kt) ns_to_timespec(kt) +#define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) Modified: head/sys/compat/linuxkpi/common/include/linux/time.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/time.h Thu Jun 7 11:40:13 2018 (r334776) +++ head/sys/compat/linuxkpi/common/include/linux/time.h Thu Jun 7 11:41:42 2018 (r334777) @@ -35,6 +35,8 @@ #define USEC_PER_MSEC 1000L #define USEC_PER_SEC 1000000L +#define timespec64 timespec + #include #include From owner-svn-src-head@freebsd.org Thu Jun 7 11:46:00 2018 Return-Path: Delivered-To: svn-src-head@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 BD8E1FE2D48; Thu, 7 Jun 2018 11:46:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23A468C812; Thu, 7 Jun 2018 11:44:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04C4F1FB20; Thu, 7 Jun 2018 11:44:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57BiBAJ080354; Thu, 7 Jun 2018 11:44:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57BiBTA080353; Thu, 7 Jun 2018 11:44:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806071144.w57BiBTA080353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 11:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334778 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:46:00 -0000 Author: hselasky Date: Thu Jun 7 11:44:11 2018 New Revision: 334778 URL: https://svnweb.freebsd.org/changeset/base/334778 Log: Define ARCH_KMALLOC_MINALIGN in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Thu Jun 7 11:41:42 2018 (r334777) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Thu Jun 7 11:44:11 2018 (r334778) @@ -85,6 +85,9 @@ struct linux_kmem_cache { #define SLAB_DESTROY_BY_RCU \ SLAB_TYPESAFE_BY_RCU +#define ARCH_KMALLOC_MINALIGN \ + __alignof(unsigned long long) + static inline gfp_t linux_check_m_flags(gfp_t flags) { From owner-svn-src-head@freebsd.org Thu Jun 7 13:03:08 2018 Return-Path: Delivered-To: svn-src-head@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 41D05FE6DF8; Thu, 7 Jun 2018 13:03:08 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E79DA8F70B; Thu, 7 Jun 2018 13:03:07 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7FF4207E9; Thu, 7 Jun 2018 13:03:07 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57D37ww020738; Thu, 7 Jun 2018 13:03:07 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57D37Hq020737; Thu, 7 Jun 2018 13:03:07 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806071303.w57D37Hq020737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 7 Jun 2018 13:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334779 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 334779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:03:08 -0000 Author: erj Date: Thu Jun 7 13:03:07 2018 New Revision: 334779 URL: https://svnweb.freebsd.org/changeset/base/334779 Log: iflib: Record TCP checksum info in iflib when TCP checksum is requested ixl(4) (when it switches over to using iflib) devices need the TCP header length in order to do TCP checksum offload. Reviewed by: gallatin@, shurd@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D15558 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jun 7 11:44:11 2018 (r334778) +++ head/sys/net/iflib.c Thu Jun 7 13:03:07 2018 (r334779) @@ -2822,7 +2822,9 @@ print_pkt(if_pkt_info_t pi) #endif #define IS_TSO4(pi) ((pi)->ipi_csum_flags & CSUM_IP_TSO) +#define IS_TX_OFFLOAD4(pi) ((pi)->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP_TSO)) #define IS_TSO6(pi) ((pi)->ipi_csum_flags & CSUM_IP6_TSO) +#define IS_TX_OFFLOAD6(pi) ((pi)->ipi_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_TSO)) static int iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) @@ -2908,8 +2910,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) ip->ip_sum = 0; - if (IS_TSO4(pi)) { - if (pi->ipi_ipproto == IPPROTO_TCP) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD4(pi)) { + if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { if (__predict_false(th == NULL)) { txq->ift_pullups++; if (__predict_false((m = m_pullup(m, (ip->ip_hl << 2) + sizeof(*th))) == NULL)) @@ -2920,14 +2923,16 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_tcp_hlen = th->th_off << 2; pi->ipi_tcp_seq = th->th_seq; } - if (__predict_false(ip->ip_p != IPPROTO_TCP)) - return (ENXIO); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; - if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { - ip->ip_sum = 0; - ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + if (IS_TSO4(pi)) { + if (__predict_false(ip->ip_p != IPPROTO_TCP)) + return (ENXIO); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { + ip->ip_sum = 0; + ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + } } } break; @@ -2950,26 +2955,30 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip6->ip6_nxt; pi->ipi_flags |= IPI_TX_IPV6; - if (IS_TSO6(pi)) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD6(pi)) { if (pi->ipi_ipproto == IPPROTO_TCP) { if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) { + txq->ift_pullups++; if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) == NULL)) return (ENOMEM); } pi->ipi_tcp_hflags = th->th_flags; pi->ipi_tcp_hlen = th->th_off << 2; + pi->ipi_tcp_seq = th->th_seq; } - - if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) - return (ENXIO); - /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. - */ - pi->ipi_csum_flags |= CSUM_TCP_IPV6; - th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (IS_TSO6(pi)) { + if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) + return (ENXIO); + /* + * The corresponding flag is set by the stack in the IPv4 + * TSO case, but not in IPv6 (at least in FreeBSD 10.2). + * So, set it here because the rest of the flow requires it. + */ + pi->ipi_csum_flags |= CSUM_IP6_TCP; + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + } } break; } From owner-svn-src-head@freebsd.org Thu Jun 7 13:14:09 2018 Return-Path: Delivered-To: svn-src-head@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 B5B44FE733F; Thu, 7 Jun 2018 13:14:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6C28FEAE; Thu, 7 Jun 2018 13:14:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EC2D20995; Thu, 7 Jun 2018 13:14:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57DE9rW025826; Thu, 7 Jun 2018 13:14:09 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57DE9qm025825; Thu, 7 Jun 2018 13:14:09 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806071314.w57DE9qm025825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 7 Jun 2018 13:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334781 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 334781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:14:09 -0000 Author: kp Date: Thu Jun 7 13:14:09 2018 New Revision: 334781 URL: https://svnweb.freebsd.org/changeset/base/334781 Log: ipfw: fix whitespace No functional changes. Modified: head/etc/rc.d/ipfw Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Thu Jun 7 13:06:56 2018 (r334780) +++ head/etc/rc.d/ipfw Thu Jun 7 13:14:09 2018 (r334781) @@ -117,14 +117,14 @@ ipfw_stop() ipfw_status() { - status=$(sysctl -n net.inet.ip.fw.enable) - if [ ${status} -eq 0 ]; then - echo "ipfw is not enabled" - exit 1 - else - echo "ipfw is enabled" - exit 0 - fi + status=$(sysctl -n net.inet.ip.fw.enable) + if [ ${status} -eq 0 ]; then + echo "ipfw is not enabled" + exit 1 + else + echo "ipfw is enabled" + exit 0 + fi } load_rc_config $name From owner-svn-src-head@freebsd.org Thu Jun 7 13:16:01 2018 Return-Path: Delivered-To: svn-src-head@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 72DC6FE73DB; Thu, 7 Jun 2018 13:16:01 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 8DF728FFFA; Thu, 7 Jun 2018 13:15:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5CF2721C78; Thu, 7 Jun 2018 09:15:34 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Thu, 07 Jun 2018 09:15:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=6BOr7V phqDDXHLloJY/BEKOIt0jmddQCZFcu8Pd0m/k=; b=Mh92JwVClDlrjWtRQ6DM1b V1UDI9vFkIEUO8yGVc0s74AmgPT4nNoySzjq71AGR+Il/AcLd6bzTtkubuPCCmBF 4u32XNS+AGlRbms8Otspzu0+9fqKkxGHw+LBKnuu0Q4GcnN/ONBVR4OMXXWppFq2 OH5qIUGxRTZ/th0spmZpR54PtwnYyANKT4WsI2kgIaqX3YqjdJkNccH9MV/h2tm9 tv28AYCJOExSWf4rRIndrEsSOGODTa+pdzZpuViJgYXcK608CPEezaGhOQks9qxk jU2yDeBb+9FfJi7VNrTUAvBcpD795piMTorkZw0i1BLPzZlm0oCgO9gUJT5BXGEQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id E4EDCBA50D; Thu, 7 Jun 2018 09:15:33 -0400 (EDT) Message-Id: <1528377333.2843110.1399733656.7738CEA0@webmail.messagingengine.com> From: Brad Davis To: rgrimes@freebsd.org Cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , "src-committers" , svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea References: <201806062035.w56KZhV8006721@pdx.rh.CN85.dnsmgr.net> Date: Thu, 07 Jun 2018 07:15:33 -0600 In-Reply-To: <201806062035.w56KZhV8006721@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334617 - in head: . etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:16:01 -0000 On Wed, Jun 6, 2018, at 2:35 PM, Rodney W. Grimes wrote: > > > On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: > > > > > > > > On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > > > > > On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > > > > > > 06.06.2018 1:26, Konstantin Belousov wrote: > > > > > > > > > > > > >>> I find it often very useful to do > > > > > > >>> (cd src/etc/rc.d && make install) > > > > > > >>> Same for defaults and several other directories which in fact > > > > > > >>> contains> > >>> non-editable content. Is this planned to keep working ? > > > > > > >> > > > > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > > > > >> of the program they start.> > >> > > > > > > >> That said, if there is a big need for this, we can see about > > > > > > >> options to keep them working.> > >> > > > > > > >> What are you trying to accomplish when you do this? Just verify > > > > > > >> the rc.d scripts match your src tree?> > > > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are > > > > > > > binaries> > > provided by the project not for the user editing. > > > > > > > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > > > > by this> > > procedure and avoid any editing and implied conflict resolution > > > > > > > for real> > > configs. > > > > > > > > > > > > > > Not being able to easily install clean copies of these scripts > > > > > > > would> > > be very inconvenient and time consuming. > > > > > > > > > > > > I found that "mergemaster -iFUP" deals with unchanged files > > > > > > including mentioned rc* scripts just fine.> > That is, it automatically refreshes unchanged files without any > > > > > > silly questions just for change of $FreeBSD$.> > > > > > No, you missed the point. Whatever nice is the handling of > > > > > unchanged files,> use of mergemaster forces me to handle changed files, which is exactly> what I do not want/need to do. Yes, I update crashboxes very > > > > > often, and> I want to get all new code, including the startup scripts, when > > > > > I update. > > > > The startup scripts will be installed as part of installworld. > > > > > > So each installworld would wipe over the top of any localmod /etc/rc.d/ > > > and other stuff > > > that mght exist? > > > One of the reasons that etc/Makefile is detached from Installword is so > > > that > > > /etc does not get perturbuted unless specifically requested. > > > > Yes, this is by design. > > This is going to have a great amount of push back, and this is by your > NEW design, > the existing design does not cause this pain. > > > > > If people need custom tweaks for that stuff they should be upstreamed or moved into /usr/local/etc/rc.d as a custom startup script. > > I doubt very much this is a practical solution. I have changes that I doubt > belong in FreeBSD, and are not restricted to etc/rc.d. And from reading > this thread thus far so do others. I think we could extend the rc system to handle cases like this, but without details we cannot have a productive conversation. Regards, Brad Davis From owner-svn-src-head@freebsd.org Thu Jun 7 13:16:54 2018 Return-Path: Delivered-To: svn-src-head@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 AEE8AFE745F; Thu, 7 Jun 2018 13:16:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6496A68113; Thu, 7 Jun 2018 13:16:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4518320999; Thu, 7 Jun 2018 13:16:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57DGs40026064; Thu, 7 Jun 2018 13:16:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57DGsQa026063; Thu, 7 Jun 2018 13:16:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806071316.w57DGsQa026063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 7 Jun 2018 13:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334782 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 334782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:16:54 -0000 Author: kp Date: Thu Jun 7 13:16:53 2018 New Revision: 334782 URL: https://svnweb.freebsd.org/changeset/base/334782 Log: ipfw: fix status if ipfw.ko is not loaded If the ipfw module is not loaded the net.inet.ip.fw.enable OID does not exist, which leads the script to report errors and incorrectly report that ipfw is enabled. Modified: head/etc/rc.d/ipfw Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Thu Jun 7 13:14:09 2018 (r334781) +++ head/etc/rc.d/ipfw Thu Jun 7 13:16:53 2018 (r334782) @@ -117,8 +117,8 @@ ipfw_stop() ipfw_status() { - status=$(sysctl -n net.inet.ip.fw.enable) - if [ ${status} -eq 0 ]; then + status=$(sysctl -i -n net.inet.ip.fw.enable) + if [ ${status:-0} -eq 0 ]; then echo "ipfw is not enabled" exit 1 else From owner-svn-src-head@freebsd.org Thu Jun 7 13:17:34 2018 Return-Path: Delivered-To: svn-src-head@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 84533FE74D0; Thu, 7 Jun 2018 13:17:34 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 32E28682C3; Thu, 7 Jun 2018 13:17:34 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AF3D921B73; Thu, 7 Jun 2018 09:17:33 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Thu, 07 Jun 2018 09:17:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=y6NQug FrRxELrY9NGtT1659/0hiSHTi3qvptH1EYhjA=; b=Erq/2zUMtbGpvKTxBNuQB5 cjk2c/x2kDNgunwbMedAlq0kj1EndiV5QEFQj4qA9rGPFJfoCpwIu7arVH2mUeBH A2RDrwBnmsNH46b/GsQVXR1biJFo8phrbGH3vZNXdNtSEhhHgVu9c/FabUSLOADt wRhIjNzKkjXh5xrjXuTT7gMfeg/s5ntU4QMCIHTpRWkHRMui4jTevHJvnjvgNxxS HAEXkYVhPtHcMO0VFbQ51V0fOAqBAbwGFl4zAkpsv3O6NdwKD60LbRTasBiNHg15 9F1CrJPOg8m6KmMmfXe4+C2/AVFwtSN1NCPmqj2tQDW1938+YZJLN3GX65rijN9Q == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 29877BA50D; Thu, 7 Jun 2018 09:17:33 -0400 (EDT) Message-Id: <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> From: Brad Davis To: Eugene Grosbein , Ian Lepore , rgrimes@FreeBSD.org Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , "src-committers" , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <5B187A4C.4080009@grosbein.net> Date: Thu, 07 Jun 2018 07:17:33 -0600 References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:17:34 -0000 On Wed, Jun 6, 2018, at 6:20 PM, Eugene Grosbein wrote: > 07.06.2018 3:06, Ian Lepore wrote: > > > I don't understand the drama over this. rc.d startup scripts are > > *binaries*. > > This is plain wrong. Example: before introduction of rcNG we had /etc/ > rc.serial > supposed to be user-modified to contain local settings for serial ports > (uncluding USB serial). > Now it is moved to /etc/rc.d/serial largely unchanged and is still > supposed to be user-modified. We can change this script to advise the user to copy it to /usr/local/etc/rc.d. Regards, Brad Davis From owner-svn-src-head@freebsd.org Thu Jun 7 13:18:34 2018 Return-Path: Delivered-To: svn-src-head@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 88892FE7552; Thu, 7 Jun 2018 13:18:34 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 311556847E; Thu, 7 Jun 2018 13:18:34 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1545E21CF1; Thu, 7 Jun 2018 09:18:34 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Thu, 07 Jun 2018 09:18:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=z0Dwdz 83X0ktoh5DjQcOeHkDfPiUgEnaSvEIS6/mYuQ=; b=XWZUhkxK57DuYPsPu6MhVE FSNeJbbhifye7xXF9Vycbsj6hb7c7on7nG/y4vL5ULV9r2LXgllXajf+fCJQQ3X1 tdhnjm++uVWoncgn0FaAtOQJLzCU7fVJnTi8OxnYLWgeXQKNzi8UD0MZ2xt1oZ01 968BKawjZBIoAHg+OJb0MCx7VrmwUaRddj/P8e2s5lvv9fIRGmIJ4/0XOYt5hOqV qYkKFf3SOJmz1k4sGWVOiLiyhWlmfjfBQcTHCHWzWK7Wncil7P6tS0H0NsoFCEZH obsSLQ7Yr08YohiwSupfwS7wf3buqsT5+zstRQ4nHaUtHi3YRuy5zxqf/Y56OC3g == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id DEC44BA50E; Thu, 7 Jun 2018 09:18:33 -0400 (EDT) Message-Id: <1528377513.2844855.1399736216.1FC8DF28@webmail.messagingengine.com> From: Brad Davis To: Alexey Dokuchaev Cc: rgrimes@FreeBSD.org, "src-committers" , Kyle Evans , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Eugene Grosbein MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Date: Thu, 07 Jun 2018 07:18:33 -0600 References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> <20180607072958.GA51308@FreeBSD.org> Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <20180607072958.GA51308@FreeBSD.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:18:34 -0000 On Thu, Jun 7, 2018, at 1:29 AM, Alexey Dokuchaev wrote: > On Wed, Jun 06, 2018 at 01:02:25PM -0600, Brad Davis wrote: > > On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: > > > ... > > > So each installworld would wipe over the top of any localmod /etc/rc.d/ > > > and other stuff that mght exist? > > > One of the reasons that etc/Makefile is detached from Installword is so > > > that /etc does not get perturbuted unless specifically requested. > > > > Yes, this is by design. > > > > If people need custom tweaks for that stuff they should be upstreamed or > > moved into /usr/local/etc/rc.d as a custom startup script. > > This is rather questionable design to me. I don't consider my scripts > as binaries and like them in /etc/rc.d/ and managed via mergemaster -Fi. > Everything was perfectly fine with it. What exactly the problem you're > trying to solve here? But they are provided by the system and should not be modified in place. Hence the suggestion to move them out of /etc. Regards, Brad Davis From owner-svn-src-head@freebsd.org Thu Jun 7 13:27:40 2018 Return-Path: Delivered-To: svn-src-head@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 E7CA6FE7903; Thu, 7 Jun 2018 13:27:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 B45C868AC4; Thu, 7 Jun 2018 13:27:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8076D5A9F12; Thu, 7 Jun 2018 13:27:33 +0000 (UTC) Date: Thu, 7 Jun 2018 13:27:33 +0000 From: Brooks Davis To: Ravi Pokala Cc: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334702 - head/sys/sys Message-ID: <20180607132733.GA41876@spindle.one-eyed-alien.net> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:27:40 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 07, 2018 at 12:01:00AM -0400, Ravi Pokala wrote: > > I believe the theory is that the compiler (remember, this is __builtin_= memset) can optimize away portions of the zeroing, or can optimize zeroing = for small sizes. >=20 > Ahhh! I didn't consider that the compiler would be doing analysis of the = larger context, and potentially skipping zeroing parts that are set immedia= tely after the call. Clang does this. It does make for some quite interesting object code, but the result is that zeroing with __builtin_memset() is basically free for mostly-initialized structures. -- Brooks --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbGTLEAAoJEKzQXbSebgfA8cIH/RlCwFDXLPa31BCS4XMjzqxJ /31i3IEKOH7/4aQHxlf58rquy6xAi1w3nI0bLavyCU/9BFoJeAvwat1UkdVCK92x 6z3tdOP0XUK2hAJidT1T4/lgWT8VbRERnGOnQseL2fSV9Cb64PDkP6RLB1lEVBTE I4XzEM6oHOu5q6H74z2DDH4R0pNO1LU2K35pm4M4QTYGW5DWV7sXtnTzUONjnO07 6XSV8B/jFNiTUNEqY81o9jkcpk6ocCPKDsgIjwym6hDbEGrVrSmJFw6oDzoLoPI+ wkwMh1LDtm07VxgD5n8wt7RjUb/2a79GuQ/AcZhstzvnZekBP8iyGBJSXBgvJF0= =rAJw -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q-- From owner-svn-src-head@freebsd.org Thu Jun 7 13:31:02 2018 Return-Path: Delivered-To: svn-src-head@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 0FEF5FE7ADC; Thu, 7 Jun 2018 13:31:02 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8F268CCB; Thu, 7 Jun 2018 13:29:55 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6940520B2A; Thu, 7 Jun 2018 13:29:55 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57DTtFC030988; Thu, 7 Jun 2018 13:29:55 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57DTtaX030987; Thu, 7 Jun 2018 13:29:55 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806071329.w57DTtaX030987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 7 Jun 2018 13:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334783 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:31:02 -0000 Author: jtl Date: Thu Jun 7 13:29:54 2018 New Revision: 334783 URL: https://svnweb.freebsd.org/changeset/base/334783 Log: Fix a typo in vm_domain_set(). When a domain crosses into the severe range, we need to set the domain bit from the vm_severe_domains bitset (instead of clearing it). Reviewed by: jeff, markj Sponsored by: Netflix, Inc. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 7 13:16:53 2018 (r334782) +++ head/sys/vm/vm_page.c Thu Jun 7 13:29:54 2018 (r334783) @@ -2845,7 +2845,7 @@ vm_domain_set(struct vm_domain *vmd) } if (!vmd->vmd_severeset && vm_paging_severe(vmd)) { vmd->vmd_severeset = 1; - DOMAINSET_CLR(vmd->vmd_domain, &vm_severe_domains); + DOMAINSET_SET(vmd->vmd_domain, &vm_severe_domains); } mtx_unlock(&vm_domainset_lock); } From owner-svn-src-head@freebsd.org Thu Jun 7 13:52:08 2018 Return-Path: Delivered-To: svn-src-head@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 9AE62FE9B22; Thu, 7 Jun 2018 13:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501296A4BA; Thu, 7 Jun 2018 13:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [10.200.7.59] (unknown [137.122.64.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DF85DF536; Thu, 7 Jun 2018 13:52:07 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Thu, 07 Jun 2018 09:52:06 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: Brooks Davis CC: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , , Message-ID: <505A6291-6B3C-4857-8A9C-60E58EB50454@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> <20180607132733.GA41876@spindle.one-eyed-alien.net> In-Reply-To: <20180607132733.GA41876@spindle.one-eyed-alien.net> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:52:08 -0000 -----Original Message----- From: Brooks Davis Date: 2018-06-07, Thursday at 09:27 To: Ravi Pokala Cc: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > On Thu, Jun 07, 2018 at 12:01:00AM -0400, Ravi Pokala wrote: >>> I believe the theory is that the compiler (remember, this is __builtin_memset) can optimize away portions of the zeroing, or can optimize zeroing for small sizes. >> >> Ahhh! I didn't consider that the compiler would be doing analysis of the larger context, and potentially skipping zeroing parts that are set immediately after the call. > > Clang does this. It does make for some quite interesting object code, > but the result is that zeroing with __builtin_memset() is basically free > for mostly-initialized structures. > > -- Brooks Yeah, it's a subtle but obvious optimization in hindsight. Thanks for the info. -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Thu Jun 7 13:54:04 2018 Return-Path: Delivered-To: svn-src-head@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 1BF45FE9C67; Thu, 7 Jun 2018 13:54:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FB16A63D; Thu, 7 Jun 2018 13:54:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [137.122.64.159]) by mail.baldwin.cx (Postfix) with ESMTPSA id 16B9210A87D; Thu, 7 Jun 2018 09:54:02 -0400 (EDT) Subject: Re: svn commit: r334616 - head/sys/dev/acpica To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806041456.w54Eu3hB062082@repo.freebsd.org> From: John Baldwin Message-ID: <9b13b9db-f040-809d-0c24-67dc408380ec@FreeBSD.org> Date: Thu, 7 Jun 2018 09:54:01 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806041456.w54Eu3hB062082@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 07 Jun 2018 09:54:02 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:54:04 -0000 On 6/4/18 10:56 AM, Mark Johnston wrote: > Author: markj > Date: Mon Jun 4 14:56:02 2018 > New Revision: 334616 > URL: https://svnweb.freebsd.org/changeset/base/334616 > > Log: > Fix the NUMA build for non-x86 platforms. > > acpi_map_pxm_to_vm_domainid() is currently implemented only on x86. > > MFC after: 1 week It seems that non-x86 platforms that support NUMA should implement this function instead. The SRAT table is not x86-specific and ACPI platforms implementing NUMA will need to provide an SRAT parser to describe the memory layout to VM and to map _PXM values to the VM domain values assigned by that mapping. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 7 13:58:00 2018 Return-Path: Delivered-To: svn-src-head@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 B32D3FE9E4C; Thu, 7 Jun 2018 13:58:00 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B658A6A828; Thu, 7 Jun 2018 13:57:35 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D59C21006; Thu, 7 Jun 2018 13:57:35 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57DvZIM046388; Thu, 7 Jun 2018 13:57:35 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57DvYJn046385; Thu, 7 Jun 2018 13:57:34 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201806071357.w57DvYJn046385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Thu, 7 Jun 2018 13:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334784 - in head/sys: conf dev/md X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: in head/sys: conf dev/md X-SVN-Commit-Revision: 334784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:58:01 -0000 Author: leitao Date: Thu Jun 7 13:57:34 2018 New Revision: 334784 URL: https://svnweb.freebsd.org/changeset/base/334784 Log: md: use prestaged mfs_root On PowerNV systems, the rootfs is passed through kexec, which loads the rootfs into memory and set two fdt entries to describe where the file is located in the memory; I need to pass this memory region to the md device as a mfs_root, but, current md driver does not support two things: * Just getting a pointer from an external (bootloader) memory. If I need to workaround it, I would need to declare a static array and memcopy from this external memory to this static variable. * The size of the image. The usage of mfs_root_end, which is not a pointer, seems to be not possible for this prestaged scenario. This patch simply adds a new way to load mfs_root from memory. Differential Revision: https://reviews.freebsd.org/D15625 Approved by: kib, jhibbits (mentor) Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/md/md.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jun 7 13:29:54 2018 (r334783) +++ head/sys/conf/NOTES Thu Jun 7 13:57:34 2018 (r334784) @@ -1111,6 +1111,9 @@ options MD_ROOT # Write-protect the md root device so that it may not be mounted writeable. options MD_ROOT_READONLY +# Allow to read MD image from external memory regions +options MD_ROOT_MEM + # Disk quotas are supported when this option is enabled. options QUOTA #enable disk quotas Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 7 13:29:54 2018 (r334783) +++ head/sys/conf/options Thu Jun 7 13:57:34 2018 (r334784) @@ -168,6 +168,7 @@ MD_ROOT opt_md.h MD_ROOT_FSTYPE opt_md.h MD_ROOT_READONLY opt_md.h MD_ROOT_SIZE opt_md.h +MD_ROOT_MEM opt_md.h MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h MPROF_BUFFERS opt_mprof.h Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Jun 7 13:29:54 2018 (r334783) +++ head/sys/dev/md/md.c Thu Jun 7 13:57:34 2018 (r334784) @@ -180,6 +180,10 @@ SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, */ u_char mfs_root[MD_ROOT_SIZE*1024] __attribute__ ((section ("oldmfs"))); const int mfs_root_size = sizeof(mfs_root); +#elif defined(MD_ROOT_MEM) +/* MD region already mapped in the memory */ +u_char *mfs_root; +int mfs_root_size; #else extern volatile u_char __weak_symbol mfs_root; extern volatile u_char __weak_symbol mfs_root_end; @@ -2074,8 +2078,12 @@ g_md_init(struct g_class *mp __unused) #ifdef MD_ROOT if (mfs_root_size != 0) { sx_xlock(&md_sx); +#ifdef MD_ROOT_MEM + md_preloaded(mfs_root, mfs_root_size, NULL); +#else md_preloaded(__DEVOLATILE(u_char *, &mfs_root), mfs_root_size, NULL); +#endif sx_xunlock(&md_sx); } #endif From owner-svn-src-head@freebsd.org Thu Jun 7 14:03:01 2018 Return-Path: Delivered-To: svn-src-head@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 2901EFEC463; Thu, 7 Jun 2018 14:03:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 C2AE16AD51; Thu, 7 Jun 2018 14:02:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x244.google.com with SMTP id h5-v6so9901714qtm.13; Thu, 07 Jun 2018 07:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fPBuPxAmkWpsNxbjmCBTqBIjKKlL1+0g3DA+rBHzgcw=; b=Fs/O9+P2RKZWlWlME9mGo1G3RyOKWLASXIrlr5og8UthuUOmy1RTog0AqxNHVREutO 9+1mTFEhjJ9Gt+UGShWSPdF8AMo7OjIG8Z/LoTaesQrihqH5s9kvC1bVI9IOq1UZFRQb QpB5UC8z7IZSMvURrgJhs4yPTOwtjpEI402iysZx2MH8wjJw4kE+SyHDuPwkv+qW1GNF 8nDLnBIoMzBz0IXq22ZIxaippYiWW1OmEY8sg63EWwGB1+YfjRkctoqAwmBgNnEGsE2n 3dOAm/EeLlGVESyEQ0VT4dtqLjQ1d14E1Xxp7kWRSmJIcIgVKphq5fJVTwDj74/V2R7T HliA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fPBuPxAmkWpsNxbjmCBTqBIjKKlL1+0g3DA+rBHzgcw=; b=thf2I0zq4l36i4+dwNQb+ee3cOQ9glCzH9AVZBtho5BxtLP11skEK1WARpuyqR0R6E 5+5z+FLeH5h6VsQkrDqHB3Iux3lMm7of4MfyLX7bYWLk5SVWoSHhgCW/ICqMgcq4Hhyi iHIr4dyIrEqU7PEaQMx0taJLlCeAezgmFugqkkN8gpyym7wxM+rdR75GHdzfqYoUdrdm g6c2ADL6eXbvnSNy62C3wUrYKCqCHf8Dr8uY71Oc1Nbclbvo1wqyhO0VZ3DxLGEpoMeQ t8CNMlceSKUmhhy8wJ28PjHfFqAb5cjFRWjNQYQM4v0L1bw6liGxRTWgH3qC0ZBjavaJ BcUg== X-Gm-Message-State: APt69E05XA1UkbVvFx6/A9gejeSZSwP1QjVPR3PGfyG4Z0d/Z0Qj8gxw ql5Fq50lg5ckhANIRFghKfHVWQ== X-Google-Smtp-Source: ADUXVKKvuQ8RbjLkQDbbuIeQYR+dG4WlKFuQz4caaSVdhravyBYwfBjayFGm9hfm2/evJQ/nuEDmNw== X-Received: by 2002:ac8:2e52:: with SMTP id s18-v6mr1716208qta.319.1528380154077; Thu, 07 Jun 2018 07:02:34 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id q77-v6sm23363089qki.73.2018.06.07.07.02.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 07:02:33 -0700 (PDT) Sender: Mark Johnston Date: Thu, 7 Jun 2018 10:02:15 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334616 - head/sys/dev/acpica Message-ID: <20180607140215.GB96819@pesky> References: <201806041456.w54Eu3hB062082@repo.freebsd.org> <9b13b9db-f040-809d-0c24-67dc408380ec@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b13b9db-f040-809d-0c24-67dc408380ec@FreeBSD.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:03:01 -0000 On Thu, Jun 07, 2018 at 09:54:01AM -0400, John Baldwin wrote: > On 6/4/18 10:56 AM, Mark Johnston wrote: > > Author: markj > > Date: Mon Jun 4 14:56:02 2018 > > New Revision: 334616 > > URL: https://svnweb.freebsd.org/changeset/base/334616 > > > > Log: > > Fix the NUMA build for non-x86 platforms. > > > > acpi_map_pxm_to_vm_domainid() is currently implemented only on x86. > > > > MFC after: 1 week > > It seems that non-x86 platforms that support NUMA should implement > this function instead. The SRAT table is not x86-specific and ACPI > platforms implementing NUMA will need to provide an SRAT parser to > describe the memory layout to VM and to map _PXM values to the > VM domain values assigned by that mapping. Indeed, this was a small step towards lifting some of the code in x86/acpica/srat.c into the generic driver for use on arm64. In my case I'm looking a ThunderX, which exposes NUMA locality info in both the ofw device tree and the SRAT table. I'm looking at ofw first, and in the meantime I just needed a buildable options NUMA kernel. From owner-svn-src-head@freebsd.org Thu Jun 7 14:13:49 2018 Return-Path: Delivered-To: svn-src-head@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 572F4FEFC18 for ; Thu, 7 Jun 2018 14:13:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 D9B5C6B49F for ; Thu, 7 Jun 2018 14:13:48 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-io0-x22b.google.com with SMTP id t6-v6so11968908iob.10 for ; Thu, 07 Jun 2018 07:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ras5Jhzmi+sZ9smxGdAdBHDqAOeGiRFY1HdtfGlZXbQ=; b=pYDxVupFMdqRLCIEY+dsJd1VnRijYVcbks1Ac7BdoG+Deh29Iefm7JTJTBM3WQJ/q0 3Qn7viX9CgfBVRlU1cu27tC3BSlOoTs0yVFm3JjEZn7iVhoBI4qETX4T6LGee6XJuHwv cYjQRfNk+lV96M6o7x+rSzEMkh8wxggA2P4BahWEIUy/gQXiChfsDqrhq1unbyJqupQi a/tZOoopg9p0liUBI4gnc+2FdtT62R6+ZTzZu6dGjKyJk+DUoFhGLtjOclmSUOM5WVUP drSjfPSHfR/qP44OdMLcQGaNB4ghPmAirvQ7dPkLiMaIzicdxkd6OGb8rYo8guIUXp8D kiTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ras5Jhzmi+sZ9smxGdAdBHDqAOeGiRFY1HdtfGlZXbQ=; b=ejrmj3+LtADnvfIoHR6qEPcktLqP2eNOahD/Jfy/bJLoI+H04by/o2qttdPjXX5fFo CcxtUIFYTQov7kIeP9+LGEEgDaZg25zQFyoER3wDJhECs/JNN3lEZanD1GOymZrqxANo 8GgNT51KOHeegmwNdeoby57sT3Uu7/xCIAf1Qbzdg5dPnVKKGXEZqfWiEJrmY/jhI8v1 4K4EHj29WhIQsIHekmiASdzGhzNoKpIxGfFDPemt2sKPw2DfjZdhu4Xd3Of0bxqNp4KS iB0g32uFbAj4V6hSQ0Vf9pFM1YTALNewDGv8HAGf7rISx6mzVj7/e6cG5Xrlsvdj8YVV iS0w== X-Gm-Message-State: APt69E09x5tJfOhpOgu9IKawh86Nb1ZGzrNL+bjTWtsjoV8855tO2okZ kLLJPkB2mYaVAeosg0315aCCCQ== X-Google-Smtp-Source: ADUXVKLXyf0fpc2p4OUEzbPVdhlRA3gBDj4lFCIcwda311dgZg+D1Ydd3e55aP/VI5JedMSUDeuOmg== X-Received: by 2002:a6b:882a:: with SMTP id k42-v6mr1697703iod.137.1528380828085; Thu, 07 Jun 2018 07:13:48 -0700 (PDT) Received: from mutt-hbsd ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id y79-v6sm9931881iof.47.2018.06.07.07.13.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 07:13:46 -0700 (PDT) Date: Thu, 7 Jun 2018 10:13:31 -0400 From: Shawn Webb To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Johannes Lundberg Subject: Re: svn commit: r334719 - in head: cddl/lib/libdtrace lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys Message-ID: <20180607141331.gaej4q6m2irqwnek@mutt-hbsd> References: <201806061545.w56Fjv3e076880@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ut6p25yqm73ezncy" Content-Disposition: inline In-Reply-To: <201806061545.w56Fjv3e076880@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:13:49 -0000 --ut6p25yqm73ezncy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 06, 2018 at 03:45:57PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Wed Jun 6 15:45:57 2018 > New Revision: 334719 > URL: https://svnweb.freebsd.org/changeset/base/334719 >=20 > Log: > Load balance sockets with new SO_REUSEPORT_LB option. > =20 > This patch adds a new socket option, SO_REUSEPORT_LB, which allow multi= ple > programs or threads to bind to the same port and incoming connections w= ill be > load balanced using a hash function. > =20 > Most of the code was copied from a similar patch for DragonflyBSD. > =20 > However, in DragonflyBSD, load balancing is a global on/off setting and= can not > be set per socket. This patch allows for simultaneous use of both the c= urrent > SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. > =20 > Required changes to structures: > Globally change so_options from 16 to 32 bit value to allow for more op= tions. > Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. > =20 > Limitations: > As DragonflyBSD, a load balance group is limited to 256 pcbs (256 progr= ams or > threads sharing the same socket). > =20 > This is a substantially different contribution as compared to its origi= nal > incarnation at svn r332894 and reverted at svn r332967. Thanks to rwat= son@ > for the substantive feedback that is included in this commit. > =20 > Submitted by: Johannes Lundberg > Obtained from: DragonflyBSD > Relnotes: Yes > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D11003 Hey Sean, This is a rather interesting and useful feature. Thank you for committing it. It seems there are some security trade-offs being made for applications that opt-in to this feature: third-party applications, potentially malicious, could bind to the port. I wonder if we could prevent malicious abuse of this feature by introducing a random cookie. When a developer sets this option, the developer must specify a random value as a cookie. Applications who want to share the port, then, must also specify the cookie (perhaps via another socket option?). What are your thoughts? I'm CC'ing Johannes to get his thoughts as well. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --ut6p25yqm73ezncy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlsZPYcACgkQaoRlj1JF bu6aTRAAyP8aMIYYj55WmxTn/+ZPrdxMfmHMVMIUT4GLB7j2CocNJbvZV34JIzTx 5HKXHntPmHjbYlKuomDLXMaypezp0vrL1ZuryEAa24kSd/0jRJqi3LzWnmkfaPvW uBKTa3soPlBHErRBpc4ND1VAYYIQ793OZBDwTlfBUFh+xu5DXFKHPNW4+CqhpcAT Q8lgV7/yYU3XXvUI8DgwhJRq8WBtjAl6y3MJvEh4bmvs/DaVLrRU/zwGHHjef7vT Do4qUqAFrPxS6vCxqA1i8b0O/4lTZ3o94obFhqCgFiUt6UzPvGeG7/COnqUE3fnt lX/Gm+tzknLgrSF8ksMs/UrcexhXmB1m0xYWdre4Hj5DpK4A+2CZVSZw0vkWs8Tx MgGmtF1jRfDYjvfUy2tFyQOcAUPJ2oB7fGrZ0woe/EVmhsiqoN6M46kakLoCwkeR TBSauphH4nvnlYbw4a+DvnVBgtEfC+OJM1k1XsCvamdH7p3sn39T0sZA0Lo/FYD1 B9jWAxynzFdoZBqNGT9iNa4KhFAiaJekLTZplT1uDnFPt9H4z67phgpPot9yQtVQ HtKf8JNza79JrU/l1Gd5WdOLvynlew8Z5DRmmn/PWKumfKP+DzItSj25gbcApWD5 gY/tgKL3wtJ1Zjd7f18DqmtVd87li3qzBR7gv1L0GkoNZ4M0lbA= =Y5uN -----END PGP SIGNATURE----- --ut6p25yqm73ezncy-- From owner-svn-src-head@freebsd.org Thu Jun 7 14:16:12 2018 Return-Path: Delivered-To: svn-src-head@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 18994FF04ED; Thu, 7 Jun 2018 14:16:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97076B652; Thu, 7 Jun 2018 14:16:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [137.122.64.159]) by mail.baldwin.cx (Postfix) with ESMTPSA id 14F4310B429; Thu, 7 Jun 2018 10:16:10 -0400 (EDT) Subject: Re: svn commit: r334277 - in head: contrib/libpcap contrib/ofed/usr.lib/3 contrib/pf/pflogd contrib/wpa/src/l2_packet lib lib/libpcap share/mk usr.sbin/cxgbetool To: Hans Petter Selasky , Xin LI References: <201805280812.w4S8CI56046943@repo.freebsd.org> <22f8b1c6-a03c-4cf0-8ead-551cccdfea95@selasky.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: John Baldwin Message-ID: <3bbe9239-fa04-7f4c-d52c-a0347ef12650@FreeBSD.org> Date: Thu, 7 Jun 2018 10:16:10 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <22f8b1c6-a03c-4cf0-8ead-551cccdfea95@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 07 Jun 2018 10:16:11 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:16:12 -0000 On 5/31/18 3:41 AM, Hans Petter Selasky wrote: > On 05/30/18 22:10, Xin LI wrote: >> This would make vendor/libpcap/dist history replace head/contrib/libpcap, >> which effectively discards all FreeBSD local changes for base purposes, and >> hides its change history. Is this intentional? If not, could you please >> revert the tree back to its previous state and redo the merge? >> > > Hi, > >> (You should probably also update sys/net/bpf.h and/or sys/net/dlt.h, by the >> way). > > It is a vendor library, we should try to avoid local changes? No, that's not realistic. > The problem is that some files are deleted upstream and I'm not sure if > "merge" will track that when we don't merge from the same branch. svn understands deletions when merging. You need to revert and fix this properly. Doing a real merge would also have meant that you would probably not have caused the ports breakage since svn merge would have flagged the existing local changes you silently overwrote/dropped. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 7 14:23:32 2018 Return-Path: Delivered-To: svn-src-head@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 9C3DBFF1B76; Thu, 7 Jun 2018 14:23:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3BF6BD3E; Thu, 7 Jun 2018 14:23:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FE57214FD; Thu, 7 Jun 2018 14:23:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57ENW76061375; Thu, 7 Jun 2018 14:23:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57ENWYF061374; Thu, 7 Jun 2018 14:23:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806071423.w57ENWYF061374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Jun 2018 14:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334785 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 334785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:23:32 -0000 Author: avg Date: Thu Jun 7 14:23:31 2018 New Revision: 334785 URL: https://svnweb.freebsd.org/changeset/base/334785 Log: expand descriptions of x86 panic_on_nmi and kdb_on_nmi sysctls The descriptions were as terse as the variable names and they did not explain additional conditions for knobs. MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Thu Jun 7 13:57:34 2018 (r334784) +++ head/sys/x86/x86/cpu_machdep.c Thu Jun 7 14:23:31 2018 (r334785) @@ -723,7 +723,7 @@ SYSINIT(cpu_idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, cpu static int panic_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, &panic_on_nmi, 0, - "Panic on NMI"); + "Panic on NMI raised by hardware failure"); int nmi_is_broadcast = 1; SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFLAG_RWTUN, &nmi_is_broadcast, 0, @@ -732,7 +732,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFL int kdb_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN, &kdb_on_nmi, 0, - "Go to KDB on NMI"); + "Go to KDB on NMI with unknown source"); #endif #ifdef DEV_ISA From owner-svn-src-head@freebsd.org Thu Jun 7 14:46:49 2018 Return-Path: Delivered-To: svn-src-head@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 9C6F1FF9C26 for ; Thu, 7 Jun 2018 14:46:49 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 158F16D1A8 for ; Thu, 7 Jun 2018 14:46:48 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w57EkWuO068024 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Jun 2018 16:46:33 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w57EkSVi024275 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 7 Jun 2018 21:46:29 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Brad Davis , Ian Lepore , rgrimes@FreeBSD.org References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Eugene Grosbein Message-ID: <5B19453E.1030503@grosbein.net> Date: Thu, 7 Jun 2018 21:46:22 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:46:49 -0000 07.06.2018 20:17, Brad Davis wrote: >>> I don't understand the drama over this. rc.d startup scripts are >>> *binaries*. >> >> This is plain wrong. Example: before introduction of rcNG we had /etc/ >> rc.serial >> supposed to be user-modified to contain local settings for serial ports >> (uncluding USB serial). >> Now it is moved to /etc/rc.d/serial largely unchanged and is still >> supposed to be user-modified. > > We can change this script to advise the user to copy it to /usr/local/etc/rc.d. Yes, we could. However, /usr/local/etc/rc.d has its limitations comparing to /etc/rc.d: it is not possible to run a script from /usr/local/etc/rc.d before FILESYSTEMS early/late divider that is critical if one needs to query local UPS over serial port to ensure its battery has enough energy (say, above 5%) to delay fs mounts until it charges enough. For example, statically linked "apctest" utility placed to /root/bin/ does that just fine with some small scripting. You see, my point is that you can never know beforehand of all challenges a sysadmin faces in fields. And there should be really good reason to break things that work before. Like, solving some significant issue we have with current setup. Do we have such? Eugene From owner-svn-src-head@freebsd.org Thu Jun 7 14:46:54 2018 Return-Path: Delivered-To: svn-src-head@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 BDD04FF9C83; Thu, 7 Jun 2018 14:46:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C04D6D271; Thu, 7 Jun 2018 14:46:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1D9721897; Thu, 7 Jun 2018 14:46:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57EkrFh071775; Thu, 7 Jun 2018 14:46:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57EkqKO071774; Thu, 7 Jun 2018 14:46:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806071446.w57EkqKO071774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Jun 2018 14:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334786 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 334786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 14:46:55 -0000 Author: avg Date: Thu Jun 7 14:46:52 2018 New Revision: 334786 URL: https://svnweb.freebsd.org/changeset/base/334786 Log: x86: reorganize code that deals with unexpected NMI-s Expected NMI-s are those than are either generated by the software (such as a CPU sending NMI to other CPU) or generated by the hardware after the software configured it to do so (such as NMI-s on PMC events). Some unexpected NMI-s can be caused by hardware failures and it is possible to inquire the hardware about them (somewhat like MCA but much more primitive) using an EISA mechanism. In some cases the origin of the NMI can remain truly unknown. This commit should not change any functionality. It just reorganizes the code, so that it is easier to extend with new checks for the origin of the NMI. Also, it frees the code that has nothing to do with ISA from DEV_ISA. MFC after: 3 weeks Modified: head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Thu Jun 7 14:23:31 2018 (r334785) +++ head/sys/x86/x86/cpu_machdep.c Thu Jun 7 14:46:52 2018 (r334786) @@ -735,33 +735,34 @@ SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWT "Go to KDB on NMI with unknown source"); #endif -#ifdef DEV_ISA void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame) { + bool claimed = false; +#ifdef DEV_ISA /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(frame->tf_err) == 0) { + if (isa_nmi(frame->tf_err)) { + claimed = true; + if (panic_on_nmi) + panic("NMI indicates hardware failure"); + } +#endif /* DEV_ISA */ #ifdef KDB + if (!claimed && kdb_on_nmi) { /* * NMI can be hooked up to a pushbutton for debugging. */ - if (kdb_on_nmi) { - printf("NMI/cpu%d ... going to debugger\n", cpu); - kdb_trap(type, 0, frame); - } -#endif /* KDB */ - } else if (panic_on_nmi) { - panic("NMI indicates hardware failure"); + printf("NMI/cpu%d ... going to debugger\n", cpu); + kdb_trap(type, 0, frame); } +#endif /* KDB */ } -#endif void nmi_handle_intr(u_int type, struct trapframe *frame) { -#ifdef DEV_ISA #ifdef SMP if (nmi_is_broadcast) { nmi_call_kdb_smp(type, frame); @@ -769,7 +770,6 @@ nmi_handle_intr(u_int type, struct trapframe *frame) } #endif nmi_call_kdb(PCPU_GET(cpuid), type, frame); -#endif } int hw_ibrs_active; Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu Jun 7 14:23:31 2018 (r334785) +++ head/sys/x86/x86/mp_x86.c Thu Jun 7 14:46:52 2018 (r334786) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include "opt_cpu.h" -#include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_sched.h" @@ -1339,7 +1338,6 @@ ipi_nmi_handler(void) return (0); } -#ifdef DEV_ISA int nmi_kdb_lock; void @@ -1363,7 +1361,6 @@ nmi_call_kdb_smp(u_int type, struct trapframe *frame) if (call_post) cpustop_handler_post(cpu); } -#endif /* * Handle an IPI_STOP by saving our current context and spinning until we From owner-svn-src-head@freebsd.org Thu Jun 7 15:00:02 2018 Return-Path: Delivered-To: svn-src-head@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 BAD83FDC743; Thu, 7 Jun 2018 15:00:02 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 5E9516DCC2; Thu, 7 Jun 2018 15:00:02 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DA2AF21EB0; Thu, 7 Jun 2018 11:00:01 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Thu, 07 Jun 2018 11:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3DpScF afcLbZUdJ1HOCJVWYv/7U3PN/ktlP6Nbjm3t0=; b=F6PxpFfT1FaixWRI4Fqkc+ M4oWyREEyIjtjTdGFXXWF7/RPuiHwNB3S0mtyAuOGfjM7tVvjm+KsF4YjOkfhnll 8dXLRx/QE5HHUS7uqCE517GPrFGiVhzKHpuMJAyDPBaBVLKHnMKsGrUQYIogcU/0 QloMeFsOCvHmdOV8WIZTA/vzvYA2q6+NQQkDFFErikOO3ggiHLjLNiHhvKFVZs8W jLDyy7SyhG5VFS+cq/w7h466oCEUixcM6wPfVK2crPoXDjtav+OuHHpaRb2SDZEn 8+/MLRgP7BEOHR3fNfE9v1Fj4J5NxHVgkXItk5O3hmAch6fDb7Pe2DrfnDODQl7g == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 77FC2BA50D; Thu, 7 Jun 2018 11:00:01 -0400 (EDT) Message-Id: <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> From: Brad Davis To: Eugene Grosbein , Ian Lepore , rgrimes@FreeBSD.org Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , "src-committers" , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea In-Reply-To: <5B19453E.1030503@grosbein.net> Subject: Re: svn commit: r334617 - in head: . etc References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> <5B19453E.1030503@grosbein.net> Date: Thu, 07 Jun 2018 09:00:01 -0600 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:00:03 -0000 On Thu, Jun 7, 2018, at 8:46 AM, Eugene Grosbein wrote: > 07.06.2018 20:17, Brad Davis wrote: > > >>> I don't understand the drama over this. rc.d startup scripts are > >>> *binaries*. > >> > >> This is plain wrong. Example: before introduction of rcNG we had /etc/ > >> rc.serial > >> supposed to be user-modified to contain local settings for serial ports > >> (uncluding USB serial). > >> Now it is moved to /etc/rc.d/serial largely unchanged and is still > >> supposed to be user-modified. > > > > We can change this script to advise the user to copy it to /usr/local/etc/rc.d. > > Yes, we could. However, /usr/local/etc/rc.d has its limitations > comparing to /etc/rc.d: > it is not possible to run a script from /usr/local/etc/rc.d before > FILESYSTEMS > early/late divider that is critical if one needs to query local UPS over > serial port > to ensure its battery has enough energy (say, above 5%) to delay fs > mounts until it charges enough. > For example, statically linked "apctest" utility placed to /root/bin/ > does that just fine > with some small scripting. > > You see, my point is that you can never know beforehand of all > challenges a sysadmin faces in fields. > And there should be really good reason to break things that work before. > Like, solving some significant issue we have with current setup. Do we > have such? This is not affected by my changes, you can install *additional* things in /etc/rc.d and they won't be touched just as today. We can also make the rc subsystem more flexible to handle more things.. Regards, Brad Davis From owner-svn-src-head@freebsd.org Thu Jun 7 15:18:13 2018 Return-Path: Delivered-To: svn-src-head@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 AFDD2FE051E for ; Thu, 7 Jun 2018 15:18:13 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB1F6EFD0 for ; Thu, 7 Jun 2018 15:18:13 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w57FHwhJ068280 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Jun 2018 17:17:59 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w57FHoEZ024459 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 7 Jun 2018 22:17:51 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Brad Davis , Ian Lepore , rgrimes@FreeBSD.org References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> <5B19453E.1030503@grosbein.net> <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> Cc: Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Eugene Grosbein Message-ID: <5B194C98.2050109@grosbein.net> Date: Thu, 7 Jun 2018 22:17:44 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:18:13 -0000 07.06.2018 22:00, Brad Davis wrote: >> You see, my point is that you can never know beforehand of all >> challenges a sysadmin faces in fields. >> And there should be really good reason to break things that work before. >> Like, solving some significant issue we have with current setup. Do we >> have such? > > This is not affected by my changes, you can install *additional* things in /etc/rc.d and they won't be touched just as today. Do we have any convention on naming such custom additional scripts installed in /etc/rc.d locally so that installworld would never overwrite them silently? Addition of custom code to /etc/rc.d/serial guarantees that currently it won't and mergemaster deals with possible conflicts. From owner-svn-src-head@freebsd.org Thu Jun 7 15:27:08 2018 Return-Path: Delivered-To: svn-src-head@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 203FEFE11B4; Thu, 7 Jun 2018 15:27:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C79766F832; Thu, 7 Jun 2018 15:27:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8CED21F61; Thu, 7 Jun 2018 15:27:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57FR7fI092268; Thu, 7 Jun 2018 15:27:07 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57FR7e7092267; Thu, 7 Jun 2018 15:27:07 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806071527.w57FR7e7092267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jun 2018 15:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334788 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 334788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:27:08 -0000 Author: sbruno Date: Thu Jun 7 15:27:07 2018 New Revision: 334788 URL: https://svnweb.freebsd.org/changeset/base/334788 Log: Unbreak dtrace runtime for udp after svn r334719 SO_REUSEPORT commit. Submitted by: Johannes Lundberg Sponsored by: Limeligght Networks Modified: head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Thu Jun 7 15:03:47 2018 (r334787) +++ head/cddl/lib/libdtrace/udp.d Thu Jun 7 15:27:07 2018 (r334788) @@ -58,12 +58,12 @@ translator udpsinfo_t < struct inpcb *p > { udps_rport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_fport); udps_laddr = p == NULL ? "" : p->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : - inet_ntoa6(&p->inp_inc.inc_ie.ie_dependladdr.ie6_local); + inet_ntoa(&p->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->inp_inc.inc_ie.ie_dependladdr.id6_addr); udps_raddr = p == NULL ? "" : p->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : - inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); + inet_ntoa(&p->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.id6_addr); }; #pragma D binding "1.6.3" translator From owner-svn-src-head@freebsd.org Thu Jun 7 15:59:09 2018 Return-Path: Delivered-To: svn-src-head@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 3C7A8FE287D; Thu, 7 Jun 2018 15:59:09 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFD337124A; Thu, 7 Jun 2018 15:59:08 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE8B222461; Thu, 7 Jun 2018 15:59:08 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57Fx8aj007406; Thu, 7 Jun 2018 15:59:08 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57Fx8Xq007405; Thu, 7 Jun 2018 15:59:08 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201806071559.w57Fx8Xq007405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Thu, 7 Jun 2018 15:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334790 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 334790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:59:09 -0000 Author: leitao Date: Thu Jun 7 15:59:08 2018 New Revision: 334790 URL: https://svnweb.freebsd.org/changeset/base/334790 Log: dev/ofw: Fix ofw_fdt_getprop() return values to match documentation Fix the behavior of ofw_fdt_getprop() and ofw_fdt_getprop() functions to match the documentation as the non-fdt code. Submitted by: Luis Pires Reviewed by: manu, jhibbits Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D15680 Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Thu Jun 7 15:51:23 2018 (r334789) +++ head/sys/dev/ofw/ofw_fdt.c Thu Jun 7 15:59:08 2018 (r334790) @@ -279,8 +279,6 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t package, const ch /* Emulate the 'name' property */ name = fdt_get_name(fdtp, offset, &len); strncpy(buf, name, buflen); - if (len + 1 > buflen) - len = buflen; return (len + 1); } @@ -299,9 +297,8 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t package, const ch if (prop == NULL) return (-1); - if (len > buflen) - len = buflen; - bcopy(prop, buf, len); + bcopy(prop, buf, min(len, buflen)); + return (len); } From owner-svn-src-head@freebsd.org Thu Jun 7 16:16:23 2018 Return-Path: Delivered-To: svn-src-head@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 608A2FE2EB0; Thu, 7 Jun 2018 16:16:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1313F71D77; Thu, 7 Jun 2018 16:16:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E514F227A3; Thu, 7 Jun 2018 16:16:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57GGMWD017646; Thu, 7 Jun 2018 16:16:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57GGMIo017645; Thu, 7 Jun 2018 16:16:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806071616.w57GGMIo017645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jun 2018 16:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334791 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 334791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 16:16:23 -0000 Author: bdrewery Date: Thu Jun 7 16:16:22 2018 New Revision: 334791 URL: https://svnweb.freebsd.org/changeset/base/334791 Log: Stop using head(1) which is not available in installworld. installworld should not be executing this anyhow but there is some obscure case doing it still. The head(1) binary is not part of ITOOLS and there's no need to add it. MFC after: 1 week Sponsored by: Dell EMC Modified: head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Thu Jun 7 15:59:08 2018 (r334790) +++ head/share/mk/bsd.linker.mk Thu Jun 7 16:16:22 2018 (r334791) @@ -49,7 +49,7 @@ ${var}= ${${var}.${${X_}_ld_hash}} .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) -_ld_version!= (${${ld}} --version || echo none) | head -n 1 +_ld_version!= (${${ld}} --version || echo none) | sed -n '1,1p' .if ${_ld_version} == "none" .warning Unable to determine linker type from ${ld}=${${ld}} .endif From owner-svn-src-head@freebsd.org Thu Jun 7 16:44:20 2018 Return-Path: Delivered-To: svn-src-head@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 AC995FE3E6E; Thu, 7 Jun 2018 16:44:20 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 605B4737C4; Thu, 7 Jun 2018 16:44:20 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5132E1C36; Thu, 7 Jun 2018 16:44:20 +0000 (UTC) Date: Thu, 7 Jun 2018 16:44:20 +0000 From: Alexey Dokuchaev To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334791 - head/share/mk Message-ID: <20180607164420.GA93814@FreeBSD.org> References: <201806071616.w57GGMIo017645@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806071616.w57GGMIo017645@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 16:44:20 -0000 On Thu, Jun 07, 2018 at 04:16:22PM +0000, Bryan Drewery wrote: > New Revision: 334791 > URL: https://svnweb.freebsd.org/changeset/base/334791 > > Log: > Stop using head(1) which is not available in installworld. > ... > @@ -49,7 +49,7 @@ ${var}= ${${var}.${${X_}_ld_hash}} > > .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) > .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) > -_ld_version!= (${${ld}} --version || echo none) | head -n 1 > +_ld_version!= (${${ld}} --version || echo none) | sed -n '1,1p' You don't need to specify the range actually, and the quotes. Simple `sed -n 1p' looks shorter and does not raise unnecessary questions. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 17:04:35 2018 Return-Path: Delivered-To: svn-src-head@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 25E85FE498F; Thu, 7 Jun 2018 17:04:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C961B74658; Thu, 7 Jun 2018 17:04:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAA4F22FDE; Thu, 7 Jun 2018 17:04:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57H4YUY044328; Thu, 7 Jun 2018 17:04:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57H4Yhb044326; Thu, 7 Jun 2018 17:04:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806071704.w57H4Yhb044326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 7 Jun 2018 17:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334799 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 334799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 17:04:35 -0000 Author: kib Date: Thu Jun 7 17:04:34 2018 New Revision: 334799 URL: https://svnweb.freebsd.org/changeset/base/334799 Log: Account for dmap limit when selecting the pages for the bootstrap pagetables. physmap[] can be inconsistent with the physical memory limit due to buggy bios, or to the hw.physmem tunable. Since bootstrap pagetables are initialized by accesses through the DMAP, we must ensure that DMAP really cover the selected pages. This is only relevant when machine has less than 4G RAM and buggy BIOS, which is the combination on Acer Chromebook 720. The call to mp_bootaddress() is moved later to have Maxmem initialized. An alternative could be to always cover 4G for DMAP, but this change seems to be simpler. Reported and tested by: grembo Reviewed by: royger Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15675 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Jun 7 16:35:09 2018 (r334798) +++ head/sys/amd64/amd64/machdep.c Thu Jun 7 17:04:34 2018 (r334799) @@ -1248,15 +1248,6 @@ getmemsize(caddr_t kmdp, u_int64_t first) } /* - * Make hole for "AP -> long mode" bootstrap code. The - * mp_bootaddress vector is only available when the kernel - * is configured to support APs and APs for the system start - * in real mode mode (e.g. SMP bare metal). - */ - if (init_ops.mp_bootaddress) - init_ops.mp_bootaddress(physmap, &physmap_idx); - - /* * Maxmem isn't the "maximum memory", it's one larger than the * highest page of the physical address space. It should be * called something like "Maxphyspage". We may adjust this @@ -1293,6 +1284,15 @@ getmemsize(caddr_t kmdp, u_int64_t first) if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); + + /* + * Make hole for "AP -> long mode" bootstrap code. The + * mp_bootaddress vector is only available when the kernel + * is configured to support APs and APs for the system start + * in real mode mode (e.g. SMP bare metal). + */ + if (init_ops.mp_bootaddress) + init_ops.mp_bootaddress(physmap, &physmap_idx); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(&first); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Jun 7 16:35:09 2018 (r334798) +++ head/sys/amd64/amd64/mp_machdep.c Thu Jun 7 17:04:34 2018 (r334799) @@ -113,12 +113,16 @@ mp_bootaddress(vm_paddr_t *physmap, unsigned int *phys allocated = false; for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { /* - * Find a memory region big enough below the 4GB boundary to - * store the initial page tables. Note that it needs to be - * aligned to a page boundary. + * Find a memory region big enough below the 4GB + * boundary to store the initial page tables. Region + * must be mapped by the direct map. + * + * Note that it needs to be aligned to a page + * boundary. */ - if (physmap[i] >= GiB(4) || - (physmap[i + 1] - round_page(physmap[i])) < (PAGE_SIZE * 3)) + if (physmap[i] >= GiB(4) || physmap[i + 1] - + round_page(physmap[i]) < PAGE_SIZE * 3 || + physmap[i + 1] > Maxmem) continue; allocated = true; From owner-svn-src-head@freebsd.org Thu Jun 7 17:05:52 2018 Return-Path: Delivered-To: svn-src-head@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 A7144FE4A4D; Thu, 7 Jun 2018 17:05:52 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E30E747E5; Thu, 7 Jun 2018 17:05:52 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 46C8624EB; Thu, 7 Jun 2018 17:05:52 +0000 (UTC) Date: Thu, 7 Jun 2018 17:05:52 +0000 From: Alexey Dokuchaev To: Bryan Drewery Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r334791 - head/share/mk Message-ID: <20180607170552.GB93814@FreeBSD.org> References: <201806071616.w57GGMIo017645@repo.freebsd.org> <20180607164420.GA93814@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607164420.GA93814@FreeBSD.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 17:05:53 -0000 On Thu, Jun 07, 2018 at 04:44:20PM +0000, Alexey Dokuchaev wrote: > On Thu, Jun 07, 2018 at 04:16:22PM +0000, Bryan Drewery wrote: > > New Revision: 334791 > > URL: https://svnweb.freebsd.org/changeset/base/334791 > > > > Log: > > Stop using head(1) which is not available in installworld. > > ... > > @@ -49,7 +49,7 @@ ${var}= ${${var}.${${X_}_ld_hash}} > > > > .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) > > .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) > > -_ld_version!= (${${ld}} --version || echo none) | head -n 1 > > +_ld_version!= (${${ld}} --version || echo none) | sed -n '1,1p' > > You don't need to specify the range actually, and the quotes. Simple > `sed -n 1p' looks shorter and does not raise unnecessary questions. Actually, `sed q' is sufficient. ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 18:06:02 2018 Return-Path: Delivered-To: svn-src-head@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 3C5FEFE6A00; Thu, 7 Jun 2018 18:06:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF6BD7712F; Thu, 7 Jun 2018 18:06:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1CFB239B9; Thu, 7 Jun 2018 18:06:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57I61VQ074573; Thu, 7 Jun 2018 18:06:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57I61bt074572; Thu, 7 Jun 2018 18:06:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806071806.w57I61bt074572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Jun 2018 18:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334803 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/usr.bin/grep X-SVN-Commit-Revision: 334803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:06:02 -0000 Author: kevans Date: Thu Jun 7 18:06:01 2018 New Revision: 334803 URL: https://svnweb.freebsd.org/changeset/base/334803 Log: netbsd-tests: grep(1): Add test for -c flag Someone might be inclined to accidentally break this. someone might have written said test because they broke it locally. Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Jun 7 18:01:31 2018 (r334802) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Jun 7 18:06:01 2018 (r334803) @@ -716,6 +716,22 @@ fgrep_oflag_body() atf_check -s exit:1 grep -Fo "ghix" test1 atf_check -s exit:1 grep -Fo "abcdefghiklmnopqrstuvwxyz" test1 } + +atf_test_case cflag +cflag_head() +{ + atf_set "descr" "Check proper handling of -c" +} +cflag_body() +{ + printf "a\nb\nc\n" > test1 + + atf_check -o inline:"1\n" grep -Ec "a" test1 + atf_check -o inline:"2\n" grep -Ec "a|b" test1 + atf_check -o inline:"3\n" grep -Ec "a|b|c" test1 + + atf_check -o inline:"test1:2\n" grep -EHc "a|b" test1 +} # End FreeBSD atf_init_test_cases() @@ -759,5 +775,6 @@ atf_init_test_cases() atf_add_test_case fgrep_multipattern atf_add_test_case fgrep_icase atf_add_test_case fgrep_oflag + atf_add_test_case cflag # End FreeBSD } From owner-svn-src-head@freebsd.org Thu Jun 7 18:18:16 2018 Return-Path: Delivered-To: svn-src-head@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 24DA3FE7264; Thu, 7 Jun 2018 18:18:16 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C87EE77B01; Thu, 7 Jun 2018 18:18:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA57023B71; Thu, 7 Jun 2018 18:18:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IIF3f080103; Thu, 7 Jun 2018 18:18:15 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IIENp080093; Thu, 7 Jun 2018 18:18:14 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806071818.w57IIENp080093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 7 Jun 2018 18:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys X-SVN-Commit-Revision: 334804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:18:16 -0000 Author: rrs Date: Thu Jun 7 18:18:13 2018 New Revision: 334804 URL: https://svnweb.freebsd.org/changeset/base/334804 Log: This commit brings in a new refactored TCP stack called Rack. Rack includes the following features: - A different SACK processing scheme (the old sack structures are not used). - RACK (Recent acknowledgment) where counting dup-acks is no longer done instead time is used to knwo when to retransmit. (see the I-D) - TLP (Tail Loss Probe) where we will probe for tail-losses to attempt to try not to take a retransmit time-out. (see the I-D) - Burst mitigation using TCPHTPS - PRR (partial rate reduction) see the RFC. Once built into your kernel, you can select this stack by either socket option with the name of the stack is "rack" or by setting the global sysctl so the default is rack. Note that any connection that does not support SACK will be kicked back to the "default" base FreeBSD stack (currently known as "default"). To build this into your kernel you will need to enable in your kernel: makeoptions WITH_EXTRA_TCP_STACKS=1 options TCPHPTS Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15525 Added: head/sys/modules/tcp/rack/ head/sys/modules/tcp/rack/Makefile (contents, props changed) head/sys/netinet/tcp_stacks/rack.c (contents, props changed) head/sys/netinet/tcp_stacks/rack_bbr_common.h (contents, props changed) head/sys/netinet/tcp_stacks/sack_filter.c (contents, props changed) head/sys/netinet/tcp_stacks/sack_filter.h (contents, props changed) head/sys/netinet/tcp_stacks/tcp_rack.h (contents, props changed) Modified: head/sys/kern/uipc_sockbuf.c head/sys/modules/tcp/Makefile head/sys/netinet/tcp.h head/sys/netinet/tcp_log_buf.h head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h head/sys/sys/mbuf.h head/sys/sys/queue.h head/sys/sys/sockbuf.h head/sys/sys/time.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/kern/uipc_sockbuf.c Thu Jun 7 18:18:13 2018 (r334804) @@ -1283,6 +1283,55 @@ sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_i return (ret); } +struct mbuf * +sbsndptr_noadv(struct sockbuf *sb, uint32_t off, uint32_t *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + *moff = off; + if (sb->sb_sndptr == NULL) { + sb->sb_sndptr = sb->sb_mb; + sb->sb_sndptroff = 0; + } + return (sb->sb_mb); + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + *moff = off; + return (m); +} + +void +sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, uint32_t len) +{ + /* + * A small copy was done, advance forward the sb_sbsndptr to cover + * it. + */ + struct mbuf *m; + + if (mb != sb->sb_sndptr) { + /* Did not copyout at the same mbuf */ + return; + } + m = mb; + while (m && (len > 0)) { + if (len >= m->m_len) { + len -= m->m_len; + if (m->m_next) { + sb->sb_sndptroff += m->m_len; + sb->sb_sndptr = m->m_next; + } + m = m->m_next; + } else { + len = 0; + } + } +} + /* * Return the first mbuf and the mbuf data offset for the provided * send offset without changing the "sb_sndptroff" field. Modified: head/sys/modules/tcp/Makefile ============================================================================== --- head/sys/modules/tcp/Makefile Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/modules/tcp/Makefile Thu Jun 7 18:18:13 2018 (r334804) @@ -7,10 +7,12 @@ SYSDIR?=${SRCTOP}/sys SUBDIR= \ ${_tcp_fastpath} \ + ${_tcp_rack} \ ${_tcpmd5} \ .if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) _tcp_fastpath= fastpath +_tcp_rack= rack .endif .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ Added: head/sys/modules/tcp/rack/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tcp/rack/Makefile Thu Jun 7 18:18:13 2018 (r334804) @@ -0,0 +1,24 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../netinet/tcp_stacks + +STACKNAME= rack +KMOD= tcp_${STACKNAME} +SRCS= rack.c sack_filter.c + +SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h +SRCS+= opt_tcpdebug.h +SRCS+= opt_kern_tls.h + +# +# Enable full debugging +# +#CFLAGS += -g + +CFLAGS+= -DMODNAME=${KMOD} +CFLAGS+= -DSTACKNAME=${STACKNAME} +CFLAGS+= -DSTACKALIAS=rack_18q21 + +.include Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/netinet/tcp.h Thu Jun 7 18:18:13 2018 (r334804) @@ -176,6 +176,7 @@ struct tcphdr { device */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ +#define TCP_DELACK 72 /* socket option for delayed ack */ #define TCP_KEEPINIT 128 /* N, time to establish connection */ #define TCP_KEEPIDLE 256 /* L,N,X start keeplives after this period */ #define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ @@ -184,6 +185,61 @@ struct tcphdr { #define TCP_PCAP_OUT 2048 /* number of output packets to keep */ #define TCP_PCAP_IN 4096 /* number of input packets to keep */ #define TCP_FUNCTION_BLK 8192 /* Set the tcp function pointers to the specified stack */ +/* Options for Rack and BBR */ +#define TCP_RACK_PROP 1051 /* RACK proportional rate reduction (bool) */ +#define TCP_RACK_TLP_REDUCE 1052 /* RACK TLP cwnd reduction (bool) */ +#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacing reduction factor (divisor) */ +#define TCP_RACK_PACE_MAX_SEG 1054 /* Max segments in a pace */ +#define TCP_RACK_PACE_ALWAYS 1055 /* Use the always pace method */ +#define TCP_RACK_PROP_RATE 1056 /* The proportional reduction rate */ +#define TCP_RACK_PRR_SENDALOT 1057 /* Allow PRR to send more than one seg */ +#define TCP_RACK_MIN_TO 1058 /* Minimum time between rack t-o's in ms */ +#define TCP_RACK_EARLY_RECOV 1059 /* Should recovery happen early (bool) */ +#define TCP_RACK_EARLY_SEG 1060 /* If early recovery max segments */ +#define TCP_RACK_REORD_THRESH 1061 /* RACK reorder threshold (shift amount) */ +#define TCP_RACK_REORD_FADE 1062 /* Does reordering fade after ms time */ +#define TCP_RACK_TLP_THRESH 1063 /* RACK TLP theshold i.e. srtt+(srtt/N) */ +#define TCP_RACK_PKT_DELAY 1064 /* RACK added ms i.e. rack-rtt + reord + N */ +#define TCP_RACK_TLP_INC_VAR 1065 /* Does TLP include rtt variance in t-o */ +#define TCP_RACK_SESS_CWV 1066 /* Enable RFC7611 cwnd validation on sess */ +#define TCP_BBR_IWINTSO 1067 /* Initial TSO window for BBRs first sends */ +#define TCP_BBR_RECFORCE 1068 /* Enter recovery force out a segment disregard pacer */ +#define TCP_BBR_STARTUP_PG 1069 /* Startup pacing gain */ +#define TCP_BBR_DRAIN_PG 1070 /* Drain pacing gain */ +#define TCP_BBR_RWND_IS_APP 1071 /* Rwnd limited is considered app limited */ +#define TCP_BBR_PROBE_RTT_INT 1072 /* How long in useconds between probe-rtt */ +#define TCP_BBR_ONE_RETRAN 1073 /* Is only one segment allowed out during retran */ +#define TCP_BBR_STARTUP_LOSS_EXIT 1074 /* Do we exit a loss during startup if not 20% incr */ +#define TCP_BBR_USE_LOWGAIN 1075 /* lower the gain in PROBE_BW enable */ +#define TCP_BBR_LOWGAIN_THRESH 1076 /* How many cycles do we stay in lowgain */ +#define TCP_BBR_LOWGAIN_HALF 1077 /* Do we halfstep lowgain down */ +#define TCP_BBR_LOWGAIN_FD 1078 /* Do we force a drain when lowgain in place */ +#define TCP_BBR_USEDEL_RATE 1079 /* Enable use of delivery rate for loss recovery */ +#define TCP_BBR_MIN_RTO 1080 /* Min RTO in milliseconds */ +#define TCP_BBR_MAX_RTO 1081 /* Max RTO in milliseconds */ +#define TCP_BBR_REC_OVER_HPTS 1082 /* Recovery override htps settings 0/1/3 */ +#define TCP_BBR_UNLIMITED 1083 /* Does BBR, in non-recovery not use cwnd */ +#define TCP_BBR_DRAIN_INC_EXTRA 1084 /* Does the 3/4 drain target include the extra gain */ +#define TCP_BBR_STARTUP_EXIT_EPOCH 1085 /* what epoch gets us out of startup */ +#define TCP_BBR_PACE_PER_SEC 1086 +#define TCP_BBR_PACE_DEL_TAR 1087 +#define TCP_BBR_PACE_SEG_MAX 1088 +#define TCP_BBR_PACE_SEG_MIN 1089 +#define TCP_BBR_PACE_CROSS 1090 +#define TCP_RACK_IDLE_REDUCE_HIGH 1092 /* Reduce the highest cwnd seen to IW on idle */ +#define TCP_RACK_IDLE_REDUCE_HIGH 1092 /* Reduce the highest cwnd seen to IW on idle */ +#define TCP_RACK_MIN_PACE 1093 /* Do we enforce rack min pace time */ +#define TCP_RACK_MIN_PACE_SEG 1094 /* If so what is the seg threshould */ +#define TCP_RACK_TLP_USE 1095 +#define TCP_BBR_ACK_COMP_ALG 1096 /* Not used */ +#define TCP_BBR_EXTRA_GAIN 1097 +#define TCP_BBR_RACK_RTT_USE 1098 /* what RTT should we use 0, 1, or 2? */ +#define TCP_BBR_RETRAN_WTSO 1099 +#define TCP_DATA_AFTER_CLOSE 1100 +#define TCP_BBR_PROBE_RTT_GAIN 1101 +#define TCP_BBR_PROBE_RTT_LEN 1102 + + /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR Modified: head/sys/netinet/tcp_log_buf.h ============================================================================== --- head/sys/netinet/tcp_log_buf.h Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/netinet/tcp_log_buf.h Thu Jun 7 18:18:13 2018 (r334804) @@ -94,7 +94,7 @@ struct tcp_log_bbr { uint16_t flex7; uint8_t bbr_state; uint8_t bbr_substate; - uint8_t inpacer; + uint8_t inhpts; uint8_t ininput; uint8_t use_lt_bw; uint8_t flex8; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/netinet/tcp_output.c Thu Jun 7 18:18:13 2018 (r334804) @@ -143,18 +143,13 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto_lowat tcp_timer_active((tp), TT_PERSIST), \ ("neither rexmt nor persist timer is set")) -#ifdef TCP_HHOOK -static void inline hhook_run_tcp_est_out(struct tcpcb *tp, - struct tcphdr *th, struct tcpopt *to, - uint32_t len, int tso); -#endif static void inline cc_after_idle(struct tcpcb *tp); #ifdef TCP_HHOOK /* * Wrapper for the TCP established output helper hook. */ -static void inline +void hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, uint32_t len, int tso) { @@ -1849,6 +1844,144 @@ tcp_addoptions(struct tcpopt *to, u_char *optp) KASSERT(optlen <= TCP_MAXOLEN, ("%s: TCP options too long", __func__)); return (optlen); +} + +/* + * This is a copy of m_copym(), taking the TSO segment size/limit + * constraints into account, and advancing the sndptr as it goes. + */ +struct mbuf * +tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, + int32_t seglimit, int32_t segsize, struct sockbuf *sb) +{ + struct mbuf *n, **np; + struct mbuf *top; + int32_t off = off0; + int32_t len = *plen; + int32_t fragsize; + int32_t len_cp = 0; + int32_t *pkthdrlen; + uint32_t mlen, frags; + bool copyhdr; + + + KASSERT(off >= 0, ("tcp_m_copym, negative off %d", off)); + KASSERT(len >= 0, ("tcp_m_copym, negative len %d", len)); + if (off == 0 && m->m_flags & M_PKTHDR) + copyhdr = true; + else + copyhdr = false; + while (off > 0) { + KASSERT(m != NULL, ("tcp_m_copym, offset > size of mbuf chain")); + if (off < m->m_len) + break; + off -= m->m_len; + if ((sb) && (m == sb->sb_sndptr)) { + sb->sb_sndptroff += m->m_len; + sb->sb_sndptr = m->m_next; + } + m = m->m_next; + } + np = ⊤ + top = NULL; + pkthdrlen = NULL; + while (len > 0) { + if (m == NULL) { + KASSERT(len == M_COPYALL, + ("tcp_m_copym, length > size of mbuf chain")); + *plen = len_cp; + if (pkthdrlen != NULL) + *pkthdrlen = len_cp; + break; + } + mlen = min(len, m->m_len - off); + if (seglimit) { + /* + * For M_NOMAP mbufs, add 3 segments + * + 1 in case we are crossing page boundaries + * + 2 in case the TLS hdr/trailer are used + * It is cheaper to just add the segments + * than it is to take the cache miss to look + * at the mbuf ext_pgs state in detail. + */ + if (m->m_flags & M_NOMAP) { + fragsize = min(segsize, PAGE_SIZE); + frags = 3; + } else { + fragsize = segsize; + frags = 0; + } + + /* Break if we really can't fit anymore. */ + if ((frags + 1) >= seglimit) { + *plen = len_cp; + if (pkthdrlen != NULL) + *pkthdrlen = len_cp; + break; + } + + /* + * Reduce size if you can't copy the whole + * mbuf. If we can't copy the whole mbuf, also + * adjust len so the loop will end after this + * mbuf. + */ + if ((frags + howmany(mlen, fragsize)) >= seglimit) { + mlen = (seglimit - frags - 1) * fragsize; + len = mlen; + *plen = len_cp + len; + if (pkthdrlen != NULL) + *pkthdrlen = *plen; + } + frags += howmany(mlen, fragsize); + if (frags == 0) + frags++; + seglimit -= frags; + KASSERT(seglimit > 0, + ("%s: seglimit went too low", __func__)); + } + if (copyhdr) + n = m_gethdr(M_NOWAIT, m->m_type); + else + n = m_get(M_NOWAIT, m->m_type); + *np = n; + if (n == NULL) + goto nospace; + if (copyhdr) { + if (!m_dup_pkthdr(n, m, M_NOWAIT)) + goto nospace; + if (len == M_COPYALL) + n->m_pkthdr.len -= off0; + else + n->m_pkthdr.len = len; + pkthdrlen = &n->m_pkthdr.len; + copyhdr = false; + } + n->m_len = mlen; + len_cp += n->m_len; + if (m->m_flags & M_EXT) { + n->m_data = m->m_data + off; + mb_dupcl(n, m); + } else + bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t), + (u_int)n->m_len); + + if (sb && (sb->sb_sndptr == m) && + ((n->m_len + off) >= m->m_len) && m->m_next) { + sb->sb_sndptroff += m->m_len; + sb->sb_sndptr = m->m_next; + } + off = 0; + if (len != M_COPYALL) { + len -= n->m_len; + } + m = m->m_next; + np = &n->m_next; + } + return (top); +nospace: + m_freem(top); + return (NULL); } void Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 7 18:06:01 2018 (r334803) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 7 18:18:13 2018 (r334804) @@ -2392,7 +2392,7 @@ struct tcp_function_block __tcp_fastack = { static int tcp_addfastpaths(module_t mod, int type, void *data) { - int err=0; + int err = 0; switch (type) { case MOD_LOAD: Added: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_stacks/rack.c Thu Jun 7 18:18:13 2018 (r334804) @@ -0,0 +1,9164 @@ +/*- + * Copyright (c) 2016-2018 + * Netflix Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipsec.h" +#include "opt_tcpdebug.h" + +#include +#include +#include +#ifdef TCP_HHOOK +#include +#endif +#include +#include +#include +#include +#include +#include /* for proc0 declaration */ +#include +#include +#include +#include +#ifdef NETFLIX_STATS +#include +#endif +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define TCPSTATES /* for logging */ + +#include +#include +#include +#include +#include /* required for icmp_var.h */ +#include /* for ICMP_BANDLIM */ +#include +#include +#include +#include +#define TCPOUTFLAGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef NETFLIX_CWV +#include +#endif +#include +#ifdef TCPDEBUG +#include +#endif /* TCPDEBUG */ +#ifdef TCP_OFFLOAD +#include +#endif +#ifdef INET6 +#include +#endif + +#include + +#if defined(IPSEC) || defined(IPSEC_SUPPORT) +#include +#include +#endif /* IPSEC */ + +#include +#include +#include + +#ifdef MAC +#include +#endif +#include "sack_filter.h" +#include "tcp_rack.h" +#include "rack_bbr_common.h" + +uma_zone_t rack_zone; +uma_zone_t rack_pcb_zone; + +#ifndef TICKS2SBT +#define TICKS2SBT(__t) (tick_sbt * ((sbintime_t)(__t))) +#endif + +struct sysctl_ctx_list rack_sysctl_ctx; +struct sysctl_oid *rack_sysctl_root; + +#ifndef TCPHPTS +fatal error missing option TCPHSTS in the build; +#endif + +#define CUM_ACKED 1 +#define SACKED 2 + +/* + * The RACK module incorporates a number of + * TCP ideas that have been put out into the IETF + * over the last few years: + * - Matt Mathis's Rate Halving which slowly drops + * the congestion window so that the ack clock can + * be maintained during a recovery. + * - Yuchung Cheng's RACK TCP (for which its named) that + * will stop us using the number of dup acks and instead + * use time as the gage of when we retransmit. + * - Reorder Detection of RFC4737 and the Tail-Loss probe draft + * of Dukkipati et.al. + * RACK depends on SACK, so if an endpoint arrives that + * cannot do SACK the state machine below will shuttle the + * connection back to using the "default" TCP stack that is + * in FreeBSD. + * + * To implement RACK the original TCP stack was first decomposed + * into a functional state machine with individual states + * for each of the possible TCP connection states. The do_segement + * functions role in life is to mandate the connection supports SACK + * initially and then assure that the RACK state matches the conenction + * state before calling the states do_segment function. Each + * state is simplified due to the fact that the original do_segment + * has been decomposed and we *know* what state we are in (no + * switches on the state) and all tests for SACK are gone. This + * greatly simplifies what each state does. + * + * TCP output is also over-written with a new version since it + * must maintain the new rack scoreboard. + * + */ +static int32_t rack_precache = 1; +static int32_t rack_tlp_thresh = 1; +static int32_t rack_reorder_thresh = 2; +static int32_t rack_reorder_fade = 60000; /* 0 - never fade, def 60,000 + * - 60 seconds */ +static int32_t rack_pkt_delay = 1; +static int32_t rack_inc_var = 0;/* For TLP */ +static int32_t rack_reduce_largest_on_idle = 0; +static int32_t rack_min_pace_time = 0; +static int32_t rack_min_pace_time_seg_req=6; +static int32_t rack_early_recovery = 1; +static int32_t rack_early_recovery_max_seg = 6; +static int32_t rack_send_a_lot_in_prr = 1; +static int32_t rack_min_to = 1; /* Number of ms minimum timeout */ +static int32_t rack_tlp_in_recovery = 1; /* Can we do TLP in recovery? */ +static int32_t rack_verbose_logging = 0; +static int32_t rack_ignore_data_after_close = 1; +/* + * Currently regular tcp has a rto_min of 30ms + * the backoff goes 12 times so that ends up + * being a total of 122.850 seconds before a + * connection is killed. + */ +static int32_t rack_tlp_min = 10; +static int32_t rack_rto_min = 30; /* 30ms same as main freebsd */ +static int32_t rack_rto_max = 30000; /* 30 seconds */ +static const int32_t rack_free_cache = 2; +static int32_t rack_hptsi_segments = 40; +static int32_t rack_rate_sample_method = USE_RTT_LOW; +static int32_t rack_pace_every_seg = 1; +static int32_t rack_delayed_ack_time = 200; /* 200ms */ +static int32_t rack_slot_reduction = 4; +static int32_t rack_lower_cwnd_at_tlp = 0; +static int32_t rack_use_proportional_reduce = 0; +static int32_t rack_proportional_rate = 10; +static int32_t rack_tlp_max_resend = 2; +static int32_t rack_limited_retran = 0; +static int32_t rack_always_send_oldest = 0; +static int32_t rack_sack_block_limit = 128; +static int32_t rack_use_sack_filter = 1; +static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; + +/* Rack specific counters */ +counter_u64_t rack_badfr; +counter_u64_t rack_badfr_bytes; +counter_u64_t rack_rtm_prr_retran; +counter_u64_t rack_rtm_prr_newdata; +counter_u64_t rack_timestamp_mismatch; +counter_u64_t rack_reorder_seen; +counter_u64_t rack_paced_segments; +counter_u64_t rack_unpaced_segments; +counter_u64_t rack_saw_enobuf; +counter_u64_t rack_saw_enetunreach; + +/* Tail loss probe counters */ +counter_u64_t rack_tlp_tot; +counter_u64_t rack_tlp_newdata; +counter_u64_t rack_tlp_retran; +counter_u64_t rack_tlp_retran_bytes; +counter_u64_t rack_tlp_retran_fail; +counter_u64_t rack_to_tot; +counter_u64_t rack_to_arm_rack; +counter_u64_t rack_to_arm_tlp; +counter_u64_t rack_to_alloc; +counter_u64_t rack_to_alloc_hard; +counter_u64_t rack_to_alloc_emerg; + +counter_u64_t rack_sack_proc_all; +counter_u64_t rack_sack_proc_short; +counter_u64_t rack_sack_proc_restart; +counter_u64_t rack_runt_sacks; +counter_u64_t rack_used_tlpmethod; +counter_u64_t rack_used_tlpmethod2; +counter_u64_t rack_enter_tlp_calc; +counter_u64_t rack_input_idle_reduces; +counter_u64_t rack_tlp_does_nada; + +/* Temp CPU counters */ +counter_u64_t rack_find_high; + +counter_u64_t rack_progress_drops; +counter_u64_t rack_out_size[TCP_MSS_ACCT_SIZE]; +counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; + +static void +rack_log_progress_event(struct tcp_rack *rack, struct tcpcb *tp, uint32_t tick, int event, int line); + +static int +rack_process_ack(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t * ti_locked, + uint32_t tiwin, int32_t tlen, int32_t * ofia, int32_t thflags, int32_t * ret_val); +static int +rack_process_data(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, + int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static void +rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, + struct tcphdr *th, uint16_t nsegs, uint16_t type, int32_t recovery); +static struct rack_sendmap *rack_alloc(struct tcp_rack *rack); +static struct rack_sendmap * +rack_check_recovery_mode(struct tcpcb *tp, + uint32_t tsused); +static void +rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, + uint32_t type); +static void rack_counter_destroy(void); +static int +rack_ctloutput(struct socket *so, struct sockopt *sopt, + struct inpcb *inp, struct tcpcb *tp); +static int32_t rack_ctor(void *mem, int32_t size, void *arg, int32_t how); +static void +rack_do_segment(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, + uint8_t iptos, int32_t ti_locked); +static void rack_dtor(void *mem, int32_t size, void *arg); +static void +rack_earlier_retran(struct tcpcb *tp, struct rack_sendmap *rsm, + uint32_t t, uint32_t cts); +static struct rack_sendmap * +rack_find_high_nonack(struct tcp_rack *rack, + struct rack_sendmap *rsm); +static struct rack_sendmap *rack_find_lowest_rsm(struct tcp_rack *rack); +static void rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm); +static void rack_fini(struct tcpcb *tp, int32_t tcb_is_purged); +static int +rack_get_sockopt(struct socket *so, struct sockopt *sopt, + struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack); +static int32_t rack_handoff_ok(struct tcpcb *tp); +static int32_t rack_init(struct tcpcb *tp); +static void rack_init_sysctls(void); +static void +rack_log_ack(struct tcpcb *tp, struct tcpopt *to, + struct tcphdr *th); +static void +rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, + uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t ts, + uint8_t pass, struct rack_sendmap *hintrsm); +static void +rack_log_sack_passed(struct tcpcb *tp, struct tcp_rack *rack, + struct rack_sendmap *rsm); +static void rack_log_to_event(struct tcp_rack *rack, int32_t to_num); +static int32_t rack_output(struct tcpcb *tp); +static void +rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, + uint8_t iptos, int32_t ti_locked, int32_t nxt_pkt, struct timeval *tv); + +static uint32_t +rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, + struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, + uint32_t cts); +static void rack_post_recovery(struct tcpcb *tp, struct tcphdr *th); +static void rack_remxt_tmr(struct tcpcb *tp); +static int +rack_set_sockopt(struct socket *so, struct sockopt *sopt, + struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack); +static void rack_set_state(struct tcpcb *tp, struct tcp_rack *rack); +static int32_t rack_stopall(struct tcpcb *tp); +static void +rack_timer_activate(struct tcpcb *tp, uint32_t timer_type, + uint32_t delta); +static int32_t rack_timer_active(struct tcpcb *tp, uint32_t timer_type); +static void rack_timer_cancel(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, int line); +static void rack_timer_stop(struct tcpcb *tp, uint32_t timer_type); +static uint32_t +rack_update_entry(struct tcpcb *tp, struct tcp_rack *rack, + struct rack_sendmap *rsm, uint32_t ts, int32_t * lenp); +static void +rack_update_rsm(struct tcpcb *tp, struct tcp_rack *rack, + struct rack_sendmap *rsm, uint32_t ts); +static int +rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, + struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type); +static int32_t tcp_addrack(module_t mod, int32_t type, void *data); +static void +rack_challenge_ack(struct mbuf *m, struct tcphdr *th, + struct tcpcb *tp, int32_t * ti_locked, int32_t * ret_val); +static int +rack_do_close_wait(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_closing(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static void rack_do_drop(struct mbuf *m, struct tcpcb *tp, int32_t * ti_locked); +static void +rack_do_dropafterack(struct mbuf *m, struct tcpcb *tp, + struct tcphdr *th, int32_t * ti_locked, int32_t thflags, int32_t tlen, int32_t * ret_val); +static void +rack_do_dropwithreset(struct mbuf *m, struct tcpcb *tp, + struct tcphdr *th, int32_t * ti_locked, int32_t rstreason, int32_t tlen); +static int +rack_do_established(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t nxt_pkt); +static int +rack_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_lastack(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, + int32_t tlen, int32_t * ti_locked, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); +static int +rack_drop_checks(struct tcpopt *to, struct mbuf *m, + struct tcphdr *th, struct tcpcb *tp, int32_t * tlenp, int32_t * ti_locked, int32_t * thf, + int32_t * drop_hdrlen, int32_t * ret_val); +static int +rack_process_rst(struct mbuf *m, struct tcphdr *th, + struct socket *so, struct tcpcb *tp, int32_t * ti_locked); +struct rack_sendmap * +tcp_rack_output(struct tcpcb *tp, struct tcp_rack *rack, + uint32_t tsused); +static void tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt); +static void + tcp_rack_partialack(struct tcpcb *tp, struct tcphdr *th); + +static int +rack_ts_check(struct mbuf *m, struct tcphdr *th, + struct tcpcb *tp, int32_t * ti_locked, int32_t tlen, int32_t thflags, int32_t * ret_val); + +int32_t rack_clear_counter=0; + + +static int +sysctl_rack_clear(SYSCTL_HANDLER_ARGS) +{ + uint32_t stat; + int32_t error; + + error = SYSCTL_OUT(req, &rack_clear_counter, sizeof(uint32_t)); + if (error || req->newptr == NULL) + return error; + + error = SYSCTL_IN(req, &stat, sizeof(uint32_t)); + if (error) + return (error); + if (stat == 1) { +#ifdef INVARIANTS + printf("Clearing RACK counters\n"); +#endif + counter_u64_zero(rack_badfr); + counter_u64_zero(rack_badfr_bytes); + counter_u64_zero(rack_rtm_prr_retran); + counter_u64_zero(rack_rtm_prr_newdata); + counter_u64_zero(rack_timestamp_mismatch); + counter_u64_zero(rack_reorder_seen); + counter_u64_zero(rack_tlp_tot); + counter_u64_zero(rack_tlp_newdata); + counter_u64_zero(rack_tlp_retran); + counter_u64_zero(rack_tlp_retran_bytes); + counter_u64_zero(rack_tlp_retran_fail); + counter_u64_zero(rack_to_tot); + counter_u64_zero(rack_to_arm_rack); + counter_u64_zero(rack_to_arm_tlp); + counter_u64_zero(rack_paced_segments); + counter_u64_zero(rack_unpaced_segments); + counter_u64_zero(rack_saw_enobuf); + counter_u64_zero(rack_saw_enetunreach); + counter_u64_zero(rack_to_alloc_hard); + counter_u64_zero(rack_to_alloc_emerg); + counter_u64_zero(rack_sack_proc_all); + counter_u64_zero(rack_sack_proc_short); + counter_u64_zero(rack_sack_proc_restart); + counter_u64_zero(rack_to_alloc); + counter_u64_zero(rack_find_high); + counter_u64_zero(rack_runt_sacks); + counter_u64_zero(rack_used_tlpmethod); + counter_u64_zero(rack_used_tlpmethod2); + counter_u64_zero(rack_enter_tlp_calc); + counter_u64_zero(rack_progress_drops); + counter_u64_zero(rack_tlp_does_nada); + } + rack_clear_counter = 0; + return (0); +} + + + +static void +rack_init_sysctls() +{ + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "rate_sample_method", CTLFLAG_RW, + &rack_rate_sample_method , USE_RTT_LOW, + "What method should we use for rate sampling 0=high, 1=low "); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "data_after_close", CTLFLAG_RW, + &rack_ignore_data_after_close, 0, + "Do we hold off sending a RST until all pending data is ack'd"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "tlpmethod", CTLFLAG_RW, + &rack_tlp_threshold_use, TLP_USE_TWO_ONE, + "What method do we do for TLP time calc 0=no-de-ack-comp, 1=ID, 2=2.1, 3=2.2"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "min_pace_time", CTLFLAG_RW, + &rack_min_pace_time, 0, + "Should we enforce a minimum pace time of 1ms"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "min_pace_segs", CTLFLAG_RW, + &rack_min_pace_time_seg_req, 6, + "How many segments have to be in the len to enforce min-pace-time"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "idle_reduce_high", CTLFLAG_RW, + &rack_reduce_largest_on_idle, 0, + "Should we reduce the largest cwnd seen to IW on idle reduction"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "bb_verbose", CTLFLAG_RW, + &rack_verbose_logging, 0, + "Should RACK black box logging be verbose"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "sackfiltering", CTLFLAG_RW, + &rack_use_sack_filter, 1, + "Do we use sack filtering?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "delayed_ack", CTLFLAG_RW, + &rack_delayed_ack_time, 200, + "Delayed ack time (200ms)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "tlpminto", CTLFLAG_RW, + &rack_tlp_min, 10, + "TLP minimum timeout per the specification (10ms)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "precache", CTLFLAG_RW, + &rack_precache, 0, + "Where should we precache the mcopy (0 is not at all)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "sblklimit", CTLFLAG_RW, + &rack_sack_block_limit, 128, + "When do we start paying attention to small sack blocks"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "send_oldest", CTLFLAG_RW, + &rack_always_send_oldest, 1, + "Should we always send the oldest TLP and RACK-TLP"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "rack_tlp_in_recovery", CTLFLAG_RW, + &rack_tlp_in_recovery, 1, + "Can we do a TLP during recovery?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "rack_tlimit", CTLFLAG_RW, + &rack_limited_retran, 0, + "How many times can a rack timeout drive out sends"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "minrto", CTLFLAG_RW, + &rack_rto_min, 0, + "Minimum RTO in ms -- set with caution below 1000 due to TLP"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "maxrto", CTLFLAG_RW, + &rack_rto_max, 0, + "Maxiumum RTO in ms -- should be at least as large as min_rto"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "tlp_retry", CTLFLAG_RW, + &rack_tlp_max_resend, 2, + "How many times does TLP retry a single segment or multiple with no ACK"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "recovery_loss_prop", CTLFLAG_RW, + &rack_use_proportional_reduce, 0, + "Should we proportionaly reduce cwnd based on the number of losses "); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "recovery_prop", CTLFLAG_RW, + &rack_proportional_rate, 10, + "What percent reduction per loss"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "tlp_cwnd_flag", CTLFLAG_RW, + &rack_lower_cwnd_at_tlp, 0, + "When a TLP completes a retran should we enter recovery?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "hptsi_reduces", CTLFLAG_RW, + &rack_slot_reduction, 4, + "When setting a slot should we reduce by divisor"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "hptsi_every_seg", CTLFLAG_RW, + &rack_pace_every_seg, 1, + "Should we pace out every segment hptsi"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "hptsi_seg_max", CTLFLAG_RW, + &rack_hptsi_segments, 6, + "Should we pace out only a limited size of segments"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "prr_sendalot", CTLFLAG_RW, + &rack_send_a_lot_in_prr, 1, + "Send a lot in prr"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "minto", CTLFLAG_RW, + &rack_min_to, 1, + "Minimum rack timeout in milliseconds"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "earlyrecoveryseg", CTLFLAG_RW, + &rack_early_recovery_max_seg, 6, + "Max segments in early recovery"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "earlyrecovery", CTLFLAG_RW, + &rack_early_recovery, 1, + "Do we do early recovery with rack"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "reorder_thresh", CTLFLAG_RW, + &rack_reorder_thresh, 2, + "What factor for rack will be added when seeing reordering (shift right)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "rtt_tlp_thresh", CTLFLAG_RW, + &rack_tlp_thresh, 1, + "what divisor for TLP rtt/retran will be added (1=rtt, 2=1/2 rtt etc)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "reorder_fade", CTLFLAG_RW, + &rack_reorder_fade, 0, + "Does reorder detection fade, if so how many ms (0 means never)"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "pktdelay", CTLFLAG_RW, + &rack_pkt_delay, 1, + "Extra RACK time (in ms) besides reordering thresh"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "inc_var", CTLFLAG_RW, + &rack_inc_var, 0, + "Should rack add to the TLP timer the variance in rtt calculation"); + rack_badfr = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, "badfr", CTLFLAG_RD, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 7 18:24:26 2018 Return-Path: Delivered-To: svn-src-head@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 34CA8FE7649; Thu, 7 Jun 2018 18:24:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF01C780E3; Thu, 7 Jun 2018 18:24:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8FEA23D1E; Thu, 7 Jun 2018 18:24:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IOPal084783; Thu, 7 Jun 2018 18:24:25 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IOPF8084782; Thu, 7 Jun 2018 18:24:25 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201806071824.w57IOPF8084782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 7 Jun 2018 18:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334805 - head/release/amd64 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/release/amd64 X-SVN-Commit-Revision: 334805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:24:26 -0000 Author: marius Date: Thu Jun 7 18:24:25 2018 New Revision: 334805 URL: https://svnweb.freebsd.org/changeset/base/334805 Log: - Once we have shifted arguments up to thrice, base-bits-dir is $1 rather than $4. Introduce $BASEBITSDIR for clarity and to avoid repeating this mistake in the future. Fixing this ensures that we pick up newly built boot bits native to the target rather for/from the host. - Apply some of the argument quoting fixes done in r287635 but missing in later revisions. Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Thu Jun 7 18:18:13 2018 (r334804) +++ head/release/amd64/mkisoimages.sh Thu Jun 7 18:24:25 2018 (r334805) @@ -36,8 +36,9 @@ if [ -z $MKIMG ]; then fi if [ "$1" = "-b" ]; then + BASEBITSDIR="$4" # This is highly x86-centric and will be used directly below. - bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" + bootable="-o bootimage=i386;$BASEBITSDIR/boot/cdboot -o no-emul-boot" # Make EFI system partition (should be done with makefs in the future) dd if=/dev/zero of=efiboot.img bs=4k count=200 @@ -46,7 +47,7 @@ if [ "$1" = "-b" ]; then mkdir efi mount -t msdosfs /dev/$device efi mkdir -p efi/efi/boot - cp "$4/boot/loader.efi" efi/efi/boot/bootx64.efi + cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootx64.efi umount efi rmdir efi mdconfig -d -u $device @@ -54,6 +55,7 @@ if [ "$1" = "-b" ]; then shift else + BASEBITSDIR="$3" bootable="" fi @@ -66,9 +68,9 @@ LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift NAME="$1"; shift publisher="The FreeBSD Project. https://www.FreeBSD.org/" -echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" $MAKEFS -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm -f "$1/etc/fstab" +rm -f "$BASEBITSDIR/etc/fstab" rm -f efiboot.img if [ "$bootable" != "" ]; then @@ -84,15 +86,15 @@ if [ "$bootable" != "" ]; then done # Create a GPT image containing the partitions we need for hybrid boot. - imgsize=`stat -f %z $NAME` + imgsize=`stat -f %z "$NAME"` $MKIMG -s gpt \ --capacity $imgsize \ - -b $4/boot/pmbr \ + -b "$BASEBITSDIR/boot/pmbr" \ $espparam \ - -p freebsd-boot:=$4/boot/isoboot \ + -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ -o hybrid.img # Drop the PMBR, GPT, and boot code into the System Area of the ISO. - dd if=hybrid.img of=$NAME bs=32k count=1 conv=notrunc + dd if=hybrid.img of="$NAME" bs=32k count=1 conv=notrunc rm -f hybrid.img fi From owner-svn-src-head@freebsd.org Thu Jun 7 18:28:00 2018 Return-Path: Delivered-To: svn-src-head@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 25967FE77CC; Thu, 7 Jun 2018 18:28:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A42782D6; Thu, 7 Jun 2018 18:27:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A99CC23D26; Thu, 7 Jun 2018 18:27:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IRxbU084958; Thu, 7 Jun 2018 18:27:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IRx3f084955; Thu, 7 Jun 2018 18:27:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806071827.w57IRx3f084955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Jun 2018 18:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334806 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:28:00 -0000 Author: kevans Date: Thu Jun 7 18:27:58 2018 New Revision: 334806 URL: https://svnweb.freebsd.org/changeset/base/334806 Log: bsdgrep(1): Do some less dirty things with return types Neither procfile nor grep_tree return anything meaningful to their callers. None of the callers actually care about how many lines were matched in all of the files they processed; it's all about "did anything match?" This is generally just a light refactoring to remind me of what actually matters as I'm rewriting these bits to care less about 'stuff'. Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Thu Jun 7 18:24:25 2018 (r334805) +++ head/usr.bin/grep/grep.c Thu Jun 7 18:27:58 2018 (r334806) @@ -339,6 +339,7 @@ main(int argc, char *argv[]) long long l; unsigned int aargc, eargc, i; int c, lastc, needpattern, newarg, prevoptind; + bool matched; setlocale(LC_ALL, ""); @@ -725,15 +726,16 @@ main(int argc, char *argv[]) exit(!procfile("-")); if (dirbehave == DIR_RECURSE) - c = grep_tree(aargv); + matched = grep_tree(aargv); else - for (c = 0; aargc--; ++aargv) { + for (matched = false; aargc--; ++aargv) { if ((finclude || fexclude) && !file_matching(*aargv)) continue; - c+= procfile(*aargv); + if (procfile(*aargv)) + matched = true; } /* Find out the correct return value according to the results and the command line option. */ - exit(c ? (file_err ? (qflag ? 0 : 2) : 0) : (file_err ? 2 : 1)); + exit(matched ? (file_err ? (qflag ? 0 : 2) : 0) : (file_err ? 2 : 1)); } Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Thu Jun 7 18:24:25 2018 (r334805) +++ head/usr.bin/grep/grep.h Thu Jun 7 18:27:58 2018 (r334806) @@ -125,8 +125,8 @@ extern char re_error[RE_ERROR_BUF + 1]; /* Seems big /* util.c */ bool file_matching(const char *fname); -int procfile(const char *fn); -int grep_tree(char **argv); +bool procfile(const char *fn); +bool grep_tree(char **argv); void *grep_malloc(size_t size); void *grep_calloc(size_t nmemb, size_t size); void *grep_realloc(void *ptr, size_t size); Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Jun 7 18:24:25 2018 (r334805) +++ head/usr.bin/grep/util.c Thu Jun 7 18:27:58 2018 (r334806) @@ -139,16 +139,17 @@ dir_matching(const char *dname) * Processes a directory when a recursive search is performed with * the -R option. Each appropriate file is passed to procfile(). */ -int +bool grep_tree(char **argv) { FTS *fts; FTSENT *p; int c, fts_flags; - bool ok; + bool matched, ok; const char *wd[] = { ".", NULL }; c = fts_flags = 0; + matched = false; switch(linkbehave) { case LINK_EXPLICIT: @@ -195,14 +196,14 @@ grep_tree(char **argv) if (fexclude || finclude) ok &= file_matching(p->fts_path); - if (ok) - c += procfile(p->fts_path); + if (ok && procfile(p->fts_path)) + matched = true; break; } } fts_close(fts); - return (c); + return (matched); } static void @@ -288,7 +289,7 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo * Opens a file and processes it. Each file is processed line-by-line * passing the lines to procline(). */ -int +bool procfile(const char *fn) { struct parsec pc; @@ -296,7 +297,7 @@ procfile(const char *fn) struct file *f; struct stat sb; mode_t s; - int c, t; + int lines, t; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : errstr[1]; @@ -306,10 +307,10 @@ procfile(const char *fn) /* Check if we need to process the file */ s = sb.st_mode & S_IFMT; if (dirbehave == DIR_SKIP && s == S_IFDIR) - return (0); + return (false); if (devbehave == DEV_SKIP && (s == S_IFIFO || s == S_IFCHR || s == S_IFBLK || s == S_IFSOCK)) - return (0); + return (false); } f = grep_open(fn); } @@ -317,7 +318,7 @@ procfile(const char *fn) file_err = true; if (!sflag) warn("%s", fn); - return (0); + return (false); } pc.ln.file = grep_strdup(fn); @@ -335,7 +336,7 @@ procfile(const char *fn) mc.doctx = true; mcount = mlimit; - for (c = 0; c == 0 || !(lflag || qflag); ) { + for (lines = 0; lines == 0 || !(lflag || qflag); ) { /* * XXX TODO: We need to revisit this in a chunking world. We're * not going to be doing per-line statistics because of the @@ -365,7 +366,7 @@ procfile(const char *fn) } if ((t = procline(&pc)) == 0) - ++c; + ++lines; /* Halt processing if we hit our match limit */ if (!procmatches(&mc, &pc, t == 0)) @@ -378,19 +379,19 @@ procfile(const char *fn) if (cflag) { if (!hflag) printf("%s:", pc.ln.file); - printf("%u\n", c); + printf("%u\n", lines); } - if (lflag && !qflag && c != 0) + if (lflag && !qflag && lines != 0) printf("%s%c", fn, nullflag ? 0 : '\n'); - if (Lflag && !qflag && c == 0) + if (Lflag && !qflag && lines == 0) printf("%s%c", fn, nullflag ? 0 : '\n'); - if (c && !cflag && !lflag && !Lflag && + if (lines != 0 && !cflag && !lflag && !Lflag && binbehave == BINFILE_BIN && f->binary && !qflag) printf(errstr[7], fn); free(pc.ln.file); free(f); - return (c); + return (lines != 0); } #ifdef WITH_INTERNAL_NOSPEC From owner-svn-src-head@freebsd.org Thu Jun 7 18:36:13 2018 Return-Path: Delivered-To: svn-src-head@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 0EB04FE7B1D; Thu, 7 Jun 2018 18:36:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD43878905; Thu, 7 Jun 2018 18:36:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B58F23EB9; Thu, 7 Jun 2018 18:36:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IaCjB090030; Thu, 7 Jun 2018 18:36:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IaCQw090029; Thu, 7 Jun 2018 18:36:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806071836.w57IaCQw090029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Jun 2018 18:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334807 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:36:13 -0000 Author: kevans Date: Thu Jun 7 18:36:12 2018 New Revision: 334807 URL: https://svnweb.freebsd.org/changeset/base/334807 Log: bsdgrep(1): whoops, garbage collect the now write-only variable Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Jun 7 18:27:58 2018 (r334806) +++ head/usr.bin/grep/util.c Thu Jun 7 18:36:12 2018 (r334807) @@ -144,11 +144,11 @@ grep_tree(char **argv) { FTS *fts; FTSENT *p; - int c, fts_flags; + int fts_flags; bool matched, ok; const char *wd[] = { ".", NULL }; - c = fts_flags = 0; + fts_flags = 0; matched = false; switch(linkbehave) { From owner-svn-src-head@freebsd.org Thu Jun 7 18:38:49 2018 Return-Path: Delivered-To: svn-src-head@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 42EACFE7C51; Thu, 7 Jun 2018 18:38:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC61078AD0; Thu, 7 Jun 2018 18:38:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD8F23EBF; Thu, 7 Jun 2018 18:38:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IcmmE090164; Thu, 7 Jun 2018 18:38:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IcmsN090163; Thu, 7 Jun 2018 18:38:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806071838.w57IcmsN090163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Jun 2018 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334808 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:38:49 -0000 Author: kevans Date: Thu Jun 7 18:38:48 2018 New Revision: 334808 URL: https://svnweb.freebsd.org/changeset/base/334808 Log: bsdgrep(1): Don't initialize fts_flags twice Admittedly, this is a clang-scan complaint... but it wasn't wrong. fts_flags is initialized by all cases in the switch(), which should be fairly obvious. Annotate this anyways. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Jun 7 18:36:12 2018 (r334807) +++ head/usr.bin/grep/util.c Thu Jun 7 18:38:48 2018 (r334808) @@ -148,9 +148,9 @@ grep_tree(char **argv) bool matched, ok; const char *wd[] = { ".", NULL }; - fts_flags = 0; matched = false; + /* This switch effectively initializes 'fts_flags' */ switch(linkbehave) { case LINK_EXPLICIT: fts_flags = FTS_COMFOLLOW; From owner-svn-src-head@freebsd.org Thu Jun 7 18:53:40 2018 Return-Path: Delivered-To: svn-src-head@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 7E383FE83CE; Thu, 7 Jun 2018 18:53:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 302DA798F4; Thu, 7 Jun 2018 18:53:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1016B241FA; Thu, 7 Jun 2018 18:53:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57Ird7B000477; Thu, 7 Jun 2018 18:53:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IrdcM000476; Thu, 7 Jun 2018 18:53:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806071853.w57IrdcM000476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Jun 2018 18:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334809 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/usr.bin/grep X-SVN-Commit-Revision: 334809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:53:40 -0000 Author: kevans Date: Thu Jun 7 18:53:39 2018 New Revision: 334809 URL: https://svnweb.freebsd.org/changeset/base/334809 Log: netbsd-tests: bsdgrep(1): Add a test for -m, too Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Jun 7 18:38:48 2018 (r334808) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Jun 7 18:53:39 2018 (r334809) @@ -732,6 +732,22 @@ cflag_body() atf_check -o inline:"test1:2\n" grep -EHc "a|b" test1 } + +atf_test_case mflag +mflag_head() +{ + atf_set "descr" "Check proper handling of -m" +} +mflag_body() +{ + printf "a\nb\nc\nd\ne\nf\n" > test1 + + atf_check -o inline:"1\n" grep -m 1 -Ec "a" test1 + atf_check -o inline:"2\n" grep -m 2 -Ec "a|b" test1 + atf_check -o inline:"3\n" grep -m 3 -Ec "a|b|c|f" test1 + + atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 +} # End FreeBSD atf_init_test_cases() @@ -776,5 +792,6 @@ atf_init_test_cases() atf_add_test_case fgrep_icase atf_add_test_case fgrep_oflag atf_add_test_case cflag + atf_add_test_case mflag # End FreeBSD } From owner-svn-src-head@freebsd.org Thu Jun 7 18:59:34 2018 Return-Path: Delivered-To: svn-src-head@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 314FAFE8588; Thu, 7 Jun 2018 18:59:34 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7CA579B5D; Thu, 7 Jun 2018 18:59:33 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8DA724200; Thu, 7 Jun 2018 18:59:33 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57IxXuY000759; Thu, 7 Jun 2018 18:59:33 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57IxXJR000756; Thu, 7 Jun 2018 18:59:33 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201806071859.w57IxXJR000756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 7 Jun 2018 18:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334810 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 334810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:59:34 -0000 Author: benno Date: Thu Jun 7 18:59:32 2018 New Revision: 334810 URL: https://svnweb.freebsd.org/changeset/base/334810 Log: Break recursion involving getnewvnode and zfs_rmnode. When we're at our vnode limit, getnewvnode will call into the vnode LRU cache to free up vnodes. If the vnode we try to recycle is a ZFS vnode we end up, eventually, in zfs_rmnode. If the ZFS vnode we're recycling represents something with extended attributes, zfs_rmnode will call zfs_zget which will attempt to allocate another vnode. If the next vnode we try to recycle is also a ZFS vnode representing something with extended attributes we can recurse further. This ends up being unbounded and can end up overflowing the stack. In order to avoid this, restructure zfs_rmnode to simply add the extended attribute directory's object ID to the unlinked set, thus not requiring the allocation of a vnode. We then schedule a task that calls zfs_unlinked_drain which will do the work of properly marking the vnodes for unlinking. zfs_unlinked_drain is also called on mount so these will be cleaned up there. Reviewed by: avg, mav Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15342 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Thu Jun 7 18:53:39 2018 (r334809) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Thu Jun 7 18:59:32 2018 (r334810) @@ -85,6 +85,9 @@ struct zfsvfs { sa_attr_type_t *z_attr_table; /* SA attr mapping->id */ #define ZFS_OBJ_MTX_SZ 64 kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ +#if defined(__FreeBSD__) + struct task z_unlinked_drain_task; +#endif }; /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu Jun 7 18:53:39 2018 (r334809) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu Jun 7 18:59:32 2018 (r334810) @@ -281,6 +281,7 @@ zfs_unlinked_drain(zfsvfs_t *zfsvfs) zap_attribute_t zap; dmu_object_info_t doi; znode_t *zp; + dmu_tx_t *tx; int error; /* @@ -318,6 +319,19 @@ zfs_unlinked_drain(zfsvfs_t *zfsvfs) vn_lock(ZTOV(zp), LK_EXCLUSIVE | LK_RETRY); zp->z_unlinked = B_TRUE; +#if defined(__FreeBSD__) + /* + * Due to changes in zfs_rmnode we need to make sure the + * link count is set to zero here. + */ + zp->z_links = 0; + tx = dmu_tx_create(zfsvfs->z_os); + dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE); + VERIFY(0 == dmu_tx_assign(tx, TXG_WAIT)); + VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_LINKS(zfsvfs), + &zp->z_links, sizeof (zp->z_links), tx)); + dmu_tx_commit(tx); +#endif vput(ZTOV(zp)); } zap_cursor_fini(&zc); @@ -393,7 +407,6 @@ zfs_rmnode(znode_t *zp) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os = zfsvfs->z_os; - znode_t *xzp = NULL; dmu_tx_t *tx; uint64_t acl_obj; uint64_t xattr_obj; @@ -443,11 +456,8 @@ zfs_rmnode(znode_t *zp) */ error = sa_lookup(zp->z_sa_hdl, SA_ZPL_XATTR(zfsvfs), &xattr_obj, sizeof (xattr_obj)); - if (error == 0 && xattr_obj) { - error = zfs_zget(zfsvfs, xattr_obj, &xzp); - ASSERT3S(error, ==, 0); - vn_lock(ZTOV(xzp), LK_EXCLUSIVE | LK_RETRY); - } + if (error) + xattr_obj = 0; acl_obj = zfs_external_acl(zp); @@ -457,10 +467,8 @@ zfs_rmnode(znode_t *zp) tx = dmu_tx_create(os); dmu_tx_hold_free(tx, zp->z_id, 0, DMU_OBJECT_END); dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); - if (xzp) { + if (xattr_obj) dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, TRUE, NULL); - dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE); - } if (acl_obj) dmu_tx_hold_free(tx, acl_obj, 0, DMU_OBJECT_END); @@ -475,9 +483,25 @@ zfs_rmnode(znode_t *zp) dmu_tx_abort(tx); zfs_znode_dmu_fini(zp); zfs_znode_free(zp); - goto out; + return; } +#if defined(__FreeBSD__) + /* + * FreeBSD's implemention of zfs_zget requires a vnode to back it. + * This means that we could end up calling into getnewvnode while + * calling zfs_rmnode as a result of a prior call to getnewvnode + * trying to clear vnodes out of the cache. If this repeats we can + * recurse enough that we overflow our stack. To avoid this, we + * avoid calling zfs_zget on the xattr znode and instead simply add + * it to the unlinked set and schedule a call to zfs_unlinked_drain. + */ + if (xattr_obj) { + /* Add extended attribute directory to the unlinked set. */ + VERIFY3U(0, ==, + zap_add_int(os, zfsvfs->z_unlinkedobj, xattr_obj, tx)); + } +#else if (xzp) { ASSERT(error == 0); xzp->z_unlinked = B_TRUE; /* mark xzp for deletion */ @@ -486,6 +510,7 @@ zfs_rmnode(znode_t *zp) &xzp->z_links, sizeof (xzp->z_links), tx)); zfs_unlinked_add(xzp, tx); } +#endif /* Remove this znode from the unlinked set */ VERIFY3U(0, ==, @@ -494,9 +519,16 @@ zfs_rmnode(znode_t *zp) zfs_znode_delete(zp, tx); dmu_tx_commit(tx); -out: - if (xzp) - vput(ZTOV(xzp)); + + if (xattr_obj) { + /* + * We're using the FreeBSD taskqueue API here instead of + * the Solaris taskq API since the FreeBSD API allows for a + * task to be enqueued multiple times but executed once. + */ + taskqueue_enqueue(system_taskq->tq_queue, + &zfsvfs->z_unlinked_drain_task); + } } static uint64_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 7 18:53:39 2018 (r334809) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 7 18:59:32 2018 (r334810) @@ -972,6 +972,15 @@ zfsvfs_init(zfsvfs_t *zfsvfs, objset_t *os) return (0); } +#if defined(__FreeBSD__) +static void +zfsvfs_task_unlinked_drain(void *context, int pending __unused) +{ + + zfs_unlinked_drain((zfsvfs_t *)context); +} +#endif + int zfsvfs_create(const char *osname, zfsvfs_t **zfvp) { @@ -1023,6 +1032,10 @@ zfsvfs_create_impl(zfsvfs_t **zfvp, zfsvfs_t *zfsvfs, mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&zfsvfs->z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); +#if defined(__FreeBSD__) + TASK_INIT(&zfsvfs->z_unlinked_drain_task, 0, + zfsvfs_task_unlinked_drain, zfsvfs); +#endif #ifdef DIAGNOSTIC rrm_init(&zfsvfs->z_teardown_lock, B_TRUE); #else @@ -2014,6 +2027,11 @@ zfs_umount(vfs_t *vfsp, int fflag) } } #endif + + while (taskqueue_cancel(system_taskq->tq_queue, + &zfsvfs->z_unlinked_drain_task, NULL) != 0) + taskqueue_drain(system_taskq->tq_queue, + &zfsvfs->z_unlinked_drain_task); VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); os = zfsvfs->z_os; From owner-svn-src-head@freebsd.org Thu Jun 7 19:37:58 2018 Return-Path: Delivered-To: svn-src-head@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 5838DFE963E; Thu, 7 Jun 2018 19:37:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA56E7B2D9; Thu, 7 Jun 2018 19:37:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B8F015BD2; Thu, 7 Jun 2018 19:37:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 84CD49838; Thu, 7 Jun 2018 19:37:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id hUnZz2EHLZxe; Thu, 7 Jun 2018 19:37:54 +0000 (UTC) Subject: Re: svn commit: r334791 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 5FEBB9833 To: Alexey Dokuchaev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201806071616.w57GGMIo017645@repo.freebsd.org> <20180607164420.GA93814@FreeBSD.org> <20180607170552.GB93814@FreeBSD.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: Date: Thu, 7 Jun 2018 15:37:50 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180607170552.GB93814@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gFqPze92NHBlzOX8uP1aub0ImdoHUacJw" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 19:37:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gFqPze92NHBlzOX8uP1aub0ImdoHUacJw Content-Type: multipart/mixed; boundary="wlGjwO95dsyQLHP6IkzQpB3flrGRh5ZAQ"; protected-headers="v1" From: Bryan Drewery To: Alexey Dokuchaev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: Subject: Re: svn commit: r334791 - head/share/mk References: <201806071616.w57GGMIo017645@repo.freebsd.org> <20180607164420.GA93814@FreeBSD.org> <20180607170552.GB93814@FreeBSD.org> In-Reply-To: <20180607170552.GB93814@FreeBSD.org> --wlGjwO95dsyQLHP6IkzQpB3flrGRh5ZAQ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/7/18 1:05 PM, Alexey Dokuchaev wrote: > On Thu, Jun 07, 2018 at 04:44:20PM +0000, Alexey Dokuchaev wrote: >> On Thu, Jun 07, 2018 at 04:16:22PM +0000, Bryan Drewery wrote: >>> New Revision: 334791 >>> URL: https://svnweb.freebsd.org/changeset/base/334791 >>> >>> Log: >>> Stop using head(1) which is not available in installworld. >>> ... >>> @@ -49,7 +49,7 @@ ${var}=3D ${${var}.${${X_}_ld_hash}} >>> =20 >>> .if ${ld} =3D=3D "LD" || (${ld} =3D=3D "XLD" && ${XLD} !=3D ${LD}) >>> .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) >>> -_ld_version!=3D (${${ld}} --version || echo none) | head -n 1 >>> +_ld_version!=3D (${${ld}} --version || echo none) | sed -n '1,1p' >> >> You don't need to specify the range actually, and the quotes. Simple >> `sed -n 1p' looks shorter and does not raise unnecessary questions. Yup makes sense, thanks. >=20 > Actually, `sed q' is sufficient. >=20 I'll stick with -n 1p as I think it is more clear. > ./danfe >=20 --=20 Regards, Bryan Drewery --wlGjwO95dsyQLHP6IkzQpB3flrGRh5ZAQ-- --gFqPze92NHBlzOX8uP1aub0ImdoHUacJw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlsZiY4ACgkQNddxu25G l88Pnwf/bpWO+xYmowXZyB7/JpNN5hQw+haC2GZ0Ae5W2ajN2MQ8ocgS80VKCXzU 2dOIe+xafjmlIjHyqJ630/HkPrtSkE7bUmebxWPWKqx7vBeEvn0ARjj9h6g9wLcp 0s0mQu1m+d6xGkX/Johd63B5CACtHjpAdXq+kKFatm/qDXE6Pb3bACAcI27IO/bU y/y055pK7RHMbjeZC5Tibgn93ICmf7M8qf548g1Tl+2QcDu3xkRKwmkbGEphXIiJ shfWXeAHnypKj2/Ie56q8zyp+qQ7lJK2n1I2TlDnLNrtY42nCrUwXPRc7i5DLOmj Qy4Srbzq0gNUbe4ckN+cVNXFzryEsA== =ej4H -----END PGP SIGNATURE----- --gFqPze92NHBlzOX8uP1aub0ImdoHUacJw-- From owner-svn-src-head@freebsd.org Thu Jun 7 19:38:33 2018 Return-Path: Delivered-To: svn-src-head@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 286EAFE96BD for ; Thu, 7 Jun 2018 19:38:33 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic304-22.consmr.mail.ne1.yahoo.com (sonic304-22.consmr.mail.ne1.yahoo.com [66.163.191.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99497B460 for ; Thu, 7 Jun 2018 19:38:32 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: n4sz2LQVM1nSWG5KeRDsSuk_IW0z_dd0AU7Yp3j4u0SKqQjz2HTzdRbGfL3LWTd hvdAWeX7XknVUGTJX3it4crUJw36fGqC2AtvhcNDnao7kDza.NpMH7fZIIjjVMT0N0l9GG1rvTls y4tilL_7weSvhegsPaYGunv1v_cELIrLlC.yW4hrH586S6OC25wdkwLIosJqrOixhJYhmYJba_Lk gUHxJV6xcAzEj1kSzQwfljV3hEl0H9_EZvI2QSg5uihp9mk2oZDVWG5Uz7p0EeADU8FFOxWYXdyU g59cbxBtGhV1PUNl_NnM71hg6_aVrwy2WQGW3HdscGH2UBGeLlrXFck4wMPpdE4BzzZs7HwSo1zD 2m5_X3AIS28g2pxnE5EtTEcB1SyCH0YSrwiupIsCElJUu7E65HJEyU3Ry6_II2Dxv50VibhowuQy ZyfXFo5D9c0BZeIQq4TEPrJvZWqOfcnYp1fPx5MWTuRvAe3K0JDD2rZUnejKk.PhdGmVBrStub4w p1asiATGTyMQK_VFq6qL0xvT2niyBl3MgEG.W7SeOjMfrujtYBGeXLydpssQYak54aLMqcAgN.Gm HrqwItN0gVxgak_erCYL1qq9POTLk8d91S_OFl4vgzSHs2D3U3Hwym9jR2SPR8842VdIWk81NGkS fds1rjThwywEamtUGxxILTD9WyJINaxNfLTU4GArlEgwaB4Xa3k8SUVeZl8Wvd6mnMMvi.DCqalI pkoDdToDEctH6_FD9aFb.P776tX91vnoJv_HZMrHhqtvRsWpdj8Sq3Wt9mR4fUbCNSnhdFUwCvfv hTLsdaklgtcIE48oWVQmyh0MO6VEBTeTJ4gj7yMfHvPb6TSVZa40rVVFDqt2YkTyRZpwmYaGqMQk gE6yDdNZTWZ2GxCWNWUmgSi1HrgVOd6c3irGYcKVcbrnEbljFcFvqOK6En86mcmnkl6DVb.wXaAD wbGCVvKMO Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Thu, 7 Jun 2018 19:38:26 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp411.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7bcc51cd6159f764eae5b7d4a75be276; Thu, 07 Jun 2018 19:38:21 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r334702 - head/sys/sys Message-Id: Date: Thu, 7 Jun 2018 12:38:19 -0700 To: jtl@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 19:38:33 -0000 Jonathan T. Looney jtl at freebsd.org wrote on Thu Jun 7 03:00:00 UTC 2018 : > I believe the theory is that the compiler (remember, this is > __builtin_memset) can optimize away portions of the zeroing, or can > optimize zeroing for small sizes. > > For example, imagine you do this: > > struct foo { > uint32_t a; > uint32_t b; > }; > > struct foo * > alloc_foo(void) > { > struct foo *rv; > > rv = malloc(sizeof(*rv), M_TMP, M_WAITOK|M_ZERO); > rv->a = 1; > rv->b = 2; > return (rv); > } > > In theory, the compiler can be smart enough to know that the entire > structure is initialized, so it is not necessary to zero it. > > (I personally have not tested how well this works in practice. However, > this change theoretically lets the compiler be smarter and optimize away > unneeded work.) > > At minimum, it should let the compiler replace calls to memset() (and the > loops there) with optimal instructions to zero the exact amount of memory > that needs to be initialized. (Again, I haven't personally tested how smart > the compilers we use are about producing optimal code in this situation.) Change struct foo to something like (just a specific illustration of a more general type of context): struct foo { uint16_t a; // assume padding in the struct uint32_t b; }; Are the compilers well behaved about always initializing the padding (if any) to zero when the __builtin_memset is used to implement M_ZERO but the compiler is optimizing what is actually zeroed based on what was initialized explicitly? === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu Jun 7 19:39:13 2018 Return-Path: Delivered-To: svn-src-head@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 F02A7FE9737; Thu, 7 Jun 2018 19:39:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9899B7B4C5; Thu, 7 Jun 2018 19:39:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7747A24869; Thu, 7 Jun 2018 19:39:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57JdC58021262; Thu, 7 Jun 2018 19:39:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57JdCha021261; Thu, 7 Jun 2018 19:39:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806071939.w57JdCha021261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jun 2018 19:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334811 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 334811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 19:39:13 -0000 Author: bdrewery Date: Thu Jun 7 19:39:11 2018 New Revision: 334811 URL: https://svnweb.freebsd.org/changeset/base/334811 Log: Use simpler sed invocation. X-MFC-With: r334791 MFC after: 1 week Submitted by: danfe Modified: head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Thu Jun 7 18:59:32 2018 (r334810) +++ head/share/mk/bsd.linker.mk Thu Jun 7 19:39:11 2018 (r334811) @@ -49,7 +49,7 @@ ${var}= ${${var}.${${X_}_ld_hash}} .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) -_ld_version!= (${${ld}} --version || echo none) | sed -n '1,1p' +_ld_version!= (${${ld}} --version || echo none) | sed -n 1p .if ${_ld_version} == "none" .warning Unable to determine linker type from ${ld}=${${ld}} .endif From owner-svn-src-head@freebsd.org Thu Jun 7 19:53:00 2018 Return-Path: Delivered-To: svn-src-head@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 0B61AFE9DB6; Thu, 7 Jun 2018 19:53:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4A357C0C8; Thu, 7 Jun 2018 19:52:59 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id ABF0163F3; Thu, 7 Jun 2018 19:52:59 +0000 (UTC) Date: Thu, 7 Jun 2018 19:52:59 +0000 From: Alexey Dokuchaev To: Bryan Drewery Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r334791 - head/share/mk Message-ID: <20180607195259.GA24236@FreeBSD.org> References: <201806071616.w57GGMIo017645@repo.freebsd.org> <20180607164420.GA93814@FreeBSD.org> <20180607170552.GB93814@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 19:53:00 -0000 On Thu, Jun 07, 2018 at 03:37:50PM -0400, Bryan Drewery wrote: > On 6/7/18 1:05 PM, Alexey Dokuchaev wrote: > > ... > > Actually, `sed q' is sufficient. > > I'll stick with -n 1p as I think it is more clear. Fair enough, the latter one is indeed a bit cryptic. Thanks! ./danfe From owner-svn-src-head@freebsd.org Thu Jun 7 19:57:56 2018 Return-Path: Delivered-To: svn-src-head@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 1DB92FE9FA3; Thu, 7 Jun 2018 19:57:56 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2A577C3CC; Thu, 7 Jun 2018 19:57:55 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3A4E24BA0; Thu, 7 Jun 2018 19:57:55 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57JvtbC031547; Thu, 7 Jun 2018 19:57:55 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57Jvt6w031546; Thu, 7 Jun 2018 19:57:55 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806071957.w57Jvt6w031546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 7 Jun 2018 19:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334813 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 334813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 19:57:56 -0000 Author: rrs Date: Thu Jun 7 19:57:55 2018 New Revision: 334813 URL: https://svnweb.freebsd.org/changeset/base/334813 Log: Fix build issue with const and volatile and the myriad ways that the various compliers treat this. The only safe prefetch appears to be for AMD. The other compilers either are not volatile or are not const :( Reported by: Michael Tuexen Modified: head/sys/sys/kern_prefetch.h Modified: head/sys/sys/kern_prefetch.h ============================================================================== --- head/sys/sys/kern_prefetch.h Thu Jun 7 19:48:49 2018 (r334812) +++ head/sys/sys/kern_prefetch.h Thu Jun 7 19:57:55 2018 (r334813) @@ -34,7 +34,7 @@ kern_prefetch(const volatile void *addr, void* before) #if defined(__amd64__) __asm __volatile("prefetcht1 (%1)":"=rm"(*((int32_t *)before)):"r"(addr):); #else - __builtin_prefetch(addr); +/* __builtin_prefetch(addr);*/ #endif } From owner-svn-src-head@freebsd.org Thu Jun 7 20:49:02 2018 Return-Path: Delivered-To: svn-src-head@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 29DCBFEB58C; Thu, 7 Jun 2018 20:49:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D45DA7E49C; Thu, 7 Jun 2018 20:49:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6686253D7; Thu, 7 Jun 2018 20:49:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57Kn1hg057120; Thu, 7 Jun 2018 20:49:01 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57Kn1Mk057119; Thu, 7 Jun 2018 20:49:01 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201806072049.w57Kn1Mk057119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 7 Jun 2018 20:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334814 - head/sbin/dump X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/dump X-SVN-Commit-Revision: 334814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 20:49:02 -0000 Author: mckusick Date: Thu Jun 7 20:49:01 2018 New Revision: 334814 URL: https://svnweb.freebsd.org/changeset/base/334814 Log: Ensure proper initialization of superblock. Submitted by: Diane Bruce Modified: head/sbin/dump/main.c Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Thu Jun 7 19:57:55 2018 (r334813) +++ head/sbin/dump/main.c Thu Jun 7 20:49:01 2018 (r334814) @@ -433,6 +433,7 @@ main(int argc, char *argv[]) msgtail("to %s\n", tape); sync(); + sblock = NULL; if ((ret = sbget(diskfd, &sblock, -1)) != 0) { switch (ret) { case ENOENT: From owner-svn-src-head@freebsd.org Thu Jun 7 20:57:13 2018 Return-Path: Delivered-To: svn-src-head@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 04B0DFEB886; Thu, 7 Jun 2018 20:57:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB1C87E979; Thu, 7 Jun 2018 20:57:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D33D25569; Thu, 7 Jun 2018 20:57:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57KvCSw062074; Thu, 7 Jun 2018 20:57:12 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57KvCdW062073; Thu, 7 Jun 2018 20:57:12 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806072057.w57KvCdW062073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 7 Jun 2018 20:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334815 - head/sys/modules/tcp/rack X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/modules/tcp/rack X-SVN-Commit-Revision: 334815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 20:57:13 -0000 Author: rrs Date: Thu Jun 7 20:57:12 2018 New Revision: 334815 URL: https://svnweb.freebsd.org/changeset/base/334815 Log: Take out the stack alias inadvertantly added by my commit. Reported by: Peter Lei Modified: head/sys/modules/tcp/rack/Makefile Modified: head/sys/modules/tcp/rack/Makefile ============================================================================== --- head/sys/modules/tcp/rack/Makefile Thu Jun 7 20:49:01 2018 (r334814) +++ head/sys/modules/tcp/rack/Makefile Thu Jun 7 20:57:12 2018 (r334815) @@ -19,6 +19,5 @@ SRCS+= opt_kern_tls.h CFLAGS+= -DMODNAME=${KMOD} CFLAGS+= -DSTACKNAME=${STACKNAME} -CFLAGS+= -DSTACKALIAS=rack_18q21 .include From owner-svn-src-head@freebsd.org Thu Jun 7 11:24:00 2018 Return-Path: Delivered-To: svn-src-head@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 493F1FE1CA0; Thu, 7 Jun 2018 11:24:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4154F8B4E9; Thu, 7 Jun 2018 11:22:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 839c73e7; Thu, 7 Jun 2018 13:16:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=SOJMKKMzPCiWel0PVPnZqqDaIDE=; b=m8ssKPWCPg6bY5Llmr/ABJIcK8ct +vgauCnoPfV4hO8seFAo6mc02yVtfhxiIPs5oM7IlFAZgn2LXwdqxtjYgccV4s0t NiixbxuohdS4W70Bw8DYUSGxlBAOhzjlj7KShdW8sLb2lSUJBxiUSHGBHhENbxRG 2PTsXSsdMNPt/5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=IG4YzNmXxK2VjGquz1GAuQ4ebPSZuHfZDehB9gkYP3YoTFj47nNNmbZr I3G7s5ccglo0UfG+T7KxbzbKzcWQoZa7QXGLG45aLDdPXytx44vkTU42mWX1ywbb 2nv1aG1pv2gdM6LeLyNmIEXEV4tF2v9SvT994MBuFIKp1n+t8jQ= Received: from knuckles.blih.net (unallocated-static.rogers.com [72.142.116.18]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 32219650 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 7 Jun 2018 13:16:09 +0200 (CEST) Date: Thu, 7 Jun 2018 13:16:01 +0200 From: Emmanuel Vadot To: Alexey Dokuchaev Cc: Konstantin Belousov , Ian Lepore , src-committers , Kyle Evans , svn-src-all@FreeBSD.org, Brad Davis , rgrimes@FreeBSD.org, svn-src-head@FreeBSD.org, Alexander Leidinger , Eugene Grosbein Subject: Re: svn commit: r334617 - in head: . etc Message-Id: <20180607131601.f53a86dec453dc07211f5691@bidouilliste.com> In-Reply-To: <20180607073329.GB51308@FreeBSD.org> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <20180606202720.GD2450@kib.kiev.ua> <20180607073329.GB51308@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 07 Jun 2018 21:16:01 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 11:24:00 -0000 On Thu, 7 Jun 2018 07:33:29 +0000 Alexey Dokuchaev wrote: > On Wed, Jun 06, 2018 at 11:27:20PM +0300, Konstantin Belousov wrote: > > On Wed, Jun 06, 2018 at 02:06:48PM -0600, Ian Lepore wrote: > > > ... > > > I don't understand the drama over this. rc.d startup scripts are > > > *binaries*. > > No, they are not, they are scripts. > > > I proposed to move them somewhere, e.g. to /sbin/rc* or to /libexec/rc*. > > Please don't. Our huge selling point (vs. most GNU/Linux distros) is that > everything is *not* spread across the entire hier(7) like butter on bread. > > ./danfe Our huge selling point is startup scripts in /etc/rc.d ? Damn, we sucks at marketing ... -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Jun 7 21:24:22 2018 Return-Path: Delivered-To: svn-src-head@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 4CB98FEDB81; Thu, 7 Jun 2018 21:24:22 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 032A680195; Thu, 7 Jun 2018 21:24:22 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D992425A50; Thu, 7 Jun 2018 21:24:21 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57LOLrw076850; Thu, 7 Jun 2018 21:24:21 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57LOLUC076849; Thu, 7 Jun 2018 21:24:21 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201806072124.w57LOLUC076849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Thu, 7 Jun 2018 21:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334816 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 334816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 21:24:22 -0000 Author: leitao Date: Thu Jun 7 21:24:21 2018 New Revision: 334816 URL: https://svnweb.freebsd.org/changeset/base/334816 Log: Fix excise_initrd_region() to support 32- and 64-bit initrd params. Changed excise_initrd_region to support both 32- and 64-bit values for linux,initrd-start and linux,initrd-end. This fixes the boot problem on some machines after rS334485. Submitted by: Luis Pires Reviewed by: jhibbits, leitao Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D15667 Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Thu Jun 7 20:57:12 2018 (r334815) +++ head/sys/powerpc/ofw/ofw_machdep.c Thu Jun 7 21:24:21 2018 (r334816) @@ -297,14 +297,37 @@ excise_initrd_region(struct mem_region *avail, int asz uint64_t start, end; ssize_t size; struct mem_region initrdmap[1]; + pcell_t cell[2]; chosen = OF_finddevice("/chosen"); - size = OF_getprop(chosen, "linux,initrd-start", &start, sizeof(start)); - if (size <= 0) + + size = OF_getencprop(chosen, "linux,initrd-start", cell, sizeof(cell)); + if (size < 0) return (asz); + else if (size == 4) + start = cell[0]; + else if (size == 8) + start = (uint64_t)cell[0] << 32 | cell[1]; + else { + /* Invalid value length */ + printf("WARNING: linux,initrd-start must be either 4 or 8 bytes long\n"); + return (asz); + } - size = OF_getprop(chosen, "linux,initrd-end", &end, sizeof(end)); - if (size <= 0) + size = OF_getencprop(chosen, "linux,initrd-end", cell, sizeof(cell)); + if (size < 0) + return (asz); + else if (size == 4) + end = cell[0]; + else if (size == 8) + end = (uint64_t)cell[0] << 32 | cell[1]; + else { + /* Invalid value length */ + printf("WARNING: linux,initrd-end must be either 4 or 8 bytes long\n"); + return (asz); + } + + if (end <= start) return (asz); initrdmap[0].mr_start = start; From owner-svn-src-head@freebsd.org Thu Jun 7 22:08:02 2018 Return-Path: Delivered-To: svn-src-head@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 10F78FF429C; Thu, 7 Jun 2018 22:08:02 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 999BB81F4D; Thu, 7 Jun 2018 22:08:01 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 431E0176D1; Thu, 7 Jun 2018 15:01:21 -0700 (PDT) Date: Thu, 7 Jun 2018 15:01:21 -0700 From: hiren panchasara To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys Message-ID: <20180607220121.GC62424@strugglingcoder.info> References: <201806071818.w57IIENp080093@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DIOMP1UsTsWJauNi" Content-Disposition: inline In-Reply-To: <201806071818.w57IIENp080093@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 22:08:02 -0000 --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/07/18 at 06:18P, Randall Stewart wrote: > Author: rrs > Date: Thu Jun 7 18:18:13 2018 > New Revision: 334804 > URL: https://svnweb.freebsd.org/changeset/base/334804 >=20 > Log: > This commit brings in a new refactored TCP stack called Rack. > Rack includes the following features: > - A different SACK processing scheme (the old sack structures are not = used). > - RACK (Recent acknowledgment) where counting dup-acks is no longer do= ne > instead time is used to knwo when to retransmit. (see the I-D) > - TLP (Tail Loss Probe) where we will probe for tail-losses to attempt > to try not to take a retransmit time-out. (see the I-D) > - Burst mitigation using TCPHTPS > - PRR (partial rate reduction) see the RFC. > =20 > Once built into your kernel, you can select this stack by either > socket option with the name of the stack is "rack" or by setting > the global sysctl so the default is rack. > =20 > Note that any connection that does not support SACK will be kicked > back to the "default" base FreeBSD stack (currently known as "default"= ). > =20 > To build this into your kernel you will need to enable in your > kernel: > makeoptions WITH_EXTRA_TCP_STACKS=3D1 > options TCPHPTS > =20 > Sponsored by: Netflix Inc. > Differential Revision: https://reviews.freebsd.org/D15525 >=20 > Added: > head/sys/modules/tcp/rack/ > head/sys/modules/tcp/rack/Makefile (contents, props changed) > head/sys/netinet/tcp_stacks/rack.c (contents, props changed) > head/sys/netinet/tcp_stacks/rack_bbr_common.h (contents, props change= d) > head/sys/netinet/tcp_stacks/sack_filter.c (contents, props changed) > head/sys/netinet/tcp_stacks/sack_filter.h (contents, props changed) > head/sys/netinet/tcp_stacks/tcp_rack.h (contents, props changed) > Modified: > head/sys/kern/uipc_sockbuf.c > head/sys/modules/tcp/Makefile > head/sys/netinet/tcp.h > head/sys/netinet/tcp_log_buf.h > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_stacks/fastpath.c > head/sys/netinet/tcp_timer.c > head/sys/netinet/tcp_timer.h > head/sys/netinet/tcp_var.h > head/sys/sys/mbuf.h > head/sys/sys/queue.h > head/sys/sys/sockbuf.h > head/sys/sys/time.h I thought we'd have more time to review/test this. Looks like BSDCan commit-spree in effect. :-) A few questions: 1) Does RACK work reliably without HPTS? If yes, has that config been tested? 2) It looks like PRR is tied to RACK. Why did we go that route? Shouldn't it be easily used with the 'default' stack also? 3) Can new SACK be used with the traditional stack? 4) Where should manpage like info for RACK go? a new man-page or extending tcp(4)? Info like how to enable system-wide or per socket should go here. 5) Any perf numbers to go along with this commit? Synthetic or production numbers showing improvements in transfer speed or any other impact on CPU usage (specially with HPTS) that you can share? 6) In your testing, have you found cases where RACK does poorly compared to the 'default' stack? Any recommendations on when should RACK be enabled? (Something like this could go in the manpage.) Glad to finally see this in -head! Cheers, Hiren --DIOMP1UsTsWJauNi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJbGastXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l/hYH/RSlrmR6DAqftd0B/GwySYyt W2jegZIij/YRDnkGl4aK9EK4kHpmFCvjGKO2a1owPwSnC3Ky8Cku2d21WQHxxUDK eELS8FI7mN0XraKzXiITwI4H0V67QgHbcnnmqgfnUIEKhcLH+1qNYwjuvsmY4cZ4 WFJlOsM8crjq5EOlKBUbB+KrnJLfSNLB+QDPNEQH+M/prhD9CnjTTDt6T3DwrS1U W9vXsazvZjfYEIo0EhgqE99wurtsigVqP6m9oJcdLG9uQzVFQt68tgWDZ7JdOhDu OY//wwsSVdBaiyaIPY5vJWYg/SIjG0rD4qfPlUn6PECtfg64ni+2TzpVtrF6/pg= =Vf/r -----END PGP SIGNATURE----- --DIOMP1UsTsWJauNi-- From owner-svn-src-head@freebsd.org Thu Jun 7 22:38:42 2018 Return-Path: Delivered-To: svn-src-head@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 C1DE7FF8869; Thu, 7 Jun 2018 22:38:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A9C833A5; Thu, 7 Jun 2018 22:38:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48AB026593; Thu, 7 Jun 2018 22:38:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57McfkS011817; Thu, 7 Jun 2018 22:38:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57Mcehx011811; Thu, 7 Jun 2018 22:38:40 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201806072238.w57Mcehx011811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Jun 2018 22:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334817 - in head/usr.sbin/cron: cron crontab lib X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/usr.sbin/cron: cron crontab lib X-SVN-Commit-Revision: 334817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 22:38:42 -0000 Author: glebius Date: Thu Jun 7 22:38:40 2018 New Revision: 334817 URL: https://svnweb.freebsd.org/changeset/base/334817 Log: Add new functionality and syntax to cron(1) to allow to run jobs at a given interval, which is counted in seconds since exit of the previous invocation of the job. Example user crontab entry: @25 sleep 10 The example will launch 'sleep 10' every 35 seconds. This is a rather useless example above, but clearly explains the functionality. The practical goal here is to avoid overlap of previous job invocation to a new one, or to avoid too short interval(s) for jobs that last long and doesn't have any point of immediate launch soon after previous run. Another useful effect of interval jobs can be noticed when a cluster of machines periodically communicates with a single node. Running the task time based creates too much load on the node. Running interval based spreads invocations across machines in cluster. Note that -j/-J won't help in this case. Sponsored by: Netflix Modified: head/usr.sbin/cron/cron/cron.c head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/cron/do_command.c head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Thu Jun 7 21:24:21 2018 (r334816) +++ head/usr.sbin/cron/cron/cron.c Thu Jun 7 22:38:40 2018 (r334817) @@ -46,7 +46,9 @@ static void usage(void), parse_args(int c, char *v[]); static int run_at_secres(cron_db *); +static void find_interval_entry(pid_t); +static cron_db database; static time_t last_time = 0; static int dst_enabled = 0; static int dont_daemonize = 0; @@ -100,7 +102,6 @@ main(argc, argv) int argc; char *argv[]; { - cron_db database; int runnum; int secres1, secres2; struct tm *tm; @@ -154,8 +155,8 @@ main(argc, argv) database.mtime = (time_t) 0; load_database(&database); secres1 = secres2 = run_at_secres(&database); - run_reboot_jobs(&database); cron_sync(secres1); + run_reboot_jobs(&database); runnum = 0; while (TRUE) { # if DEBUGGING @@ -210,6 +211,9 @@ run_reboot_jobs(db) if (e->flags & WHEN_REBOOT) { job_add(e, u); } + if (e->flags & INTERVAL) { + e->lastexit = TargetTime; + } } } (void) job_runqueue(); @@ -313,6 +317,13 @@ cron_tick(cron_db *db, int secres) env_get("LOGNAME", e->envp), e->uid, e->gid, e->cmd)) + if (e->flags & INTERVAL) { + if (e->lastexit > 0 && + TargetTime >= e->lastexit + e->interval) + job_add(e, u); + continue; + } + if ( diff != 0 && (e->flags & (RUN_AT|NOT_UNTIL)) ) { if (bit_test(e->second, otzsecond) && bit_test(e->minute, otzminute) @@ -489,6 +500,7 @@ sigchld_handler(int x) ("[%d] sigchld...no dead kids\n", getpid())) return; default: + find_interval_entry(pid); Debug(DPROC, ("[%d] sigchld...pid #%d died, stat=%d\n", getpid(), pid, WEXITSTATUS(waiter))) @@ -557,9 +569,26 @@ run_at_secres(cron_db *db) for (u = db->head; u != NULL; u = u->next) { for (e = u->crontab; e != NULL; e = e->next) { - if ((e->flags & SEC_RES) != 0) + if ((e->flags & (SEC_RES | INTERVAL)) != 0) return 1; } } return 0; +} + +static void +find_interval_entry(pid_t pid) +{ + user *u; + entry *e; + + for (u = database.head; u != NULL; u = u->next) { + for (e = u->crontab; e != NULL; e = e->next) { + if ((e->flags & INTERVAL) && e->child == pid) { + e->lastexit = time(NULL); + e->child = 0; + break; + } + } + } } Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Thu Jun 7 21:24:21 2018 (r334816) +++ head/usr.sbin/cron/cron/cron.h Thu Jun 7 22:38:40 2018 (r334817) @@ -168,19 +168,29 @@ typedef struct _entry { #endif char **envp; char *cmd; - bitstr_t bit_decl(second, SECOND_COUNT); - bitstr_t bit_decl(minute, MINUTE_COUNT); - bitstr_t bit_decl(hour, HOUR_COUNT); - bitstr_t bit_decl(dom, DOM_COUNT); - bitstr_t bit_decl(month, MONTH_COUNT); - bitstr_t bit_decl(dow, DOW_COUNT); + union { + struct { + bitstr_t bit_decl(second, SECOND_COUNT); + bitstr_t bit_decl(minute, MINUTE_COUNT); + bitstr_t bit_decl(hour, HOUR_COUNT); + bitstr_t bit_decl(dom, DOM_COUNT); + bitstr_t bit_decl(month, MONTH_COUNT); + bitstr_t bit_decl(dow, DOW_COUNT); + }; + struct { + time_t lastexit; + time_t interval; + pid_t child; + }; + }; int flags; #define DOM_STAR 0x01 #define DOW_STAR 0x02 #define WHEN_REBOOT 0x04 -#define RUN_AT 0x08 +#define RUN_AT 0x08 #define NOT_UNTIL 0x10 #define SEC_RES 0x20 +#define INTERVAL 0x40 time_t lastrun; } entry; Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Thu Jun 7 21:24:21 2018 (r334816) +++ head/usr.sbin/cron/cron/do_command.c Thu Jun 7 22:38:40 2018 (r334817) @@ -47,6 +47,8 @@ do_command(e, u) entry *e; user *u; { + pid_t pid; + Debug(DPROC, ("[%d] do_command(%s, (%s,%d,%d))\n", getpid(), e->cmd, u->name, e->uid, e->gid)) @@ -57,9 +59,11 @@ do_command(e, u) * vfork() is unsuitable, since we have much to do, and the parent * needs to be able to run off and fork other processes. */ - switch (fork()) { + switch ((pid = fork())) { case -1: log_it("CRON",getpid(),"error","can't fork"); + if (e->flags & INTERVAL) + e->lastexit = time(NULL); break; case 0: /* child process */ @@ -70,6 +74,12 @@ do_command(e, u) break; default: /* parent process */ + Debug(DPROC, ("[%d] main process forked child #%d, " + "returning to work\n", getpid(), pid)) + if (e->flags & INTERVAL) { + e->lastexit = 0; + e->child = pid; + } break; } Debug(DPROC, ("[%d] main process returning to work\n", getpid())) Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Thu Jun 7 21:24:21 2018 (r334816) +++ head/usr.sbin/cron/crontab/crontab.5 Thu Jun 7 22:38:40 2018 (r334817) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2016 +.Dd June 6, 2018 .Dt CRONTAB 5 .Os .Sh NAME @@ -220,7 +220,10 @@ would cause a command to be run at 4:30 am on the 1st month, plus every Friday. .Pp Instead of the first five fields, -one of eight special strings may appear: +a line may start with +.Sq @ +symbol followed either by one of eight special strings or by a numeric value. +The recognized special strings are: .Bd -literal -offset indent string meaning ------ ------- @@ -235,6 +238,16 @@ string meaning @every_minute Run once a minute, "*/1 * * * *". @every_second Run once a second. .Ed +.Pp +The +.Sq @ +symbol followed by a numeric value has a special notion of running +a job that much seconds after completion of previous invocation of +the job. +Unlike regular syntax, it guarantees not to overlap two or more +invocations of the same job. +The first run is scheduled specified amount of seconds after cron +has started. .Sh EXAMPLE CRON FILE .Bd -literal @@ -251,6 +264,8 @@ MAILTO=paul 0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% 23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday" 5 4 * * sun echo "run at 5 after 4 every sunday" +# run at 5 minutes intervals, no matter how long it takes +@300 svnlite up /usr/src .Ed .Sh SEE ALSO .Xr crontab 1 , @@ -292,7 +307,7 @@ either). .Pp All of the .Sq @ -commands that can appear in place of the first five fields +directives that can appear in place of the first five fields are extensions. .Sh AUTHORS .An Paul Vixie Aq Mt paul@vix.com Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Thu Jun 7 21:24:21 2018 (r334816) +++ head/usr.sbin/cron/lib/entry.c Thu Jun 7 22:38:40 2018 (r334817) @@ -132,6 +132,9 @@ load_entry(file, error_func, pw, envp) } if (ch == '@') { + long interval; + char *endptr; + /* all of these should be flagged and load-limited; i.e., * instead of @hourly meaning "0 * * * *" it should mean * "close to the front of every hour but not 'til the @@ -209,6 +212,13 @@ load_entry(file, error_func, pw, envp) bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1)); bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1)); bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1)); + } else if (*cmd != '\0' && + (interval = strtol(cmd, &endptr, 10)) > 0 && + *endptr == '\0') { + Debug(DPARS, ("load_entry()... %ld seconds " + "since last run\n", interval)) + e->interval = interval; + e->flags = INTERVAL; } else { ecode = e_timespec; goto eof; From owner-svn-src-head@freebsd.org Fri Jun 8 00:15:09 2018 Return-Path: Delivered-To: svn-src-head@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 645851009395; Fri, 8 Jun 2018 00:15:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13EE787FD3; Fri, 8 Jun 2018 00:15:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8CE4275A5; Fri, 8 Jun 2018 00:15:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w580F87C062155; Fri, 8 Jun 2018 00:15:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w580F8fM062154; Fri, 8 Jun 2018 00:15:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201806080015.w580F8fM062154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 8 Jun 2018 00:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334819 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 00:15:09 -0000 Author: glebius Date: Fri Jun 8 00:15:08 2018 New Revision: 334819 URL: https://svnweb.freebsd.org/changeset/base/334819 Log: UMA memory debugging enabled with INVARIANTS consists of two things: trashing freed memory and checking that allocated memory is properly trashed, and also of keeping a bitset of freed items. Trashing/checking creates a lot of CPU cache poisoning, while keeping debugging bitsets consistent creates a lot of contention on UMA zone lock(s). The performance difference between INVARIANTS kernel and normal one is mostly attributed to UMA debugging, rather than to all KASSERT checks in the kernel. Add loader tunable vm.debug.divisor that allows either to turn off UMA debugging completely, or turn it on only for a fraction of allocations, while still running all KASSERTs in kernel. That allows to run INVARIANTS kernels in production environments without reducing load by orders of magnitude, but still doing useful extra checks. Default value is 1, meaning debug every allocation. Value of 0 would disable UMA debugging completely. Values above 1 enable debugging only for every N-th item. It isn't possible to strictly follow the number, but still amount of debugging is reduced roughly by (N-1)/N percent. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15199 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 7 23:59:19 2018 (r334818) +++ head/sys/vm/uma_core.c Fri Jun 8 00:15:08 2018 (r334819) @@ -273,8 +273,25 @@ static int sysctl_vm_zone_count(SYSCTL_HANDLER_ARGS); static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS +static bool uma_dbg_kskip(uma_keg_t keg, void *mem); +static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); static void uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item); + +static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, + "Memory allocation debugging"); + +static u_int dbg_divisor = 1; +SYSCTL_UINT(_vm_debug, OID_AUTO, divisor, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &dbg_divisor, 0, + "Debug & thrash every this item in memory allocator"); + +static counter_u64_t uma_dbg_cnt = EARLY_COUNTER; +static counter_u64_t uma_skip_cnt = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, trashed, CTLFLAG_RD, + &uma_dbg_cnt, "memory items debugged"); +SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFLAG_RD, + &uma_skip_cnt, "memory items skipped, not debugged"); #endif SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); @@ -854,6 +871,18 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star i = start; if (keg->uk_fini != NULL) { for (i--; i > -1; i--) +#ifdef INVARIANTS + /* + * trash_fini implies that dtor was trash_dtor. trash_fini + * would check that memory hasn't been modified since free, + * which executed trash_dtor. + * That's why we need to run uma_dbg_kskip() check here, + * albeit we don't make skip check for other init/fini + * invocations. + */ + if (!uma_dbg_kskip(keg, slab->us_data + (keg->uk_rsize * i)) || + keg->uk_fini != trash_fini) +#endif keg->uk_fini(slab->us_data + (keg->uk_rsize * i), keg->uk_size); } @@ -1958,9 +1987,14 @@ static void uma_startup3(void) { - booted = BOOT_RUNNING; +#ifdef INVARIANTS + TUNABLE_INT_FETCH("vm.debug.divisor", &dbg_divisor); + uma_dbg_cnt = counter_u64_alloc(M_WAITOK); + uma_skip_cnt = counter_u64_alloc(M_WAITOK); +#endif callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); + booted = BOOT_RUNNING; } static uma_keg_t @@ -2205,6 +2239,9 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags uma_cache_t cache; void *item; int cpu, domain, lockfail; +#ifdef INVARIANTS + bool skipdbg; +#endif /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); @@ -2264,14 +2301,22 @@ zalloc_start: KASSERT(item != NULL, ("uma_zalloc: Bucket pointer mangled.")); cache->uc_allocs++; critical_exit(); +#ifdef INVARIANTS + skipdbg = uma_dbg_zskip(zone, item); +#endif if (zone->uz_ctor != NULL && +#ifdef INVARIANTS + (!skipdbg || zone->uz_ctor != trash_ctor || + zone->uz_dtor != trash_dtor) && +#endif zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { atomic_add_long(&zone->uz_fails, 1); zone_free_item(zone, item, udata, SKIP_DTOR); return (NULL); } #ifdef INVARIANTS - uma_dbg_alloc(zone, NULL, item); + if (!skipdbg) + uma_dbg_alloc(zone, NULL, item); #endif if (flags & M_ZERO) uma_zero_item(item, zone); @@ -2794,6 +2839,9 @@ static void * zone_alloc_item(uma_zone_t zone, void *udata, int domain, int flags) { void *item; +#ifdef INVARIANTS + bool skipdbg; +#endif item = NULL; @@ -2801,6 +2849,9 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma goto fail; atomic_add_long(&zone->uz_allocs, 1); +#ifdef INVARIANTS + skipdbg = uma_dbg_zskip(zone, item); +#endif /* * We have to call both the zone's init (not the keg's init) * and the zone's ctor. This is because the item is going from @@ -2813,14 +2864,18 @@ zone_alloc_item(uma_zone_t zone, void *udata, int doma goto fail; } } - if (zone->uz_ctor != NULL) { - if (zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { - zone_free_item(zone, item, udata, SKIP_DTOR); - goto fail; - } + if (zone->uz_ctor != NULL && +#ifdef INVARIANTS + (!skipdbg || zone->uz_ctor != trash_ctor || + zone->uz_dtor != trash_dtor) && +#endif + zone->uz_ctor(item, zone->uz_size, udata, flags) != 0) { + zone_free_item(zone, item, udata, SKIP_DTOR); + goto fail; } #ifdef INVARIANTS - uma_dbg_alloc(zone, NULL, item); + if (!skipdbg) + uma_dbg_alloc(zone, NULL, item); #endif if (flags & M_ZERO) uma_zero_item(item, zone); @@ -2845,6 +2900,9 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata uma_bucket_t bucket; uma_zone_domain_t zdom; int cpu, domain, lockfail; +#ifdef INVARIANTS + bool skipdbg; +#endif /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); @@ -2869,12 +2927,18 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata } #endif #ifdef INVARIANTS - if (zone->uz_flags & UMA_ZONE_MALLOC) - uma_dbg_free(zone, udata, item); - else - uma_dbg_free(zone, NULL, item); -#endif + skipdbg = uma_dbg_zskip(zone, item); + if (skipdbg == false) { + if (zone->uz_flags & UMA_ZONE_MALLOC) + uma_dbg_free(zone, udata, item); + else + uma_dbg_free(zone, NULL, item); + } + if (zone->uz_dtor != NULL && (!skipdbg || + zone->uz_dtor != trash_dtor || zone->uz_ctor != trash_ctor)) +#else if (zone->uz_dtor != NULL) +#endif zone->uz_dtor(item, zone->uz_size, udata); /* @@ -3138,16 +3202,23 @@ zone_release(uma_zone_t zone, void **bucket, int cnt) static void zone_free_item(uma_zone_t zone, void *item, void *udata, enum zfreeskip skip) { - #ifdef INVARIANTS - if (skip == SKIP_NONE) { + bool skipdbg; + + skipdbg = uma_dbg_zskip(zone, item); + if (skip == SKIP_NONE && !skipdbg) { if (zone->uz_flags & UMA_ZONE_MALLOC) uma_dbg_free(zone, udata, item); else uma_dbg_free(zone, NULL, item); } + + if (skip < SKIP_DTOR && zone->uz_dtor != NULL && + (!skipdbg || zone->uz_dtor != trash_dtor || + zone->uz_ctor != trash_ctor)) +#else + if (skip < SKIP_DTOR && zone->uz_dtor != NULL) #endif - if (skip < SKIP_DTOR && zone->uz_dtor) zone->uz_dtor(item, zone->uz_size, udata); if (skip < SKIP_FINI && zone->uz_fini) @@ -3865,6 +3936,43 @@ uma_dbg_getslab(uma_zone_t zone, void *item) return (slab); } +static bool +uma_dbg_zskip(uma_zone_t zone, void *mem) +{ + uma_keg_t keg; + + if ((keg = zone_first_keg(zone)) == NULL) + return (true); + + return (uma_dbg_kskip(keg, mem)); +} + +static bool +uma_dbg_kskip(uma_keg_t keg, void *mem) +{ + uintptr_t idx; + + if (dbg_divisor == 0) + return (true); + + if (dbg_divisor == 1) + return (false); + + idx = (uintptr_t)mem >> PAGE_SHIFT; + if (keg->uk_ipers > 1) { + idx *= keg->uk_ipers; + idx += ((uintptr_t)mem & PAGE_MASK) / keg->uk_rsize; + } + + if ((idx / dbg_divisor) * dbg_divisor != idx) { + counter_u64_add(uma_skip_cnt, 1); + return (true); + } + counter_u64_add(uma_dbg_cnt, 1); + + return (false); +} + /* * Set up the slab's freei data such that uma_dbg_free can function. * @@ -3875,8 +3983,6 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * uma_keg_t keg; int freei; - if (zone_first_keg(zone) == NULL) - return; if (slab == NULL) { slab = uma_dbg_getslab(zone, item); if (slab == NULL) @@ -3905,8 +4011,6 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i uma_keg_t keg; int freei; - if (zone_first_keg(zone) == NULL) - return; if (slab == NULL) { slab = uma_dbg_getslab(zone, item); if (slab == NULL) From owner-svn-src-head@freebsd.org Fri Jun 8 00:47:25 2018 Return-Path: Delivered-To: svn-src-head@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 7DFE51009FEB; Fri, 8 Jun 2018 00:47:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22D466903F; Fri, 8 Jun 2018 00:47:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F270627A7F; Fri, 8 Jun 2018 00:47:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w580lO3h077009; Fri, 8 Jun 2018 00:47:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w580lOIU077008; Fri, 8 Jun 2018 00:47:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806080047.w580lOIU077008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 00:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334820 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 334820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 00:47:25 -0000 Author: mjg Date: Fri Jun 8 00:47:24 2018 New Revision: 334820 URL: https://svnweb.freebsd.org/changeset/base/334820 Log: amd64: fix a retarded bug in memset memset fills the target buffer from a byte-sized value passed in as the second argument. The fully-sized (8 bytes) register containing it is named %rsi. Lower 4 bytes can be referred to as %esi and finally the lowest byte is %sil. Vast majority of all the callers just zero the target buffer and set it up by doing xor %esi,%esi which has a side-effect of zeroing the upper parts of the register as well. Some others do a word-sized move to %esi which has the same result. However, there are callers which only fill %sil. This does *not* clear up the rest of the register. The value of %rsi is multiplied by $0x0101010101010101 to create a 8-byte sized pattern for 8-byte stores. Prior to the patch, the func just blindly took %rsi assuming the unwanted bytes are zeroed out. Since this is not the case for the callers which only play with %sil (the rest of the register can have absolutely anything), the resulting pattern can be garbage. This has potential for funny bugs. One side effect (which was not amusing) after enabling it instead of bzero was that the kernel was hanging on boot as a xen domU. Reported by: Trond Endrestøl Pointy hat: me Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Jun 8 00:15:08 2018 (r334819) +++ head/sys/amd64/amd64/support.S Fri Jun 8 00:47:24 2018 (r334820) @@ -271,8 +271,9 @@ ENTRY(memset) PUSH_FRAME_POINTER movq %rdi,%r9 movq %rdx,%rcx + movzbq %sil,%r8 movabs $0x0101010101010101,%rax - imulq %rsi,%rax + imulq %r8,%rax shrq $3,%rcx rep stosq From owner-svn-src-head@freebsd.org Fri Jun 8 00:58:26 2018 Return-Path: Delivered-To: svn-src-head@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 0837A100A3A9 for ; Fri, 8 Jun 2018 00:58:26 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (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 8B8856961E for ; Fri, 8 Jun 2018 00:58:25 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-qt0-x232.google.com with SMTP id s9-v6so11903953qtg.2 for ; Thu, 07 Jun 2018 17:58:25 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZGK5DS+n8zG/JwvLnebKqP9pFKFH2t37zP192E44Pw0=; b=ZA05YrfngbjPtYURm+q7ChR02QPj7EmoOZJ4fbB77eyhQu+jwn7kix4CSHTeGj0iwo P5szRFBSFFaxS6F4htf/fxKdrrKYiOk6H3KcmBbJQdR+/oLkwjpaY2CIS5UFuhAKZREJ nyQwkz5hZ6KEYSrKXXMPAvbdEv6QkPbxon3qDt3DpTxBITEH5dkKexHNw3CUWgCHd02L uVF4t/s4UPTBbEQB0ck+brjCzcRmseBpzv0fykN+cefr/8/qtweWTOnDjyfPDVcJWQHa C82B1+z91L8JB47eu5951jzkvBLJGWUiZ4bt1Kx3jwB6y2q7TQVWhGqUASGFTv1bpbaK zI7A== X-Gm-Message-State: APt69E0DxEn9hmaMoo87jUPt9tnlrh22+TKpk5qIOFNcxFXaE/Tz0azH +6t6X7uAX7p9S0RNCTFDQvC4Fw== X-Google-Smtp-Source: ADUXVKJ6pvMkIozr3l5zE+XDGmvy0T856fjYwn/TyQtNSuS9upjcdl1GkVi1bFgBt697uUmNGVNtig== X-Received: by 2002:aed:242a:: with SMTP id r39-v6mr4003307qtc.207.1528419504911; Thu, 07 Jun 2018 17:58:24 -0700 (PDT) Received: from [172.20.1.52] ([38.64.177.126]) by smtp.gmail.com with ESMTPSA id p80-v6sm19829655qka.83.2018.06.07.17.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 17:58:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: <20180607220121.GC62424@strugglingcoder.info> Date: Thu, 7 Jun 2018 20:58:21 -0400 Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> References: <201806071818.w57IIENp080093@repo.freebsd.org> <20180607220121.GC62424@strugglingcoder.info> To: hiren panchasara X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 00:58:26 -0000 > On Jun 7, 2018, at 6:01 PM, hiren panchasara = wrote: >=20 > On 06/07/18 at 06:18P, Randall Stewart wrote: >> Author: rrs >> Date: Thu Jun 7 18:18:13 2018 >> New Revision: 334804 >> URL: https://svnweb.freebsd.org/changeset/base/334804 >>=20 >> Log: >> This commit brings in a new refactored TCP stack called Rack. >> Rack includes the following features: >> - A different SACK processing scheme (the old sack structures are = not used). >> - RACK (Recent acknowledgment) where counting dup-acks is no longer = done >> instead time is used to knwo when to retransmit. (see the = I-D) >> - TLP (Tail Loss Probe) where we will probe for tail-losses to = attempt >> to try not to take a retransmit time-out. (see the I-D) >> - Burst mitigation using TCPHTPS >> - PRR (partial rate reduction) see the RFC. >>=20 >> Once built into your kernel, you can select this stack by either >> socket option with the name of the stack is "rack" or by setting >> the global sysctl so the default is rack. >>=20 >> Note that any connection that does not support SACK will be kicked >> back to the "default" base FreeBSD stack (currently known as = "default"). >>=20 >> To build this into your kernel you will need to enable in your >> kernel: >> makeoptions WITH_EXTRA_TCP_STACKS=3D1 >> options TCPHPTS >>=20 >> Sponsored by: Netflix Inc. >> Differential Revision: = https://reviews.freebsd.org/D15525 >>=20 >> Added: >> head/sys/modules/tcp/rack/ >> head/sys/modules/tcp/rack/Makefile (contents, props changed) >> head/sys/netinet/tcp_stacks/rack.c (contents, props changed) >> head/sys/netinet/tcp_stacks/rack_bbr_common.h (contents, props = changed) >> head/sys/netinet/tcp_stacks/sack_filter.c (contents, props = changed) >> head/sys/netinet/tcp_stacks/sack_filter.h (contents, props = changed) >> head/sys/netinet/tcp_stacks/tcp_rack.h (contents, props changed) >> Modified: >> head/sys/kern/uipc_sockbuf.c >> head/sys/modules/tcp/Makefile >> head/sys/netinet/tcp.h >> head/sys/netinet/tcp_log_buf.h >> head/sys/netinet/tcp_output.c >> head/sys/netinet/tcp_stacks/fastpath.c >> head/sys/netinet/tcp_timer.c >> head/sys/netinet/tcp_timer.h >> head/sys/netinet/tcp_var.h >> head/sys/sys/mbuf.h >> head/sys/sys/queue.h >> head/sys/sys/sockbuf.h >> head/sys/sys/time.h >=20 > I thought we'd have more time to review/test this. Looks like BSDCan > commit-spree in effect. :-) The Phabricator review has been up since May 22nd. Thats over 2.5 weeks, this was also discussed on the Thursday conference calls. >=20 > A few questions: > 1) Does RACK work reliably without HPTS? If yes, has that config been > tested? >=20 No it requires the pacer. > 2) It looks like PRR is tied to RACK. Why did we go that route? > Shouldn't it be easily used with the 'default' stack also? >=20 It is what I developed.. and I had no desire to work with the default = stack. That is a fifth rail that no one wants touched. > 3) Can new SACK be used with the traditional stack? Well if you want to rework the base stack you might be able to do that = :) It would be quite some effort.. I think Robert wants eventually the old stack to be de-composed and then slowly work at getting more common code between them until eventually you can have a diff and somehow figure out how to integrate the two. >=20 > 4) Where should manpage like info for RACK go? a new man-page or > extending tcp(4)? Info like how to enable system-wide or per socket > should go here. >=20 The enable/disable or per-socket I think is in with the pluggable stack stuff. We might want a Rack man page.. have to think about it. > 5) Any perf numbers to go along with this commit? Synthetic or > production numbers showing improvements in transfer speed or any other > impact on CPU usage (specially with HPTS) that you can share? >=20 CPU will be more but we see close to a drop in rebuffers by about 12% I = am told. > 6) In your testing, have you found cases where RACK does poorly = compared > to the 'default' stack? Any recommendations on when should RACK be > enabled? (Something like this could go in the manpage.) Nope.=20 R >=20 > Glad to finally see this in -head! >=20 > Cheers, > Hiren -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@freebsd.org Fri Jun 8 01:25:09 2018 Return-Path: Delivered-To: svn-src-head@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 0A281100AFD7; Fri, 8 Jun 2018 01:25:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE3A06A909; Fri, 8 Jun 2018 01:25:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DEB6106; Fri, 8 Jun 2018 01:25:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w581P8Cb097180; Fri, 8 Jun 2018 01:25:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w581P71T097178; Fri, 8 Jun 2018 01:25:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806080125.w581P71T097178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Jun 2018 01:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334821 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 01:25:09 -0000 Author: kevans Date: Fri Jun 8 01:25:07 2018 New Revision: 334821 URL: https://svnweb.freebsd.org/changeset/base/334821 Log: bsdgrep(1): Slooowly peel away the chunky onion (or peel off the band-aid, whatever floats your boat) This addresses two separate issues: 1.) Nothing within bsdgrep actually knew whether it cared about line numbers or not. 2.) The file layer knew nothing about the context in which it was being called. #1 is only important when we're *not* processing line-by-line. #2 is debatably a good idea; the parsing context is only handy because that's where we store current offset information and, as of this commit, whether or not it needs to be line-aware. Modified: head/usr.bin/grep/file.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Fri Jun 8 00:47:24 2018 (r334820) +++ head/usr.bin/grep/file.c Fri Jun 8 01:25:07 2018 (r334821) @@ -95,7 +95,7 @@ grep_lnbufgrow(size_t newlen) } char * -grep_fgetln(struct file *f, size_t *lenp) +grep_fgetln(struct file *f, struct parsec *pc) { unsigned char *p; char *ret; @@ -109,18 +109,18 @@ grep_fgetln(struct file *f, size_t *lenp) if (bufrem == 0) { /* Return zero length to indicate EOF */ - *lenp = 0; + pc->ln.len= 0; return (bufpos); } - /* Look for a newline in the remaining part of the buffer */ + /* Look for a newline in the remaining part of the [6rbuffer */ if ((p = memchr(bufpos, fileeol, bufrem)) != NULL) { ++p; /* advance over newline */ ret = bufpos; len = p - bufpos; bufrem -= len; bufpos = p; - *lenp = len; + pc->ln.len = len; return (ret); } @@ -155,11 +155,11 @@ grep_fgetln(struct file *f, size_t *lenp) bufpos = p; break; } - *lenp = len; + pc->ln.len = len; return (lnbuf); error: - *lenp = 0; + pc->ln.len = 0; return (NULL); } Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Fri Jun 8 00:47:24 2018 (r334820) +++ head/usr.bin/grep/grep.h Fri Jun 8 01:25:07 2018 (r334821) @@ -97,6 +97,21 @@ struct epat { int mode; }; +/* + * Parsing context; used to hold things like matches made and + * other useful bits + */ +struct parsec { + regmatch_t matches[MAX_MATCHES]; /* Matches made */ + /* XXX TODO: This should be a chunk, not a line */ + struct str ln; /* Current line */ + size_t lnstart; /* Position in line */ + size_t matchidx; /* Latest match index */ + int printed; /* Metadata printed? */ + bool binary; /* Binary file? */ + bool cntlines; /* Count lines? */ +}; + /* Flags passed to regcomp() and regexec() */ extern int cflags, eflags; @@ -141,4 +156,4 @@ void clearqueue(void); /* file.c */ void grep_close(struct file *f); struct file *grep_open(const char *path); -char *grep_fgetln(struct file *f, size_t *len); +char *grep_fgetln(struct file *f, struct parsec *pc); Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Jun 8 00:47:24 2018 (r334820) +++ head/usr.bin/grep/util.c Fri Jun 8 01:25:07 2018 (r334821) @@ -57,20 +57,6 @@ __FBSDID("$FreeBSD$"); static bool first_match = true; /* - * Parsing context; used to hold things like matches made and - * other useful bits - */ -struct parsec { - regmatch_t matches[MAX_MATCHES]; /* Matches made */ - /* XXX TODO: This should be a chunk, not a line */ - struct str ln; /* Current line */ - size_t lnstart; /* Position in line */ - size_t matchidx; /* Latest match index */ - int printed; /* Metadata printed? */ - bool binary; /* Binary file? */ -}; - -/* * Match printing context */ struct mprintc { @@ -276,7 +262,7 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo if (mflag) { /* XXX TODO: Decrement by number of matched lines */ mcount -= 1; - if (mflag && mcount <= 0) + if (mcount <= 0) return (false); } } else if (mc->doctx) @@ -327,6 +313,7 @@ procfile(const char *fn) pc.ln.boff = 0; pc.ln.off = -1; pc.binary = f->binary; + pc.cntlines = false; memset(&mc, 0, sizeof(mc)); mc.printmatch = true; if ((pc.binary && binbehave == BINFILE_BIN) || cflag || qflag || @@ -334,6 +321,8 @@ procfile(const char *fn) mc.printmatch = false; if (mc.printmatch && (Aflag != 0 || Bflag != 0)) mc.doctx = true; + if (mc.printmatch && (Aflag != 0 || Bflag != 0 || mflag || nflag)) + pc.cntlines = true; mcount = mlimit; for (lines = 0; lines == 0 || !(lflag || qflag); ) { @@ -349,7 +338,7 @@ procfile(const char *fn) pc.ln.boff = 0; pc.ln.off += pc.ln.len + 1; /* XXX TODO: Grab a chunk */ - if ((pc.ln.dat = grep_fgetln(f, &pc.ln.len)) == NULL || + if ((pc.ln.dat = grep_fgetln(f, &pc)) == NULL || pc.ln.len == 0) break; From owner-svn-src-head@freebsd.org Fri Jun 8 01:55:49 2018 Return-Path: Delivered-To: svn-src-head@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 D5D03100B87D; Fri, 8 Jun 2018 01:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDF16B66F; Fri, 8 Jun 2018 01:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DBB25EE; Fri, 8 Jun 2018 01:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w581tmWK012443; Fri, 8 Jun 2018 01:55:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w581tlpY012437; Fri, 8 Jun 2018 01:55:47 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806080155.w581tlpY012437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 8 Jun 2018 01:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334822 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 01:55:49 -0000 Author: eadler Date: Fri Jun 8 01:55:47 2018 New Revision: 334822 URL: https://svnweb.freebsd.org/changeset/base/334822 Log: top(1): fix several style & const related issues - use parens for return - put function names on newline - sprinkle const where possible Modified: head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/top.c head/usr.bin/top/username.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Fri Jun 8 01:25:07 2018 (r334821) +++ head/usr.bin/top/display.c Fri Jun 8 01:55:47 2018 (r334822) @@ -464,8 +464,8 @@ void u_cpustates(int *states) { int value; - char **names; - char *thisname; + const char * const *names; + const char *thisname; int *lp; int *colp; int cpu; @@ -514,40 +514,34 @@ void z_cpustates(void) { int i = 0; - char **names; + const char **names; char *thisname; - int *lp; int cpu, value; -for (cpu = 0; cpu < num_cpus; cpu++) { - names = cpustate_names; + for (cpu = 0; cpu < num_cpus; cpu++) { + names = cpustate_names; - /* show tag and bump lastline */ - if (num_cpus == 1) - printf("\nCPU: "); - else { - value = printf("\nCPU %d: ", cpu); - while (value++ <= cpustates_column) - printf(" "); - } - lastline++; + /* show tag and bump lastline */ + if (num_cpus == 1) + printf("\nCPU: "); + else { + value = printf("\nCPU %d: ", cpu); + while (value++ <= cpustates_column) + printf(" "); + } + lastline++; - while ((thisname = *names++) != NULL) - { - if (*thisname != '\0') - { - printf("%s %% %s", (i++ % num_cpustates) == 0 ? "" : ", ", thisname); - } + while ((thisname = *names++) != NULL) + { + if (*thisname != '\0') + { + printf("%s %% %s", (i++ % num_cpustates) == 0 ? "" : ", ", thisname); + } + } } -} /* fill the "last" array with all -1s, to insure correct updating */ - lp = lcpustates; - i = num_cpustates * num_cpus; - while (--i >= 0) - { - *lp++ = -1; - } + memset(lcpustates, -1, num_cpustates * num_cpus); } /* Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 8 01:25:07 2018 (r334821) +++ head/usr.bin/top/machine.c Fri Jun 8 01:55:47 2018 (r334822) @@ -260,7 +260,7 @@ find_uid(uid_t needle, int *haystack) for (; i < TOP_MAX_UIDS; ++i) if ((uid_t)haystack[i] == needle) return 1; - return 0; + return (0); } void @@ -615,7 +615,7 @@ get_system_info(struct system_info *si) static const struct kinfo_proc * get_old_proc(struct kinfo_proc *pp) { - struct kinfo_proc **oldpp, *oldp; + const struct kinfo_proc * const *oldpp, *oldp; /* * If this is the first fetch of the kinfo_procs then we don't have Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Jun 8 01:25:07 2018 (r334821) +++ head/usr.bin/top/top.c Fri Jun 8 01:55:47 2018 (r334822) @@ -1,4 +1,4 @@ -/* +/*- * Top users/processes display for Unix * * This program may be freely redistributed, @@ -144,7 +144,7 @@ handle_user(char *buf, size_t buflen) if (readline(buf, buflen, false) <= 0) { clear_message(); - return rc; + return (rc); } if (buf[0] == '+' || buf[0] == '-') @@ -186,7 +186,7 @@ handle_user(char *buf, size_t buflen) end: putchar('\r'); - return rc; + return (rc); } int @@ -214,7 +214,7 @@ main(int argc, char *argv[]) char *env_top; const char **preset_argv; int preset_argc = 0; - char **av; + const char **av; int ac; bool dostates = false; bool do_unames = true; @@ -523,7 +523,7 @@ main(int argc, char *argv[]) { if ((order_index = string_index(order_name, statics.order_names)) == -1) { - char **pp; + const char * const *pp; fprintf(stderr, "%s: '%s' is not a recognized sorting order.\n", myname, order_name); Modified: head/usr.bin/top/username.c ============================================================================== --- head/usr.bin/top/username.c Fri Jun 8 01:25:07 2018 (r334821) +++ head/usr.bin/top/username.c Fri Jun 8 01:55:47 2018 (r334822) @@ -102,7 +102,7 @@ int enter_user(int uid, char name[], bool wecare) if (!is_empty_hash(hashindex)) { if (!wecare) - return 0; /* Don't clobber a slot for trash */ + return (0); /* Don't clobber a slot for trash */ if (hash_table[hashindex].uid == uid) return(hashindex); /* Fortuitous find */ } Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Fri Jun 8 01:25:07 2018 (r334821) +++ head/usr.bin/top/utils.c Fri Jun 8 01:55:47 2018 (r334822) @@ -66,7 +66,8 @@ atoiwi(const char *str) */ _Static_assert(sizeof(int) <= 4, "buffer too small for this sized int"); -char *itoa(unsigned int val) +char * +itoa(unsigned int val) { char *ptr; static char buffer[16]; /* result is built here */ @@ -94,7 +95,8 @@ char *itoa(unsigned int val) * a front end to a more general routine for efficiency. */ -char *itoa7(int val) +char * +itoa7(int val) { char *ptr; static char buffer[16]; /* result is built here */ @@ -125,7 +127,8 @@ char *itoa7(int val) * positive numbers. If val <= 0 then digits(val) == 0. */ -int digits(int val) +int +digits(int val) { int cnt = 0; @@ -182,7 +185,7 @@ argparse(char *line, int *cntp) ap++; } } - return argv; + return (argv); } /* @@ -313,7 +316,8 @@ format_time(long seconds) #define NUM_STRINGS 8 -char *format_k(int amt) +char * +format_k(int amt) { static char retarray[NUM_STRINGS][16]; static int index = 0; From owner-svn-src-head@freebsd.org Fri Jun 8 01:57:41 2018 Return-Path: Delivered-To: svn-src-head@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 65BAB100B9D2; Fri, 8 Jun 2018 01:57:41 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 043156B9C7; Fri, 8 Jun 2018 01:57:40 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 46E8317859; Thu, 7 Jun 2018 18:57:40 -0700 (PDT) Date: Thu, 7 Jun 2018 18:57:40 -0700 From: hiren panchasara To: Randall Stewart Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys Message-ID: <20180608015740.GD62424@strugglingcoder.info> References: <201806071818.w57IIENp080093@repo.freebsd.org> <20180607220121.GC62424@strugglingcoder.info> <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jL2BoiuKMElzg3CS" Content-Disposition: inline In-Reply-To: <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 01:57:41 -0000 --jL2BoiuKMElzg3CS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/07/18 at 08:58P, Randall Stewart wrote: >=20 >=20 > > On Jun 7, 2018, at 6:01 PM, hiren panchasara wrote: > >=20 > > On 06/07/18 at 06:18P, Randall Stewart wrote: > >> Author: rrs > >> Date: Thu Jun 7 18:18:13 2018 > >> New Revision: 334804 > >> URL: https://svnweb.freebsd.org/changeset/base/334804 > >>=20 > >> Log: > >> This commit brings in a new refactored TCP stack called Rack. > >> Rack includes the following features: > >> - A different SACK processing scheme (the old sack structures are no= t used). > >> - RACK (Recent acknowledgment) where counting dup-acks is no longer = done > >> instead time is used to knwo when to retransmit. (see the I-D) > >> - TLP (Tail Loss Probe) where we will probe for tail-losses to attem= pt > >> to try not to take a retransmit time-out. (see the I-D) > >> - Burst mitigation using TCPHTPS > >> - PRR (partial rate reduction) see the RFC. > >>=20 > >> Once built into your kernel, you can select this stack by either > >> socket option with the name of the stack is "rack" or by setting > >> the global sysctl so the default is rack. > >>=20 > >> Note that any connection that does not support SACK will be kicked > >> back to the "default" base FreeBSD stack (currently known as "defaul= t"). > >>=20 > >> To build this into your kernel you will need to enable in your > >> kernel: > >> makeoptions WITH_EXTRA_TCP_STACKS=3D1 > >> options TCPHPTS > >>=20 > >> Sponsored by: Netflix Inc. > >> Differential Revision: https://reviews.freebsd.org/D15525 > >>=20 > >> Added: > >> head/sys/modules/tcp/rack/ > >> head/sys/modules/tcp/rack/Makefile (contents, props changed) > >> head/sys/netinet/tcp_stacks/rack.c (contents, props changed) > >> head/sys/netinet/tcp_stacks/rack_bbr_common.h (contents, props chan= ged) > >> head/sys/netinet/tcp_stacks/sack_filter.c (contents, props changed) > >> head/sys/netinet/tcp_stacks/sack_filter.h (contents, props changed) > >> head/sys/netinet/tcp_stacks/tcp_rack.h (contents, props changed) > >> Modified: > >> head/sys/kern/uipc_sockbuf.c > >> head/sys/modules/tcp/Makefile > >> head/sys/netinet/tcp.h > >> head/sys/netinet/tcp_log_buf.h > >> head/sys/netinet/tcp_output.c > >> head/sys/netinet/tcp_stacks/fastpath.c > >> head/sys/netinet/tcp_timer.c > >> head/sys/netinet/tcp_timer.h > >> head/sys/netinet/tcp_var.h > >> head/sys/sys/mbuf.h > >> head/sys/sys/queue.h > >> head/sys/sys/sockbuf.h > >> head/sys/sys/time.h > >=20 > > I thought we'd have more time to review/test this. Looks like BSDCan > > commit-spree in effect. :-) >=20 > The Phabricator review has been up since May 22nd. Thats over 2.5 weeks, > this was also discussed on the Thursday conference calls. Fair enough. (I am out of touch a little so shouldn't really complain ;-)) > >=20 > > A few questions: > > 1) Does RACK work reliably without HPTS? If yes, has that config been > > tested? > >=20 > No it requires the pacer. >=20 > > 2) It looks like PRR is tied to RACK. Why did we go that route? > > Shouldn't it be easily used with the 'default' stack also? > >=20 >=20 > It is what I developed.. and I had no desire to work with the default sta= ck. That > is a fifth rail that no one wants touched. >=20 > > 3) Can new SACK be used with the traditional stack? >=20 > Well if you want to rework the base stack you might be able to do that :) >=20 > It would be quite some effort.. I think Robert wants eventually the old > stack to be de-composed and then slowly work at getting more common > code between them until eventually you can have a diff and somehow > figure out how to integrate the two. Okay. I believe there might be situations where we may want to still keep the 'default' stack alive. I know Windows doesn't yet use RACK when rtt is lesser than 10ms (or something like that), as an example. Such optimizations (PRR, better SACK) should be made available to that also if we see non-RACK having a viable future. >=20 > >=20 > > 4) Where should manpage like info for RACK go? a new man-page or > > extending tcp(4)? Info like how to enable system-wide or per socket > > should go here. > >=20 >=20 > The enable/disable or per-socket I think is in with the pluggable stack > stuff. We might want a Rack man page.. have to think about it. >=20 > > 5) Any perf numbers to go along with this commit? Synthetic or > > production numbers showing improvements in transfer speed or any other > > impact on CPU usage (specially with HPTS) that you can share? > >=20 >=20 > CPU will be more but we see close to a drop in rebuffers by about 12% I a= m told. Great. Thanks. >=20 > > 6) In your testing, have you found cases where RACK does poorly compared > > to the 'default' stack? Any recommendations on when should RACK be > > enabled? (Something like this could go in the manpage.) >=20 > Nope.=20 Okay. I assuming the 2 places this got tested at (NFLX and LLNW) would have provided enough variety in terms of traffic types. Thanks again, Hiren --jL2BoiuKMElzg3CS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJbGeKRXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/ljPsH/ilifGCroYcPYnC/NNauw9Dy qtb16sdkFURaVX2qktda8QOFQoA6NuiEx8g1DOA88JwaFkWAS6xArNX8FahD5LmJ z/0OeX/PZZY7SBI+9sGXxa1/SD+RaOR+FfTFbmz5fZlnuBn7gqJvItiX/koVSVBn +Zg8CarG4YhBA8eKumAfOxFaM/LOkI5lmb1F25vU7vsJ9iGiNrbukdoK4t8bY1Va WXwj5Wj6cZv0o5b0AiY5LVfZxg0+Ka0pjHVAsVonYce3WFAF0TS34NPpztOSnUKp nLztOBPzhQpLpPUzdK/+dqyBjytBBBpwTUzwGjDtLFQS3iQo295cdN2b/R857OM= =9wYv -----END PGP SIGNATURE----- --jL2BoiuKMElzg3CS-- From owner-svn-src-head@freebsd.org Fri Jun 8 02:03:52 2018 Return-Path: Delivered-To: svn-src-head@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 997FD100BE87; Fri, 8 Jun 2018 02:03:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5296C07C; Fri, 8 Jun 2018 02:03:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CC70796; Fri, 8 Jun 2018 02:03:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5823qrF017470; Fri, 8 Jun 2018 02:03:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5823qqJ017469; Fri, 8 Jun 2018 02:03:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806080203.w5823qqJ017469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 8 Jun 2018 02:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334823 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 02:03:52 -0000 Author: eadler Date: Fri Jun 8 02:03:51 2018 New Revision: 334823 URL: https://svnweb.freebsd.org/changeset/base/334823 Log: top(1): remove some unneeded indirection Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 8 01:55:47 2018 (r334822) +++ head/usr.bin/top/machine.c Fri Jun 8 02:03:51 2018 (r334823) @@ -753,15 +753,6 @@ get_process_info(struct system_info *si, struct proces struct kinfo_proc *pp; struct timespec previous_proc_uptime; - /* these are copied out of sel for speed */ - int show_idle; - int show_jid; - int show_self; - int show_system; - int show_uid; - int show_pid; - int show_kidle; - /* * If thread state was toggled, don't cache the previous processes. */ @@ -797,7 +788,7 @@ get_process_info(struct system_info *si, struct proces pbase = kvm_getprocs(kd, sel->thread ? KERN_PROC_ALL : KERN_PROC_PROC, 0, &nproc); - (void)gettimeofday(&proc_wall_time, NULL); + gettimeofday(&proc_wall_time, NULL); if (clock_gettime(CLOCK_UPTIME, &proc_uptime) != 0) memset(&proc_uptime, 0, sizeof(proc_uptime)); else if (previous_proc_uptime.tv_sec != 0 && @@ -817,21 +808,12 @@ get_process_info(struct system_info *si, struct proces onproc = nproc; } if (pref == NULL || pbase == NULL || pcpu == NULL) { - (void) fprintf(stderr, "top: Out of memory.\n"); + fprintf(stderr, "top: Out of memory.\n"); quit(TOP_EX_SYS_ERROR); } /* get a pointer to the states summary array */ si->procstates = process_states; - /* set up flags which define what we are going to select */ - show_idle = sel->idle; - show_jid = sel->jid != -1; - show_self = sel->self == -1; - show_system = sel->system; - show_uid = sel->uid[0] != -1; - show_pid = sel->pid != -1; - show_kidle = sel->kidle; - /* count up process states and get pointers to interesting procs */ total_procs = 0; active_procs = 0; @@ -846,11 +828,11 @@ get_process_info(struct system_info *si, struct proces /* not in use */ continue; - if (!show_self && pp->ki_pid == sel->self) + if (sel->self != -1 && pp->ki_pid == sel->self) /* skip self */ continue; - if (!show_system && (pp->ki_flag & P_SYSTEM)) + if (!sel->system && (pp->ki_flag & P_SYSTEM)) /* skip system process */ continue; @@ -866,32 +848,32 @@ get_process_info(struct system_info *si, struct proces /* skip zombies */ continue; - if (!show_kidle && pp->ki_tdflags & TDF_IDLETD) + if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD) /* skip kernel idle process */ continue; PCTCPU(pp) = proc_calc_pctcpu(pp); if (sel->thread && PCTCPU(pp) > 1.0) PCTCPU(pp) = 1.0; - if (displaymode == DISP_CPU && !show_idle && + if (displaymode == DISP_CPU && !sel->idle && (!proc_used_cpu(pp) || pp->ki_stat == SSTOP || pp->ki_stat == SIDL)) /* skip idle or non-running processes */ continue; - if (displaymode == DISP_IO && !show_idle && p_io == 0) + if (displaymode == DISP_IO && !sel->idle && p_io == 0) /* skip processes that aren't doing I/O */ continue; - if (show_jid && pp->ki_jid != sel->jid) + if (sel->jid != -1 && pp->ki_jid != sel->jid) /* skip proc. that don't belong to the selected JID */ continue; - if (show_uid && !find_uid(pp->ki_ruid, sel->uid)) + if (sel->uid[0] != -1 && !find_uid(pp->ki_ruid, sel->uid)) /* skip proc. that don't belong to the selected UID */ continue; - if (show_pid && pp->ki_pid != sel->pid) + if (sel->pid != -1 && pp->ki_pid != sel->pid) continue; *prefp++ = pp; @@ -909,7 +891,7 @@ get_process_info(struct system_info *si, struct proces /* pass back a handle */ handle.next_proc = pref; handle.remaining = active_procs; - return ((void*)&handle); + return (&handle); } static char fmt[512]; /* static area where result is built */ From owner-svn-src-head@freebsd.org Thu Jun 7 15:35:32 2018 Return-Path: Delivered-To: svn-src-head@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 401F7FE172F; Thu, 7 Jun 2018 15:35:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 D62F76FE56; Thu, 7 Jun 2018 15:35:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1971D5A9F13; Thu, 7 Jun 2018 15:35:31 +0000 (UTC) Date: Thu, 7 Jun 2018 15:35:31 +0000 From: Brooks Davis To: Eugene Grosbein Cc: Brad Davis , Ian Lepore , rgrimes@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607153531.GA58360@spindle.one-eyed-alien.net> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> <5B19453E.1030503@grosbein.net> <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> <5B194C98.2050109@grosbein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <5B194C98.2050109@grosbein.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Fri, 08 Jun 2018 02:13:44 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:35:32 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 07, 2018 at 10:17:44PM +0700, Eugene Grosbein wrote: > 07.06.2018 22:00, Brad Davis wrote: >=20 > >> You see, my point is that you can never know beforehand of all=20 > >> challenges a sysadmin faces in fields. > >> And there should be really good reason to break things that work befor= e. > >> Like, solving some significant issue we have with current setup. Do we= =20 > >> have such? > >=20 > > This is not affected by my changes, you can install *additional* things= in /etc/rc.d and they won't be touched just as today. >=20 > Do we have any convention on naming such custom additional scripts instal= led in /etc/rc.d > locally so that installworld would never overwrite them silently? script-domain.tld is almost certainly safe. -- Brooks --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbGVDCAAoJEKzQXbSebgfAjvgH/1Mgx8+0KU4QhXrz4ZMDxnEM e34s4t4N9bR+s3k+6L1lb152UaUwn1ittpcx5jnKk9X63YbHjXhNhvmRQkTdeosr CY8IlSkDfHgVql/cQcVfbHJFk9jpS+fPLCihgCAXUVb/05OZsIpHVgZkewz4YfFg jWLMmokersW/IDW//9J6+Hj83oDB9S75IR3Y7UULgHQAiWDkwnbPNkn2IXYMbDbY mazABY7VWuFXv4xibikFOYI3icJUyYUlDat99SQSE9O/boQJ/5qKbZL85n8epnYK 9dFS74x9lR9/IKJwyDfeFgAZf9GChoJSVa4KYWZeuuN75yE2YoCEVJekR7ti97M= =ODX7 -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY-- From owner-svn-src-head@freebsd.org Thu Jun 7 18:39:49 2018 Return-Path: Delivered-To: svn-src-head@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 6C580FE7CE7 for ; Thu, 7 Jun 2018 18:39:49 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CF5B678C58 for ; Thu, 7 Jun 2018 18:39:48 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w57IdVhp069726 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Jun 2018 20:39:32 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: svn-src-head@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w57IdRSt025965 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 8 Jun 2018 01:39:27 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r334617 - in head: . etc To: Brooks Davis References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> <5B19453E.1030503@grosbein.net> <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> <5B194C98.2050109@grosbein.net> <20180607153531.GA58360@spindle.one-eyed-alien.net> Cc: Brad Davis , Ian Lepore , rgrimes@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Eugene Grosbein Message-ID: <5B197BD9.7010903@grosbein.net> Date: Fri, 8 Jun 2018 01:39:21 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20180607153531.GA58360@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-Mailman-Approved-At: Fri, 08 Jun 2018 02:13:44 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:39:49 -0000 07.06.2018 22:35, Brooks Davis wrote: >>>> You see, my point is that you can never know beforehand of all >>>> challenges a sysadmin faces in fields. >>>> And there should be really good reason to break things that work before. >>>> Like, solving some significant issue we have with current setup. Do we >>>> have such? >>> >>> This is not affected by my changes, you can install *additional* things in /etc/rc.d and they won't be touched just as today. >> >> Do we have any convention on naming such custom additional scripts installed in /etc/rc.d >> locally so that installworld would never overwrite them silently? > > script-domain.tld is almost certainly safe. That is, "script.local" should always be fine? That's fine. From owner-svn-src-head@freebsd.org Thu Jun 7 18:46:32 2018 Return-Path: Delivered-To: svn-src-head@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 1441AFE8029; Thu, 7 Jun 2018 18:46:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 B18B779256; Thu, 7 Jun 2018 18:46:31 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id EF8D65A9F12; Thu, 7 Jun 2018 18:46:30 +0000 (UTC) Date: Thu, 7 Jun 2018 18:46:30 +0000 From: Brooks Davis To: Eugene Grosbein Cc: Brooks Davis , Brad Davis , Ian Lepore , rgrimes@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r334617 - in head: . etc Message-ID: <20180607184630.GA61321@spindle.one-eyed-alien.net> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> <5B187A4C.4080009@grosbein.net> <1528377453.2843918.1399734904.04D5276A@webmail.messagingengine.com> <5B19453E.1030503@grosbein.net> <1528383601.2883538.1399851720.3D636725@webmail.messagingengine.com> <5B194C98.2050109@grosbein.net> <20180607153531.GA58360@spindle.one-eyed-alien.net> <5B197BD9.7010903@grosbein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <5B197BD9.7010903@grosbein.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Fri, 08 Jun 2018 02:13:45 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:46:32 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 08, 2018 at 01:39:21AM +0700, Eugene Grosbein wrote: > 07.06.2018 22:35, Brooks Davis wrote: >=20 > >>>> You see, my point is that you can never know beforehand of all=20 > >>>> challenges a sysadmin faces in fields. > >>>> And there should be really good reason to break things that work bef= ore. > >>>> Like, solving some significant issue we have with current setup. Do = we=20 > >>>> have such? > >>> > >>> This is not affected by my changes, you can install *additional* thin= gs in /etc/rc.d and they won't be touched just as today. > >> > >> Do we have any convention on naming such custom additional scripts ins= talled in /etc/rc.d > >> locally so that installworld would never overwrite them silently? > >=20 > > script-domain.tld is almost certainly safe. >=20 > That is, "script.local" should always be fine? That's fine. In practice anything with a '.' is going to be safe because such scripts can't have name=3D which is our internal convention. -- Brooks --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbGX2GAAoJEKzQXbSebgfA8NMH/2bsccv4zgOzFTIhIecm+ENc 35FqrjDYou08N0PzLlXxVagzaUkJtIuLkmrp4YNDwBuyTUH2e4A6kM4YLzvt/W4F vtGsLIGVyt84JzZHJbJ4pwQNyiW7MEdqHgkGkk1CndHFpC5CnOKdVrS+i6NDyH4y AdjQrIqp1LKDbo6MwDEBLq5/qBKM/K3CfayApk764eqE8CDvdEl6eRfrhihAr4MA +VbWcbyt3VxzTYdCyAuNPUL+PPRKvkpgpL4OF9hJ96x8P/+wU0KvRPIbDqzCpV6t W5Ps2WngVWTO8xYKa1hhhSMTBT+ro1gImHHiUy5PFn/srR697+lNrbuGdg6o1Jc= =1LEf -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- From owner-svn-src-head@freebsd.org Thu Jun 7 18:47:31 2018 Return-Path: Delivered-To: svn-src-head@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 2B0A8FE8074; Thu, 7 Jun 2018 18:47:31 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A134E7934D; Thu, 7 Jun 2018 18:47:30 +0000 (UTC) (envelope-from peter@wemm.org) Received: from [IPv6:2001:4998:effd:7801::1037] (rav1-1-gci-pool-general-2001-4998-effd-7801-1037.corp.yahoo.com [IPv6:2001:4998:effd:7801::1037]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: peter) by smtp2.wemm.org (Postfix) with ESMTPSA id 75BDA46E; Thu, 7 Jun 2018 11:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1528397249; bh=bEPVHva9jd6BpBX/8G4KnDuNJ3qkRauUaZb0M58jQaE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=HOb0sZQGU3WrRAfc8unDaCCReizKHYKD+jbl/ZFTs7AMzbxOZ1QeJvHNlNotaweRX 1NSetYoCh4y2NO/46Yk/e3T+A/WhiYIITuUG1rMBx1vDSGPUzZuUmw0x16CnpAacXe 3G146eONo+J1d3dUoj24DeUhsMFz1F/ErvakIAO8= Subject: Re: svn commit: r334617 - in head: . etc To: Ian Lepore , rgrimes@FreeBSD.org, Brad Davis Cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> From: Peter Wemm Message-ID: Date: Thu, 7 Jun 2018 14:47:27 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1528315608.25377.3.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Mailman-Approved-At: Fri, 08 Jun 2018 02:13:45 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:47:31 -0000 On 6/6/18 4:06 PM, Ian Lepore wrote: > On Wed, 2018-06-06 at 11:33 -0700, Rodney W. Grimes wrote: >>> >>> On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: >>>> On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: >>>>> 06.06.2018 1:26, Konstantin Belousov wrote: >>>>> >>>>>>>> I find it often very useful to do >>>>>>>>  (cd src/etc/rc.d && make install) >>>>>>>> Same for defaults and several other directories which in >>>>>>>> fact >>>>>>>> contains> > >>> non-editable content.  Is this planned to >>>>>>>> keep working ? >>>>>>> The short answer is, no.  All rc.d scripts get moved to the >>>>>>> src >>>>>>> of the program they start.> > >> >>>>>>> That said, if there is a big need for this, we can see >>>>>>> about >>>>>>> options to keep them working.> > >> >>>>>>> What are you trying to accomplish when you do this?  Just >>>>>>> verify >>>>>>> the rc.d scripts match your src tree?> > > >>>>>> I avoid mergemaster/etcupdate and whatever else. rc.d and >>>>>> /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable >>>>>> to etc, they are >>>>>> binaries> > > provided by the project not for the user >>>>>> editing. >>>>>> >>>>>> When upgrading the host, esp. on HEAD, i usually refresh >>>>>> scripts >>>>>> by this> > > procedure and avoid any editing and implied >>>>>> conflict resolution >>>>>> for real> > > configs. >>>>>> >>>>>> Not being able to easily install clean copies of these >>>>>> scripts >>>>>> would> > > be very inconvenient and time consuming. >>>>> I found that "mergemaster -iFUP" deals with unchanged files >>>>> including mentioned rc* scripts just fine.> > That is, it >>>>> automatically refreshes unchanged files without any >>>>> silly questions just for change of $FreeBSD$.> >>>> No, you missed the point.  Whatever nice is the handling of >>>> unchanged files,> use of mergemaster forces me to handle changed >>>> files, which is exactly> what I do not want/need to do.  Yes, I >>>> update crashboxes very >>>> often, and> I want to get all new code, including the startup >>>> scripts, when >>>> I update. >>> The startup scripts will be installed as part of installworld. >> So each installworld would wipe over the top of any localmod >> /etc/rc.d/ and other stuff >> that mght exist? >> One of the reasons that etc/Makefile is detached from Installword is >> so that >> /etc does not get perturbuted unless specifically requested. >> > I don't understand the drama over this.  rc.d startup scripts are > *binaries*. Users are not expected to modify the system installed > binaries, and if they do, it is expected that the next installworld > will replace them with the system binaries again. > This is not the case.  Example: /etc/rc.d/serial Other random examples of things installed by etc/Makefile that are expected to be merged rather than spammed as part of an installworld: etc/ttys etc/inetd.conf etc/dhclient.conf etc/login.conf etc/sysctl.conf -Peter From owner-svn-src-head@freebsd.org Thu Jun 7 18:49:45 2018 Return-Path: Delivered-To: svn-src-head@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 BB4B6FE81DC; Thu, 7 Jun 2018 18:49:45 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 668D979500; Thu, 7 Jun 2018 18:49:45 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D871921BF6; Thu, 7 Jun 2018 14:49:44 -0400 (EDT) Received: from web4 ([10.202.2.214]) by compute5.internal (MEProxy); Thu, 07 Jun 2018 14:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zrykow 4zGfy9b0xK6t2es/AwVSeyXC74miY4FwaPmrs=; b=mdxQS103x/8pT6UCw71mge 3m5EERiAGGLdY/ARwKmr6jpkPnXVkgOB4SNBzD1V0Q1GM5irwGxwulzQnQiZFWEn eYWmfVKE9582ENAD46UJ0jHQujTdFlAXj0FOUPeB0R4lz6EAcHgVnL8n2Y13DRAy rZ/qR4eKK1gKQu/CadTNdx4u1BBJujNiFVWHF8TNIIgFEImjg1dOsLNwtQfQqDHq 3VYnB8S3G3RgS+L3QLrq8O7IZnsgT6no0fquC/fieWoAIRhMbv0I2m5eZFX+L82h Dr2NEM9AhQThGRrndDq3Ebs3XJa3c3T+uOxhuDDsrVLxQzeSamQnRkCn+VtM00iQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 92CDBBA50D; Thu, 7 Jun 2018 14:49:44 -0400 (EDT) Message-Id: <1528397384.4013734.1400124584.7FDF6485@webmail.messagingengine.com> From: Brad Davis To: Peter Wemm , Ian Lepore , rgrimes@FreeBSD.org Cc: Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , "src-committers" , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Date: Thu, 07 Jun 2018 12:49:44 -0600 Subject: Re: svn commit: r334617 - in head: . etc References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528315608.25377.3.camel@freebsd.org> In-Reply-To: X-Mailman-Approved-At: Fri, 08 Jun 2018 02:13:45 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 18:49:46 -0000 On Thu, Jun 7, 2018, at 12:47 PM, Peter Wemm wrote: > On 6/6/18 4:06 PM, Ian Lepore wrote: >=20 > > On Wed, 2018-06-06 at 11:33 -0700, Rodney W. Grimes wrote: > >>> > >>> On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: > >>>> On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: > >>>>> 06.06.2018 1:26, Konstantin Belousov wrote: > >>>>> > >>>>>>>> I find it often very useful to do > >>>>>>>> =C2=A0(cd src/etc/rc.d && make install) > >>>>>>>> Same for defaults and several other directories which in > >>>>>>>> fact > >>>>>>>> contains> > >>> non-editable content.=C2=A0=C2=A0Is this planned= to > >>>>>>>> keep working ? > >>>>>>> The short answer is, no.=C2=A0=C2=A0All rc.d scripts get moved to= the > >>>>>>> src > >>>>>>> of the program they start.> > >> > >>>>>>> That said, if there is a big need for this, we can see > >>>>>>> about > >>>>>>> options to keep them working.> > >> > >>>>>>> What are you trying to accomplish when you do this?=C2=A0=C2=A0Ju= st > >>>>>>> verify > >>>>>>> the rc.d scripts match your src tree?> > > > >>>>>> I avoid mergemaster/etcupdate and whatever else. rc.d and > >>>>>> /etc/rc,> > > /etc/rc.subr /etc/rc.network are not suitable > >>>>>> to etc, they are > >>>>>> binaries> > > provided by the project not for the user > >>>>>> editing. > >>>>>> > >>>>>> When upgrading the host, esp. on HEAD, i usually refresh > >>>>>> scripts > >>>>>> by this> > > procedure and avoid any editing and implied > >>>>>> conflict resolution > >>>>>> for real> > > configs. > >>>>>> > >>>>>> Not being able to easily install clean copies of these > >>>>>> scripts > >>>>>> would> > > be very inconvenient and time consuming. > >>>>> I found that "mergemaster -iFUP" deals with unchanged files > >>>>> including mentioned rc* scripts just fine.> > That is, it > >>>>> automatically refreshes unchanged files without any > >>>>> silly questions just for change of $FreeBSD$.> > >>>> No, you missed the point.=C2=A0=C2=A0Whatever nice is the handling of > >>>> unchanged files,> use of mergemaster forces me to handle changed > >>>> files, which is exactly> what I do not want/need to do.=C2=A0=C2=A0Y= es, I > >>>> update crashboxes very > >>>> often, and> I want to get all new code, including the startup > >>>> scripts, when > >>>> I update. > >>> The startup scripts will be installed as part of installworld. > >> So each installworld would wipe over the top of any localmod > >> /etc/rc.d/ and other stuff > >> that mght exist? > >> One of the reasons that etc/Makefile is detached from Installword is > >> so that > >> /etc does not get perturbuted unless specifically requested. > >> > > I don't understand the drama over this.=C2=A0=C2=A0rc.d startup scripts= are > > *binaries*. Users are not expected to modify the system installed > > binaries, and if they do, it is expected that the next installworld > > will replace them with the system binaries again. > > > This is not the case.=C2=A0 Example: /etc/rc.d/serial >=20 > Other random examples of things installed by etc/Makefile that are=20 > expected to be merged rather than spammed as part of an installworld: > etc/ttys > etc/inetd.conf > etc/dhclient.conf > etc/login.conf > etc/sysctl.conf Yes, this discussion is purely about rc stuff. Regards, Brad Davis From owner-svn-src-head@freebsd.org Fri Jun 8 03:07:10 2018 Return-Path: Delivered-To: svn-src-head@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 B3D9E100D7D8; Fri, 8 Jun 2018 03:07:10 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 2A9236E77A; Fri, 8 Jun 2018 03:07:10 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it0-x243.google.com with SMTP id 76-v6so625210itx.4; Thu, 07 Jun 2018 20:07:10 -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=0gsHOZzkRMaphNKVpokIi0IvIB2k+j9gCdlX5geVTik=; b=J69vgGQiG9fiUgzPZ2QfxlQ2T2vicCMBqVfmR9/BZnzmE4dwygEvYTG5yezrOKxiFl xu1PRIJtfFNXypq3B/mUlC/4o0h7e0AJO4GXoXa4Jj1EOwGUo8jCPXYOCfq1NMwUnEzz REkViyyrQthFjl71Yk2NcX6Kok7AE6CkO6dD+kwXri8RbfDjJTA2m22U9Bf7hMJVgPdv plZJ0Mou1GmV5fzikmJqT5E2KXwM7k0qZU+5V86Rqs4+NGwVRSSNOmqD/q9+I+jdbaAj Va3ph+Y8xwEZXrzxZMs2X0AJ3OR0yH8+d0X5XoDLPsXCFmQ0Nn4ZNstdMgxS6v+A7wlP smhg== 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=0gsHOZzkRMaphNKVpokIi0IvIB2k+j9gCdlX5geVTik=; b=by6oBqCdiqKZZmW34/yrEJ/VzB6ee5x5ZHLFZVYKKHAZoWErGXEUTeDT4a7JjDX7X3 vlC3IU/a6rjciXVy9bFARGDQyK/GSg95qgLOD0U3EVc1CFQ0v6Op52GN/nSSk4jbLllU mF9ijfXuY3hOVnT5Ps7fHKW/6ck30mEU5uNIwMbSGQ3J+oYdv5OYx9S57oOSYpOgzQdJ 1N7m7+IAoyJBgBYtGg/PuAqPESCmQkqbe1J1GG12dM4mN5FokGefE+nDhEKxmHb/i3ts S/3nX2pQob8kw65NFSKEAZFWAIfIXsENVyBg/TsVhL7T0GIkXI6ic7xgF2J9EoKCyhPh rnOQ== X-Gm-Message-State: APt69E0AJIX7nMHJfH3IGRxTrhv0pmqT9tnuQoa08mP2ZlXtebYKUOIl O4xJ+ra88wQe8NZjORT0l98HnzLhEoNIHlkhgVED4Q== X-Google-Smtp-Source: ADUXVKJnwVB7RsrOcxrg2BtDftZjXN+mdjRoEK6KCvQF2/f38LgcGiXjE4W4P3yRvsT6rcdBTZv4ACaNVXa2eihQIlA= X-Received: by 2002:a24:2745:: with SMTP id g66-v6mr244615ita.77.1528427229428; Thu, 07 Jun 2018 20:07:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 20:07:08 -0700 (PDT) In-Reply-To: <20180608015740.GD62424@strugglingcoder.info> References: <201806071818.w57IIENp080093@repo.freebsd.org> <20180607220121.GC62424@strugglingcoder.info> <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> <20180608015740.GD62424@strugglingcoder.info> From: Matthew Macy Date: Thu, 7 Jun 2018 20:07:08 -0700 Message-ID: Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys To: hiren panchasara Cc: Randall Stewart , Randall Ray Stewart , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 03:07:10 -0000 > > Okay. I believe there might be situations where we may want to still > keep the 'default' stack alive. I know Windows doesn't yet use RACK when > rtt is lesser than 10ms (or something like that), as an example. > Is there any reason RACK wouldn't work for tracking 10us RTTs? If we know we know the peer doesn't do delack or have enough data in flight and the other stack doesn't have broken LRO, could we just use this in lieu of high resolution timestamps? -M From owner-svn-src-head@freebsd.org Fri Jun 8 03:16:17 2018 Return-Path: Delivered-To: svn-src-head@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 A6DA0100DA2C; Fri, 8 Jun 2018 03:16:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B31D6EC1C; Fri, 8 Jun 2018 03:16:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27FE8134F; Fri, 8 Jun 2018 03:16:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w583GHvN054104; Fri, 8 Jun 2018 03:16:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w583GHp7054103; Fri, 8 Jun 2018 03:16:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806080316.w583GHp7054103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 03:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334824 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 03:16:17 -0000 Author: mjg Date: Fri Jun 8 03:16:16 2018 New Revision: 334824 URL: https://svnweb.freebsd.org/changeset/base/334824 Log: uma: remove M_ZERO support for pcpu zones Nothing in the tree uses it and pcpu zones have a fundamentally different use case than the regular zones - they are not supposed to be allocated and freed all the time. This reduces pollution in the allocation fast path. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 8 02:03:51 2018 (r334823) +++ head/sys/vm/uma_core.c Fri Jun 8 03:16:16 2018 (r334824) @@ -2256,6 +2256,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags } KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zalloc_arg: called with spinlock or critical section held")); + if (zone->uz_flags & UMA_ZONE_PCPU) + MPASS((flags & M_ZERO) == 0); #ifdef DEBUG_MEMGUARD if (memguard_cmp_zone(zone)) { @@ -3604,13 +3606,8 @@ uma_large_free(uma_slab_t slab) static void uma_zero_item(void *item, uma_zone_t zone) { - int i; - if (zone->uz_flags & UMA_ZONE_PCPU) { - CPU_FOREACH(i) - bzero(zpcpu_get_cpu(item, i), zone->uz_size); - } else - bzero(item, zone->uz_size); + bzero(item, zone->uz_size); } unsigned long From owner-svn-src-head@freebsd.org Fri Jun 8 03:42:59 2018 Return-Path: Delivered-To: svn-src-head@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 29A90100E320; Fri, 8 Jun 2018 03:42:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (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 AB8D16FBAA; Fri, 8 Jun 2018 03:42:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x242.google.com with SMTP id e15-v6so14367163iog.1; Thu, 07 Jun 2018 20:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AHR2KZ0fkywotFAz3NDTuq7latJpvMx8jHqJ7JR1qBo=; b=QNvs5MEYiqKd/8U3ULrh0HOydiroKXHEI7HSb067ppnlRjdAup+tcOoMHYV9Yujbye /9twPhf+j7taP+7LeJmerikKtyhXSYgMi8PeMj5qYZ4c3CLPeXx2ruKHTRA6lxmRCAjh GE+p0HfihQsIdPCAuKsgyxtOxbZPZPIOcnIPkBHNjH5eRDdE4Ejo+4GfVyjmd24Jo9MW i5DhYy2+u9MevCCm6d0LII6piEk/Gnxi6mFpG8LqNYTklivtUU7KAICFFW6P9L1xwcVU +iv/+0ok1z8OwKffn5ao4dwNxl1ihf73RKtdfREDzTzvjaSqBSTfGZxXM+QiZy5RrP75 Ig0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AHR2KZ0fkywotFAz3NDTuq7latJpvMx8jHqJ7JR1qBo=; b=TWQLR/nCsbdTvSl05+sKxObW69Ed2sEnC2NN+VrFpFwiA3/BqAPSdtHNP4Nm/Ung+P 4jlGAmxT3T+TcPvNGPBRCgrqPLYRtbu7smrNHM87mINjFC7lB+RNH3QFo2bvDNBe6K1U dOZ629sTfaLwBjR0FF5VlH3XGpEE+XZ0LNXTuHu9M8ck/WAd0wyq8fqwPgXLKypmlhG1 KG3hmACeddKFMPUDjsDpZF4t0NG27nEeB4PgVdvIkbOhQIoZvV2ZxyLihifEYFr0mvZd Zl3KDSfeMjGaR11hKVNXrkl9XHUjJP7iZj2T/fMqr9YpPrPA++s8GQpl4s0xS3FdiBMc fMpQ== X-Gm-Message-State: APt69E1FyW43RnYx+1d7b+xFWlAi4UxxoqlmDRKEl1cTtONll7DrM3w3 C331FgsEIsePCmaWBOVfLDHqO5X9 X-Google-Smtp-Source: ADUXVKKNfiBljas+y3tk31Bt1u/hMlj5fgIrmLunrN+pNam+Tkmq/EtcaEIgsqXxPHRs8MIsl2VXfQ== X-Received: by 2002:a6b:d00c:: with SMTP id x12-v6mr3880532ioa.5.1528429378073; Thu, 07 Jun 2018 20:42:58 -0700 (PDT) Received: from pesky ([72.142.115.10]) by smtp.gmail.com with ESMTPSA id s126-v6sm297065itc.9.2018.06.07.20.42.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 20:42:57 -0700 (PDT) Sender: Mark Johnston Date: Thu, 7 Jun 2018 23:32:42 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, rlibby@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180608033242.GA54099@pesky> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606140311.GU2450@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 03:42:59 -0000 On Wed, Jun 06, 2018 at 05:03:11PM +0300, Konstantin Belousov wrote: > On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: > > Author: jhibbits > > Date: Wed Jun 6 12:57:11 2018 > > New Revision: 334708 > > URL: https://svnweb.freebsd.org/changeset/base/334708 > > > > Log: > > Add a memory barrier after taking a reference on the vnode holdcnt in _vhold > > > > This is needed to avoid a race between the VNASSERT() below, and another > > thread updating the VI_FREE flag, on weakly-ordered architectures. > > > > On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' would > > panic on the assert regularly. > > > > It may be possible to use a weaker barrier, and I'll investigate that once > > all stability issues are worked out on POWER9. > > > > Modified: > > head/sys/kern/vfs_subr.c > > > > Modified: head/sys/kern/vfs_subr.c > > ============================================================================== > > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) > > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) > > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > > if (!locked) { > > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > > +#if !defined(__amd64__) && !defined(__i386__) > > + mb(); > > +#endif > > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > > ("_vhold: vnode with holdcnt is free")); > > return; > First, mb() must not be used in the FreeBSD code at all. > Look at atomic_thread_fenceXXX(9) KPI. > > Second, you need the reciprocal fence between clearing of VI_FREE and > refcount_acquire(), otherwise the added barrier is nop. Most likely, > you got away with it because there is a mutex unlock between clearing > of VI_FREE and acquire, which release semantic you abused. I note that vnlru_free_locked() clears VI_FREE and increments v_holdcnt without an intervening release fence. At this point the caller has not purged the vnode from the name cache, so it seems possible that the panicking thread observed the two stores out of order. In particular, it seems to me that the patch below is necessary, but possibly (probably?) not sufficient: > Does the fence needed for the non-invariants case ? > > Fourth, doesn't v_usecount has the same issues WRT inactivation ? diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 286a871c3631..c97a8ba63612 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1018,6 +1018,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op) */ freevnodes--; vp->v_iflag &= ~VI_FREE; + atomic_thread_fence_rel(); refcount_acquire(&vp->v_holdcnt); mtx_unlock(&vnode_free_list_mtx); @@ -2807,9 +2808,7 @@ _vhold(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (!locked) { if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { -#if !defined(__amd64__) && !defined(__i386__) - mb(); -#endif + atomic_thread_fence_acq(); VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("_vhold: vnode with holdcnt is free")); return; From owner-svn-src-head@freebsd.org Fri Jun 8 04:18:43 2018 Return-Path: Delivered-To: svn-src-head@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 9658D100F455; Fri, 8 Jun 2018 04:18:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40FE270F94; Fri, 8 Jun 2018 04:18:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 066571D6F; Fri, 8 Jun 2018 04:18:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w584IgEj085189; Fri, 8 Jun 2018 04:18:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w584Igfj085188; Fri, 8 Jun 2018 04:18:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806080418.w584Igfj085188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 04:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334826 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 334826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:18:43 -0000 Author: mjg Date: Fri Jun 8 04:18:42 2018 New Revision: 334826 URL: https://svnweb.freebsd.org/changeset/base/334826 Log: amd64: remove now unused bzero, bcmp and bcopy. move pagecopy higher up. Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Fri Jun 8 03:22:39 2018 (r334825) +++ head/sys/amd64/amd64/support.S Fri Jun 8 04:18:42 2018 (r334826) @@ -40,37 +40,31 @@ .text -/* - * bcopy family - * void bzero(void *buf, u_int len) - */ - -/* done */ -ENTRY(bzero) +/* Address: %rdi */ +ENTRY(pagezero) PUSH_FRAME_POINTER - movq %rsi,%rcx + movq $PAGE_SIZE/8,%rcx xorl %eax,%eax - shrq $3,%rcx rep stosq - movq %rsi,%rcx - andq $7,%rcx - rep - stosb POP_FRAME_POINTER ret -END(bzero) +END(pagezero) -/* Address: %rdi */ -ENTRY(pagezero) +/* + * pagecopy(%rdi=from, %rsi=to) + */ +ENTRY(pagecopy) PUSH_FRAME_POINTER movq $PAGE_SIZE/8,%rcx - xorl %eax,%eax + movq %rdi,%r9 + movq %rsi,%rdi + movq %r9,%rsi rep - stosq + movsq POP_FRAME_POINTER ret -END(pagezero) +END(pagecopy) /* Address: %rdi */ ENTRY(sse2_pagezero) @@ -96,95 +90,7 @@ ENTRY(sse2_pagezero) ret END(sse2_pagezero) -ENTRY(bcmp) - PUSH_FRAME_POINTER - test %rdx,%rdx - je 1f - cmpq $64,%rdx - jg 4f - - xor %ecx,%ecx -2: - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmp %r8b,%al - jne 3f - add $0x1,%rcx - cmp %rcx,%rdx - jne 2b -1: - xor %eax,%eax - POP_FRAME_POINTER - retq -3: - mov $1,%eax - POP_FRAME_POINTER - retq -4: - movq %rdx,%rcx - shrq $3,%rcx - repe - cmpsq - jne 5f - - movq %rdx,%rcx - andq $7,%rcx - repe - cmpsb -5: - setne %al - movsbl %al,%eax - POP_FRAME_POINTER - ret -END(bcmp) - /* - * bcopy(src, dst, cnt) - * rdi, rsi, rdx - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 - */ -ENTRY(bcopy) - PUSH_FRAME_POINTER - xchgq %rsi,%rdi - movq %rdx,%rcx - - movq %rdi,%rax - subq %rsi,%rax - cmpq %rcx,%rax /* overlapping && src < dst? */ - jb 1f - - shrq $3,%rcx /* copy by 64-bit words */ - rep - movsq - movq %rdx,%rcx - andq $7,%rcx /* any bytes left? */ - rep - movsb - POP_FRAME_POINTER - ret - - /* ALIGN_TEXT */ -1: - addq %rcx,%rdi /* copy backwards */ - addq %rcx,%rsi - decq %rdi - decq %rsi - andq $7,%rcx /* any fractional bytes? */ - std - rep - movsb - movq %rdx,%rcx /* copy remainder by 32-bit words */ - shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi - rep - movsq - cld - POP_FRAME_POINTER - ret -END(bcopy) - -/* * memmove(dst, src, cnt) * rdi, rsi, rdx * Adapted from bcopy written by: @@ -290,21 +196,6 @@ ENTRY(memset) POP_FRAME_POINTER ret END(memset) - -/* - * pagecopy(%rdi=from, %rsi=to) - */ -ENTRY(pagecopy) - PUSH_FRAME_POINTER - movq $PAGE_SIZE/8,%rcx - movq %rdi,%r9 - movq %rsi,%rdi - movq %r9,%rsi - rep - movsq - POP_FRAME_POINTER - ret -END(pagecopy) /* fillw(pat, base, cnt) */ /* %rdi,%rsi, %rdx */ From owner-svn-src-head@freebsd.org Fri Jun 8 04:36:31 2018 Return-Path: Delivered-To: svn-src-head@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 D497B100F96D; Fri, 8 Jun 2018 04:36:30 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) (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 5F64771985; Fri, 8 Jun 2018 04:36:30 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pf0-f196.google.com with SMTP id q1-v6so5972245pff.13; Thu, 07 Jun 2018 21:36:30 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eWr+q89s0juPBIN1Pvdeheg2vsdFk8HUypAsXVFxk4A=; b=K7Xjv+v3d8E4MM0Tio/5+cuMy3gVE92+AVjroQkQkdIsNLUor9DOm9W4AKmjKwfWah KBbk3+TdWcTv0GRKvbLakl8an37npxbOb2SrKb4j7jUeD16qTrEJtEPc1y/fODtHZFWZ 20ZW3KraJ2dzEENr+7A2xdCDJulOkXxSnFgc2xgYFQ9X8dESkMh5jSVD2UvnNPL15aWt sAIjvS65cyS6pN/yv/1Ex1H3GmwgTg+oA/i/sjCvE/uWlyI+FT2eQRTdzuaZJfg9kL1w It+wHny6M5ohj+d+BaiTvdTzfdKQlHMV8cxa3nQOJ+HGPphZPeY2EuT+PUwNnAIjJpCW L5sw== X-Gm-Message-State: APt69E3w8+oJi0KKzvTNgDvpk5VQE810DKAVt2FN9mOumcooISkZzjdv J/092pHS7cdQneussWno4t/3X1hmHFc= X-Google-Smtp-Source: ADUXVKLCbCTyQFPkezuo7Y6YqJanZ1aI5FfNLefkvLbKSDB39HleHi1kCHQtAKskk4PT/auZKVEznQ== X-Received: by 2002:a62:1bc2:: with SMTP id b185-v6mr4363283pfb.225.1528432171491; Thu, 07 Jun 2018 21:29:31 -0700 (PDT) Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com. [209.85.192.173]) by smtp.gmail.com with ESMTPSA id i88-v6sm10614922pfi.153.2018.06.07.21.29.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 21:29:31 -0700 (PDT) Received: by mail-pf0-f173.google.com with SMTP id q1-v6so5964459pff.13; Thu, 07 Jun 2018 21:29:31 -0700 (PDT) X-Received: by 2002:a63:7b1e:: with SMTP id w30-v6mr3718759pgc.402.1528432170913; Thu, 07 Jun 2018 21:29:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:1581:0:0:0:0 with HTTP; Thu, 7 Jun 2018 21:29:30 -0700 (PDT) In-Reply-To: <20180608033242.GA54099@pesky> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> From: Ryan Libby Date: Thu, 7 Jun 2018 21:29:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Mark Johnston Cc: Konstantin Belousov , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:36:31 -0000 On Thu, Jun 7, 2018 at 8:32 PM, Mark Johnston wrote: > On Wed, Jun 06, 2018 at 05:03:11PM +0300, Konstantin Belousov wrote: >> On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: >> > Author: jhibbits >> > Date: Wed Jun 6 12:57:11 2018 >> > New Revision: 334708 >> > URL: https://svnweb.freebsd.org/changeset/base/334708 >> > >> > Log: >> > Add a memory barrier after taking a reference on the vnode holdcnt in _vhold >> > >> > This is needed to avoid a race between the VNASSERT() below, and another >> > thread updating the VI_FREE flag, on weakly-ordered architectures. >> > >> > On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' would >> > panic on the assert regularly. >> > >> > It may be possible to use a weaker barrier, and I'll investigate that once >> > all stability issues are worked out on POWER9. >> > >> > Modified: >> > head/sys/kern/vfs_subr.c >> > >> > Modified: head/sys/kern/vfs_subr.c >> > ============================================================================== >> > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) >> > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) >> > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); >> > if (!locked) { >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { >> > +#if !defined(__amd64__) && !defined(__i386__) >> > + mb(); >> > +#endif >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, >> > ("_vhold: vnode with holdcnt is free")); >> > return; >> First, mb() must not be used in the FreeBSD code at all. >> Look at atomic_thread_fenceXXX(9) KPI. >> >> Second, you need the reciprocal fence between clearing of VI_FREE and >> refcount_acquire(), otherwise the added barrier is nop. Most likely, >> you got away with it because there is a mutex unlock between clearing >> of VI_FREE and acquire, which release semantic you abused. > > I note that vnlru_free_locked() clears VI_FREE and increments v_holdcnt > without an intervening release fence. At this point the caller has not > purged the vnode from the name cache, so it seems possible that the > panicking thread observed the two stores out of order. In particular, it > seems to me that the patch below is necessary, but possibly (probably?) > not sufficient: Mark, Justin, and I looked at this. I think that the VNASSERT itself is not quite valid, since it is checking the value of v_iflag without the vnode interlock held (and without the vop lock also). If the rule is that we normally need the vnode interlock to check VI_FREE, then I don't think that possible reordering between the refcount_acquire and VI_FREE clearing in vnlru_free_locked is necessarily a problem in production. It might just be that unlocked assertions about v_iflag actually need additional synchronization (although it would be a little unfortunate to add synchronization only to INVARIANTS builds). > >> Does the fence needed for the non-invariants case ? >> >> Fourth, doesn't v_usecount has the same issues WRT inactivation ? > > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > index 286a871c3631..c97a8ba63612 100644 > --- a/sys/kern/vfs_subr.c > +++ b/sys/kern/vfs_subr.c > @@ -1018,6 +1018,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op) > */ > freevnodes--; > vp->v_iflag &= ~VI_FREE; > + atomic_thread_fence_rel(); > refcount_acquire(&vp->v_holdcnt); > > mtx_unlock(&vnode_free_list_mtx); > @@ -2807,9 +2808,7 @@ _vhold(struct vnode *vp, bool locked) > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > if (!locked) { > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > -#if !defined(__amd64__) && !defined(__i386__) > - mb(); > -#endif > + atomic_thread_fence_acq(); > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > ("_vhold: vnode with holdcnt is free")); > return; > From owner-svn-src-head@freebsd.org Fri Jun 8 04:38:13 2018 Return-Path: Delivered-To: svn-src-head@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 DE237100FA0C; Fri, 8 Jun 2018 04:38:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82EFF71AF1; Fri, 8 Jun 2018 04:38:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 5BFCCE9AB; Fri, 8 Jun 2018 04:38:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1746C38E; Fri, 8 Jun 2018 04:38:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id X2abkydYbHFg; Fri, 8 Jun 2018 04:38:08 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 667D438B Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334617 - in head: . etc From: Bryan Drewery X-Mailer: iPhone Mail (15E302) In-Reply-To: <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> Date: Fri, 8 Jun 2018 00:38:05 -0400 Cc: Renato Botelho , Konstantin Belousov , src-committers , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger Content-Transfer-Encoding: quoted-printable Message-Id: References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> To: Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:38:13 -0000 > On Jun 5, 2018, at 16:43, Brad Davis wrote: >=20 >=20 > On Tue, Jun 5, 2018, at 1:07 PM, Renato Botelho wrote: > > On 05/06/18 15:26, Konstantin Belousov wrote: > > > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: > > >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > > >>> I find it often very useful to do > > >>> (cd src/etc/rc.d && make install) > > >>> Same for defaults and several other directories which in fact contai= ns > > >>> non-editable content. Is this planned to keep working ? > > >> > > >> The short answer is, no. All rc.d scripts get moved to the src of th= e program they start. > > >> > > >> That said, if there is a big need for this, we can see about options t= o keep them working. > > >> > > >> What are you trying to accomplish when you do this? Just verify the r= c.d scripts match your src tree? > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc, > > > /etc/rc.subr /etc/rc.network are not suitable to etc, they are binarie= s > > > provided by the project not for the user editing. > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts by th= is > > > procedure and avoid any editing and implied conflict resolution for re= al > > > configs. > > > > > > Not being able to easily install clean copies of these scripts would > > > be very inconvenient and time consuming. > > > > If I understood what Brad is saying, each rc.d script will be installed > > by the application it belongs to. So when it's installing SSH it will > > also install /etc/rc.d/sshd and you will not need to deal with rc.d > > files on mergemaster anymore. > > > > Is it correct, Brad? >=20 > Correct.=20 >=20 This makes no sense. Many rc scripts, and other config files, have no =E2=80= =9Cowner=E2=80=9D outside of etc/... Please don=E2=80=99t kill etc/Makefile. This is going to be very painful to d= eal with downstream. >=20 > Regards, > Brad Davis From owner-svn-src-head@freebsd.org Fri Jun 8 04:44:37 2018 Return-Path: Delivered-To: svn-src-head@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 8C002100FCB2; Fri, 8 Jun 2018 04:44:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2922D71F36; Fri, 8 Jun 2018 04:44:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id F3C3BEB3B; Fri, 8 Jun 2018 04:44:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 375BD3A6; Fri, 8 Jun 2018 04:44:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 9nu37K7WFqIG; Fri, 8 Jun 2018 04:44:33 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 1F06E3A3 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334617 - in head: . etc From: Bryan Drewery X-Mailer: iPhone Mail (15E302) In-Reply-To: <201806062035.w56KZhV8006721@pdx.rh.CN85.dnsmgr.net> Date: Fri, 8 Jun 2018 00:44:30 -0400 Cc: Brad Davis , Konstantin Belousov , Eugene Grosbein , Alexander Leidinger , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201806062035.w56KZhV8006721@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:44:37 -0000 > On Jun 6, 2018, at 16:35, Rodney W. Grimes wrote: >=20 >=20 >> On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: >>>>=20 >>>> On Tue, Jun 5, 2018, at 1:28 PM, Konstantin Belousov wrote: >>>>>> On Wed, Jun 06, 2018 at 01:39:00AM +0700, Eugene Grosbein wrote: >>>>>> 06.06.2018 1:26, Konstantin Belousov wrote: >>>>>>=20 >>>>>>>>> I find it often very useful to do >>>>>>>>> (cd src/etc/rc.d && make install) >>>>>>>>> Same for defaults and several other directories which in fact >>>>>>>>> contains> > >>> non-editable content. Is this planned to keep wor= king ? >>>>>>>>=20 >>>>>>>> The short answer is, no. All rc.d scripts get moved to the src >>>>>>>> of the program they start.> > >> >>>>>>>> That said, if there is a big need for this, we can see about >>>>>>>> options to keep them working.> > >> >>>>>>>> What are you trying to accomplish when you do this? Just verify >>>>>>>> the rc.d scripts match your src tree?> > > >>>>>>> I avoid mergemaster/etcupdate and whatever else. rc.d and /etc/rc,> >= > /etc/rc.subr /etc/rc.network are not suitable to etc, they are >>>>>>> binaries> > > provided by the project not for the user editing. >>>>>>>=20 >>>>>>> When upgrading the host, esp. on HEAD, i usually refresh scripts >>>>>>> by this> > > procedure and avoid any editing and implied conflict re= solution >>>>>>> for real> > > configs. >>>>>>>=20 >>>>>>> Not being able to easily install clean copies of these scripts >>>>>>> would> > > be very inconvenient and time consuming. >>>>>>=20 >>>>>> I found that "mergemaster -iFUP" deals with unchanged files >>>>>> including mentioned rc* scripts just fine.> > That is, it automatical= ly refreshes unchanged files without any >>>>>> silly questions just for change of $FreeBSD$.> >>>>> No, you missed the point. Whatever nice is the handling of >>>>> unchanged files,> use of mergemaster forces me to handle changed files= , which is exactly> what I do not want/need to do. Yes, I update crashboxes= very >>>>> often, and> I want to get all new code, including the startup scripts,= when >>>>> I update. >>>> The startup scripts will be installed as part of installworld. >>>=20 >>> So each installworld would wipe over the top of any localmod /etc/rc.d/=20= >>> and other stuff >>> that mght exist? >>> One of the reasons that etc/Makefile is detached from Installword is so=20= >>> that >>> /etc does not get perturbuted unless specifically requested. >>=20 >> Yes, this is by design. >=20 > This is going to have a great amount of push back, and this is by your NEW= design, > the existing design does not cause this pain. >=20 This is my position as well. Some people may not like or agree that rc scrip= ts are user modifiable but they are and have been =E2=80=9Cforever=E2=80=9D.= The fact that tools like mergemaster have handled merging of them, =E2=80=9C= forever=E2=80=9D, makes this a huge POLA violation to suddenly be replacing t= hem. I don=E2=80=99t see any benefits at all except to pissoff users. Some of these planned changes for etc feel over zealous and under thought ou= t or discussed. Whatever people think about these topics we must consider POLA and not regre= ssing people=E2=80=99s workflows for no benefit other than draconian ideals a= bout what a user is allowed to modify. >>=20 >> If people need custom tweaks for that stuff they should be upstreamed or m= oved into /usr/local/etc/rc.d as a custom startup script. >=20 > I doubt very much this is a practical solution. I have changes that I dou= bt > belong in FreeBSD, and are not restricted to etc/rc.d. And from reading > this thread thus far so do others. >=20 >=20 > --=20 > Rod Grimes rgrimes@freebsd= .org >=20 From owner-svn-src-head@freebsd.org Fri Jun 8 04:58:08 2018 Return-Path: Delivered-To: svn-src-head@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 C6EE7100FF52; Fri, 8 Jun 2018 04:58:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7661772489; Fri, 8 Jun 2018 04:58:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C15723C1; Fri, 8 Jun 2018 04:58:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w584w78L006341; Fri, 8 Jun 2018 04:58:07 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w584w3rn006318; Fri, 8 Jun 2018 04:58:03 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806080458.w584w3rn006318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 04:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys X-SVN-Commit-Revision: 334827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:58:08 -0000 Author: mmacy Date: Fri Jun 8 04:58:03 2018 New Revision: 334827 URL: https://svnweb.freebsd.org/changeset/base/334827 Log: hwpmc: simplify calling convention for hwpmc interrupt handling pmc_process_interrupt takes 5 arguments when only 3 are needed. cpu is always available in curcpu and inuserspace can always be derived from the passed trapframe. While facially a reasonable cleanup this change was motivated by the need to workaround a compiler bug. core2_intr(cpu, tf) -> pmc_process_interrupt(cpu, ring, pmc, tf, inuserspace) -> pmc_add_sample(cpu, ring, pm, tf, inuserspace) In the process of optimizing the tail call the tf pointer was getting clobbered: (kgdb) up at /storage/mmacy/devel/freebsd/sys/dev/hwpmc/hwpmc_mod.c:4709 4709 pmc_save_kernel_callchain(ps->ps_pc, (kgdb) up 1205 error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, resulting in a crash in pmc_save_kernel_callchain. Modified: head/sys/amd64/amd64/trap.c head/sys/arm/arm/pmu.c head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_arm64.c head/sys/dev/hwpmc/hwpmc_armv7.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_mips.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_ppc970.c head/sys/dev/hwpmc/hwpmc_soft.c head/sys/i386/i386/trap.c head/sys/kern/kern_pmc.c head/sys/mips/atheros/apb.c head/sys/mips/cavium/octeon_pmc.c head/sys/powerpc/powerpc/interrupt.c head/sys/sys/pmc.h head/sys/sys/pmckern.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/amd64/amd64/trap.c Fri Jun 8 04:58:03 2018 (r334827) @@ -214,7 +214,7 @@ trap(struct trapframe *frame) * the NMI was consumed by it and we can return immediately. */ if (pmc_intr != NULL && - (*pmc_intr)(PCPU_GET(cpuid), frame) != 0) + (*pmc_intr)(frame) != 0) return; #endif Modified: head/sys/arm/arm/pmu.c ============================================================================== --- head/sys/arm/arm/pmu.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/arm/arm/pmu.c Fri Jun 8 04:58:03 2018 (r334827) @@ -123,7 +123,7 @@ pmu_intr(void *arg) /* Only call into the HWPMC framework if we know there is work. */ if (r != 0 && pmc_intr) { tf = arg; - (*pmc_intr)(PCPU_GET(cpuid), tf); + (*pmc_intr)(tf); } #endif Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_amd.c Fri Jun 8 04:58:03 2018 (r334827) @@ -627,14 +627,15 @@ amd_stop_pmc(int cpu, int ri) */ static int -amd_intr(int cpu, struct trapframe *tf) +amd_intr(struct trapframe *tf) { - int i, error, retval; + int i, error, retval, cpu; uint32_t config, evsel, perfctr; struct pmc *pm; struct amd_cpu *pac; pmc_value_t v; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] out of range CPU %d", __LINE__, cpu)); @@ -688,8 +689,7 @@ amd_intr(int cpu, struct trapframe *tf) wrmsr(perfctr, AMD_RELOAD_COUNT_TO_PERFCTR_VALUE(v)); /* Restart the counter if logging succeeded. */ - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error == 0) wrmsr(evsel, config); } Modified: head/sys/dev/hwpmc/hwpmc_arm64.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm64.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_arm64.c Fri Jun 8 04:58:03 2018 (r334827) @@ -323,18 +323,19 @@ arm64_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -arm64_intr(int cpu, struct trapframe *tf) +arm64_intr(struct trapframe *tf) { struct arm64_cpu *pc; int retval, ri; struct pmc *pm; int error; - int reg; + int reg, cpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[arm64,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; + cpu = curcpu; pc = arm64_pcpu[cpu]; for (ri = 0; ri < arm64_npmcs; ri++) { @@ -357,8 +358,7 @@ arm64_intr(int cpu, struct trapframe *tf) if (pm->pm_state != PMC_STATE_RUNNING) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) arm64_stop_pmc(cpu, ri); Modified: head/sys/dev/hwpmc/hwpmc_armv7.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_armv7.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_armv7.c Fri Jun 8 04:58:03 2018 (r334827) @@ -307,18 +307,19 @@ armv7_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -armv7_intr(int cpu, struct trapframe *tf) +armv7_intr(struct trapframe *tf) { struct armv7_cpu *pc; int retval, ri; struct pmc *pm; int error; - int reg; + int reg, cpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; + cpu = curcpu; pc = armv7_pcpu[cpu]; for (ri = 0; ri < armv7_npmcs; ri++) { @@ -348,8 +349,7 @@ armv7_intr(int cpu, struct trapframe *tf) if (pm->pm_state != PMC_STATE_RUNNING) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) armv7_stop_pmc(cpu, ri); Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Jun 8 04:58:03 2018 (r334827) @@ -1056,7 +1056,7 @@ iap_initialize(struct pmc_mdep *md, int maxcpu, int np } static int -core_intr(int cpu, struct trapframe *tf) +core_intr(struct trapframe *tf) { pmc_value_t v; struct pmc *pm; @@ -1064,11 +1064,11 @@ core_intr(int cpu, struct trapframe *tf) int error, found_interrupt, ri; uint64_t msr; - PMCDBG3(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, + PMCDBG3(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", curcpu, (void *) tf, TRAPF_USERMODE(tf)); found_interrupt = 0; - cc = core_pcpu[cpu]; + cc = core_pcpu[curcpu]; for (ri = 0; ri < core_iap_npmc; ri++) { @@ -1084,8 +1084,7 @@ core_intr(int cpu, struct trapframe *tf) if (pm->pm_state != PMC_STATE_RUNNING) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); v = pm->pm_sc.pm_reloadcount; v = iap_reload_count_to_perfctr_value(v); @@ -1117,7 +1116,7 @@ core_intr(int cpu, struct trapframe *tf) } static int -core2_intr(int cpu, struct trapframe *tf) +core2_intr(struct trapframe *tf) { int error, found_interrupt, n; uint64_t flag, intrstatus, intrenable, msr; @@ -1141,7 +1140,7 @@ core2_intr(int cpu, struct trapframe *tf) (uintmax_t) intrstatus); found_interrupt = 0; - cc = core_pcpu[cpu]; + cc = core_pcpu[curcpu]; KASSERT(cc != NULL, ("[core,%d] null pcpu", __LINE__)); @@ -1173,8 +1172,7 @@ core2_intr(int cpu, struct trapframe *tf) !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) intrenable &= ~flag; @@ -1184,7 +1182,7 @@ core2_intr(int cpu, struct trapframe *tf) /* Reload sampling count. */ wrmsr(IAF_CTR0 + n, v); - PMCDBG4(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", cpu, + PMCDBG4(MDP,INT, 1, "iaf-intr cpu=%d error=%d v=%jx(%jx)", curcpu, error, (uintmax_t) v, (uintmax_t) rdpmc(IAF_RI_TO_MSR(n))); } @@ -1202,8 +1200,7 @@ core2_intr(int cpu, struct trapframe *tf) !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) intrenable &= ~flag; Modified: head/sys/dev/hwpmc/hwpmc_mips.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_mips.c Fri Jun 8 04:58:03 2018 (r334827) @@ -289,8 +289,7 @@ mips_pmc_intr(int cpu, struct trapframe *tf) retval = 1; if (pm->pm_state != PMC_STATE_RUNNING) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error) { /* Clear/disable the relevant counter */ if (ri == 0) Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri Jun 8 04:58:03 2018 (r334827) @@ -207,8 +207,7 @@ static int pmc_debugflags_parse(char *newstr, char *fe #endif static int load(struct module *module, int cmd, void *arg); -static int pmc_add_sample(int cpu, int ring, struct pmc *pm, - struct trapframe *tf, int inuserspace); +static int pmc_add_sample(int ring, struct pmc *pm, struct trapframe *tf); static void pmc_add_thread_descriptors_from_proc(struct proc *p, struct pmc_process *pp); static int pmc_attach_process(struct proc *p, struct pmc *pm); @@ -4640,10 +4639,9 @@ pmc_post_callchain_callback(void) */ static int -pmc_add_sample(int cpu, int ring, struct pmc *pm, struct trapframe *tf, - int inuserspace) +pmc_add_sample(int ring, struct pmc *pm, struct trapframe *tf) { - int error, callchaindepth; + int error, cpu, callchaindepth, inuserspace; struct thread *td; struct pmc_sample *ps; struct pmc_samplebuffer *psb; @@ -4653,8 +4651,9 @@ pmc_add_sample(int cpu, int ring, struct pmc *pm, stru /* * Allocate space for a sample buffer. */ + cpu = curcpu; psb = pmc_pcpu[cpu]->pc_sb[ring]; - + inuserspace = TRAPF_USERMODE(tf); ps = psb->ps_write; if (ps->ps_nsamples == PMC_SAMPLE_INUSE) { counter_u64_add(ps->ps_pmc->pm_runcount, -1); @@ -4743,19 +4742,18 @@ pmc_add_sample(int cpu, int ring, struct pmc *pm, stru */ int -pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe *tf, - int inuserspace) +pmc_process_interrupt(int ring, struct pmc *pm, struct trapframe *tf) { struct thread *td; td = curthread; if ((pm->pm_flags & PMC_F_USERCALLCHAIN) && - (td->td_proc->p_flag & P_KPROC) == 0 && - !inuserspace) { + (td->td_proc->p_flag & P_KPROC) == 0 && + !TRAPF_USERMODE(tf)) { atomic_add_int(&curthread->td_pmcpend, 1); - return (pmc_add_sample(cpu, PMC_UR, pm, tf, 0)); + return (pmc_add_sample(PMC_UR, pm, tf)); } - return (pmc_add_sample(cpu, ring, pm, tf, inuserspace)); + return (pmc_add_sample(ring, pm, tf)); } /* Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Jun 8 04:58:03 2018 (r334827) @@ -702,8 +702,7 @@ mpc7xxx_intr(int cpu, struct trapframe *tf) continue; /* Stop the counter if logging fails. */ - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error != 0) mpc7xxx_stop_pmc(cpu, i); Modified: head/sys/dev/hwpmc/hwpmc_ppc970.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Jun 8 04:58:03 2018 (r334827) @@ -519,8 +519,7 @@ ppc970_intr(int cpu, struct trapframe *tf) if (pm->pm_state != PMC_STATE_RUNNING) continue; - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error != 0) ppc970_stop_pmc(cpu, i); Modified: head/sys/dev/hwpmc/hwpmc_soft.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_soft.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/dev/hwpmc/hwpmc_soft.c Fri Jun 8 04:58:03 2018 (r334827) @@ -425,8 +425,7 @@ pmc_soft_intr(struct pmckern_soft *ks) else continue; user_mode = TRAPF_USERMODE(ks->pm_tf); - error = pmc_process_interrupt(ks->pm_cpu, PMC_SR, pm, - ks->pm_tf, user_mode); + error = pmc_process_interrupt(PMC_SR, pm, ks->pm_tf); if (error) { soft_stop_pmc(ks->pm_cpu, ri); continue; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/i386/i386/trap.c Fri Jun 8 04:58:03 2018 (r334827) @@ -248,7 +248,7 @@ trap(struct trapframe *frame) * return immediately. */ if (pmc_intr != NULL && - (*pmc_intr)(PCPU_GET(cpuid), frame) != 0) + (*pmc_intr)(frame) != 0) return; #endif Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/kern/kern_pmc.c Fri Jun 8 04:58:03 2018 (r334827) @@ -71,7 +71,7 @@ const int pmc_kernel_version = PMC_KERNEL_VERSION; int __read_mostly (*pmc_hook)(struct thread *td, int function, void *arg) = NULL; /* Interrupt handler */ -int __read_mostly (*pmc_intr)(int cpu, struct trapframe *tf) = NULL; +int __read_mostly (*pmc_intr)(struct trapframe *tf) = NULL; DPCPU_DEFINE(uint8_t, pmc_sampled); Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/mips/atheros/apb.c Fri Jun 8 04:58:03 2018 (r334827) @@ -388,7 +388,7 @@ apb_filter(void *arg) tf = td->td_intr_frame; if (pmc_intr) - (*pmc_intr)(PCPU_GET(cpuid), tf); + (*pmc_intr)(PCPU_GET(tf); continue; } /* Ignore timer interrupts */ Modified: head/sys/mips/cavium/octeon_pmc.c ============================================================================== --- head/sys/mips/cavium/octeon_pmc.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/mips/cavium/octeon_pmc.c Fri Jun 8 04:58:03 2018 (r334827) @@ -111,7 +111,7 @@ octeon_pmc_intr(void *arg) struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame; if (pmc_intr) - (*pmc_intr)(PCPU_GET(cpuid), tf); + (*pmc_intr)(PCPU_GET(tf); return (FILTER_HANDLED); } Modified: head/sys/powerpc/powerpc/interrupt.c ============================================================================== --- head/sys/powerpc/powerpc/interrupt.c Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/powerpc/powerpc/interrupt.c Fri Jun 8 04:58:03 2018 (r334827) @@ -112,7 +112,7 @@ powerpc_interrupt(struct trapframe *framep) case EXC_PERF: critical_enter(); KASSERT(pmc_intr != NULL, ("Performance exception, but no handler!")); - (*pmc_intr)(PCPU_GET(cpuid), framep); + (*pmc_intr)(framep); if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep); critical_exit(); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/sys/pmc.h Fri Jun 8 04:58:03 2018 (r334827) @@ -61,7 +61,7 @@ * * The patch version is incremented for every bug fix. */ -#define PMC_VERSION_MAJOR 0x08 +#define PMC_VERSION_MAJOR 0x09 #define PMC_VERSION_MINOR 0x03 #define PMC_VERSION_PATCH 0x0000 @@ -1053,7 +1053,7 @@ struct pmc_mdep { int (*pmd_switch_out)(struct pmc_cpu *_p, struct pmc_process *_pp); /* handle a PMC interrupt */ - int (*pmd_intr)(int _cpu, struct trapframe *_tf); + int (*pmd_intr)(struct trapframe *_tf); /* * PMC class dependent information. @@ -1209,8 +1209,7 @@ MALLOC_DECLARE(M_PMC); struct pmc_mdep *pmc_md_initialize(void); /* MD init function */ void pmc_md_finalize(struct pmc_mdep *_md); /* MD fini function */ int pmc_getrowdisp(int _ri); -int pmc_process_interrupt(int _cpu, int _ring, struct pmc *_pm, - struct trapframe *_tf, int _inuserspace); +int pmc_process_interrupt(int _ring, struct pmc *_pm, struct trapframe *_tf); int pmc_save_kernel_callchain(uintptr_t *_cc, int _maxsamples, struct trapframe *_tf); int pmc_save_user_callchain(uintptr_t *_cc, int _maxsamples, Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Fri Jun 8 04:18:42 2018 (r334826) +++ head/sys/sys/pmckern.h Fri Jun 8 04:58:03 2018 (r334827) @@ -176,7 +176,7 @@ struct pmc_domain_buffer_header { /* hook */ extern int (*pmc_hook)(struct thread *_td, int _function, void *_arg); -extern int (*pmc_intr)(int _cpu, struct trapframe *_frame); +extern int (*pmc_intr)(struct trapframe *_frame); /* SX lock protecting the hook */ extern struct sx pmc_sx; From owner-svn-src-head@freebsd.org Fri Jun 8 04:59:58 2018 Return-Path: Delivered-To: svn-src-head@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 AF4BF100FFCB; Fri, 8 Jun 2018 04:59:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52D52725DE; Fri, 8 Jun 2018 04:59:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 2BCE0EF1E; Fri, 8 Jun 2018 04:59:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6554B3D7; Fri, 8 Jun 2018 04:59:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 9hlvPrByIwC9; Fri, 8 Jun 2018 04:59:55 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com CE38A3D4 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334617 - in head: . etc From: Bryan Drewery X-Mailer: iPhone Mail (15E302) In-Reply-To: <201806041517.w54FHPn0072477@repo.freebsd.org> Date: Fri, 8 Jun 2018 00:59:51 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8BBE4E4C-0E5F-4920-B057-E6F939074448@FreeBSD.org> References: <201806041517.w54FHPn0072477@repo.freebsd.org> To: Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:59:59 -0000 > On Jun 4, 2018, at 11:17, Brad Davis wrote: >=20 > Author: brd > Date: Mon Jun 4 15:17:24 2018 > New Revision: 334617 > URL: https://svnweb.freebsd.org/changeset/base/334617 >=20 > Log: > Move /sys symlink creating out of etc/Makefile. >=20 > This is prep for etc/Makefile going away. >=20 > Approved by: bapt (mentor) >=20 > Modified: > head/Makefile.inc1 > head/etc/Makefile >=20 Aside from other objections, I don=E2=80=99t think /Makefile nor /Makefile.i= nc1 should =E2=80=9Cown=E2=80=9D anything on the system and should only driv= e the build or other general targets for users to interact with. Please put t= his into something like /hier or better yet the existing directory handling t= hat stuff /etc. (so a revert since simply moving everything to it via a rena= me or rewrite seems silly) > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/Makefile.inc1 Mon Jun 4 14:56:02 2018 (r334616) > +++ head/Makefile.inc1 Mon Jun 4 15:17:24 2018 (r334617) > @@ -1239,6 +1239,7 @@ distributeworld installworld stageworld: _installche= ck > METALOG=3D${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ > DISTBASE=3D/base DESTDIR=3D${DESTDIR}/${DISTDIR}/base \ > LOCAL_MTREE=3D${LOCAL_MTREE:Q} distrib-dirs > + ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys > .endif > ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ > ${IMAKEENV} rm -rf ${INSTALLTMP} >=20 > Modified: head/etc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/etc/Makefile Mon Jun 4 14:56:02 2018 (r334616) > +++ head/etc/Makefile Mon Jun 4 15:17:24 2018 (r334617) > @@ -386,7 +386,6 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY > ${METALOG.add} ; \ > done; true > .endif > - ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys > .if ${MK_NLS} !=3D "no" > set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ > while [ $$# -gt 0 ] ; do \ >=20 From owner-svn-src-head@freebsd.org Fri Jun 8 05:01:10 2018 Return-Path: Delivered-To: svn-src-head@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 CD9AA1010069; Fri, 8 Jun 2018 05:01:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F6B4727B0; Fri, 8 Jun 2018 05:01:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6209723F4; Fri, 8 Jun 2018 05:01:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5851Aoo007315; Fri, 8 Jun 2018 05:01:10 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5851ALU007314; Fri, 8 Jun 2018 05:01:10 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806080501.w5851ALU007314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 05:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334828 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:01:11 -0000 Author: mmacy Date: Fri Jun 8 05:01:09 2018 New Revision: 334828 URL: https://svnweb.freebsd.org/changeset/base/334828 Log: hwpmc: avoid undefined variable on LINT Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Jun 8 04:58:03 2018 (r334827) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Jun 8 05:01:09 2018 (r334828) @@ -1118,12 +1118,13 @@ core_intr(struct trapframe *tf) static int core2_intr(struct trapframe *tf) { - int error, found_interrupt, n; + int error, found_interrupt, n, cpu; uint64_t flag, intrstatus, intrenable, msr; struct pmc *pm; struct core_cpu *cc; pmc_value_t v; + cpu = curcpu; PMCDBG3(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); @@ -1140,7 +1141,7 @@ core2_intr(struct trapframe *tf) (uintmax_t) intrstatus); found_interrupt = 0; - cc = core_pcpu[curcpu]; + cc = core_pcpu[cpu]; KASSERT(cc != NULL, ("[core,%d] null pcpu", __LINE__)); From owner-svn-src-head@freebsd.org Fri Jun 8 05:03:06 2018 Return-Path: Delivered-To: svn-src-head@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 DA8F0101022F; Fri, 8 Jun 2018 05:03:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (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 74F9D72B2F; Fri, 8 Jun 2018 05:03:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id d3-v6so12316481qto.1; Thu, 07 Jun 2018 22:03:05 -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=gXCMWOxqFAkbidGNU9RKHmHQAsT5Tc524QWYSp9eqBk=; b=ckhsSD0As07JuG4gcSy7JQfpKdSZDQufDgyijTZOg1zjFf74plOYtkHOGFOUarGeQK iem4YZdt9rH0l9HM6CiZyGnEHribCt6L9yB8adw84t9mtajMwknPDEMoEXrkL5Ei27B9 7QkrlqUX0vZTIIg7ATHLO6SUa6LWrwp775/UA1+MmCR6/MQ+ZmjDa/wqALLGfz5zd7xC 8dUrw2MnSCfjuH0NgB7j7cHChkzESIrRAVP18sptBv2RjKnWniUd8Tp6Yupo+lBzvARH J0O+NG5w8aVLGztuWy9WZ7BshOf4uJAL0+Vzz7b9BAd067ldJf0nEgBXJOqUSpyfXrP9 HV9g== 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=gXCMWOxqFAkbidGNU9RKHmHQAsT5Tc524QWYSp9eqBk=; b=MxbLHJ8R3bDv1DQgL9tjQuyWcoIAAA5ab2Ln3zSVQyL9Z9Bd+YDGWpC6YVQ/jWHYSx 1siMz0VdXcKt2GIkFrCekMfI/HA7atvXavoDVRkXOB9B7S3qtWE5vqFQ7/+6+nUjYzzq beYQ08S8Li151zi2Pk4HktKhh4QXVHKIDCogeLcH3Amur9VPNCKvEJJ0YokuNTjSUxCL RP5V//ZN++HMuJuTGAJayBO777y/vnUuSYFAwJ+sUrijROzx7qpxZZz/XObAYzb7h5Hn t86WOM3f1xKo4fYh6A4vo8tmBKjh/AZlt7c8/DoIDY33ipQUFmahsG/11B2lANoPHsxA RIhA== X-Gm-Message-State: APt69E2VAUd8LVf3JD2TNnsuzHq0hjQ7MK5eTSh60s366wK+w6xqGTeS rmTfKP8AixNvQNyDwgSyhJ+9cCq4QW6BWK1s/MQ= X-Google-Smtp-Source: ADUXVKJQEP+fdmv1oryv3QaX5e1PFpAYF85yv5vzI6fY9mjc3QQ1bDGbZzEeZ1n+0yK7dcKZDXHQU/EH59aYOUPl0No= X-Received: by 2002:ac8:2779:: with SMTP id h54-v6mr4386857qth.85.1528434184934; Thu, 07 Jun 2018 22:03:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:1c4e:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 22:03:04 -0700 (PDT) In-Reply-To: References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> From: Mateusz Guzik Date: Fri, 8 Jun 2018 07:03:04 +0200 Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Ryan Libby Cc: Mark Johnston , Konstantin Belousov , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:03:06 -0000 On Fri, Jun 8, 2018 at 6:29 AM, Ryan Libby wrote: > On Thu, Jun 7, 2018 at 8:32 PM, Mark Johnston wrote: > > On Wed, Jun 06, 2018 at 05:03:11PM +0300, Konstantin Belousov wrote: > >> On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: > >> > Author: jhibbits > >> > Date: Wed Jun 6 12:57:11 2018 > >> > New Revision: 334708 > >> > URL: https://svnweb.freebsd.org/changeset/base/334708 > >> > > >> > Log: > >> > Add a memory barrier after taking a reference on the vnode holdcnt > in _vhold > >> > > >> > This is needed to avoid a race between the VNASSERT() below, and > another > >> > thread updating the VI_FREE flag, on weakly-ordered architectures. > >> > > >> > On a 72-thread POWER9, without this barrier a 'make -j72 > buildworld' would > >> > panic on the assert regularly. > >> > > >> > It may be possible to use a weaker barrier, and I'll investigate > that once > >> > all stability issues are worked out on POWER9. > >> > > >> > Modified: > >> > head/sys/kern/vfs_subr.c > >> > > >> > Modified: head/sys/kern/vfs_subr.c > >> > ============================================================ > ================== > >> > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 > (r334707) > >> > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 > (r334708) > >> > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > >> > if (!locked) { > >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > >> > +#if !defined(__amd64__) && !defined(__i386__) > >> > + mb(); > >> > +#endif > >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > >> > ("_vhold: vnode with holdcnt is free")); > >> > return; > >> First, mb() must not be used in the FreeBSD code at all. > >> Look at atomic_thread_fenceXXX(9) KPI. > >> > >> Second, you need the reciprocal fence between clearing of VI_FREE and > >> refcount_acquire(), otherwise the added barrier is nop. Most likely, > >> you got away with it because there is a mutex unlock between clearing > >> of VI_FREE and acquire, which release semantic you abused. > > > > I note that vnlru_free_locked() clears VI_FREE and increments v_holdcnt > > without an intervening release fence. At this point the caller has not > > purged the vnode from the name cache, so it seems possible that the > > panicking thread observed the two stores out of order. In particular, it > > seems to me that the patch below is necessary, but possibly (probably?) > > not sufficient: > > Mark, Justin, and I looked at this. > > I think that the VNASSERT itself is not quite valid, since it is > checking the value of v_iflag without the vnode interlock held (and > without the vop lock also). If the rule is that we normally need the > vnode interlock to check VI_FREE, then I don't think that possible > reordering between the refcount_acquire and VI_FREE clearing in > vnlru_free_locked is necessarily a problem in production. > Checking it without any locks is perfectly valid in this case. It is done after v_holdcnt gets bumped from a non-zero value. So at that time it is at least two. Of course that result is stale as an arbitrary number of other threads could have bumped and dropped the ref past that point. The minimum value is 1 since we hold the ref. But this means the vnode must not be on the free list and that's what the assertion is verifying. The problem is indeed lack of ordering against the code clearing the flag for the case where 2 threads to vhold and one does the 0->1 transition. That said, the fence is required for the assertion to work. > > It might just be that unlocked assertions about v_iflag actually need > additional synchronization (although it would be a little unfortunate to > add synchronization only to INVARIANTS builds). > > > > >> Does the fence needed for the non-invariants case ? > >> > >> Fourth, doesn't v_usecount has the same issues WRT inactivation ? > > > > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > > index 286a871c3631..c97a8ba63612 100644 > > --- a/sys/kern/vfs_subr.c > > +++ b/sys/kern/vfs_subr.c > > @@ -1018,6 +1018,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op) > > */ > > freevnodes--; > > vp->v_iflag &= ~VI_FREE; > > + atomic_thread_fence_rel(); > This probably has no added value for non-debug kernels. > > refcount_acquire(&vp->v_holdcnt); > > > > mtx_unlock(&vnode_free_list_mtx); > > @@ -2807,9 +2808,7 @@ _vhold(struct vnode *vp, bool locked) > > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > > if (!locked) { > > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > > -#if !defined(__amd64__) && !defined(__i386__) > > - mb(); > > -#endif > > + atomic_thread_fence_acq(); > Same as above. > > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > > ("_vhold: vnode with holdcnt is free")); > > return; > The main codepath which runs into this (... -> cache_lookup -> vhold) most definitely does not need the fence for production operation. What is unclear without audit is whether there are vhold users which need one. I think the patch is fine to go in if the other VI_FREE place gets a comment about a fence stemming from mtx_unlock and there is another one prior to the assertion explaining that this orders against v_iflag tests and may or may not be needed for other consumers. In general the code is *full* of data races and accidental reliance of ordering provided by amd64. Weeding this all out will be a painful exercise. Part of the problem is lack of primitives like READ_ONCE/WRITE_ONCE as seen in the linux kernel, someone should hack up equivalents. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Jun 8 05:07:06 2018 Return-Path: Delivered-To: svn-src-head@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 B58DE1010316; Fri, 8 Jun 2018 05:07:06 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl0-x22f.google.com (mail-pl0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (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 38C2072CD6; Fri, 8 Jun 2018 05:07:06 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl0-x22f.google.com with SMTP id n10-v6so7550750plp.0; Thu, 07 Jun 2018 22:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:openpgp:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TIhD9pDDsZJf/6lkeUXmuRbfBBreVMXjuA+FrRBf2k8=; b=eZh/9ltb8elRYX9G0lMg2D1gJPEjRAaHOKRgW3TjrR8i2Xi/dU/nJo/gFHvo85ffzM dTJdrYRgCTv94XiEnCLPqVdEkKSiVdNjyK0jFCn2ZPDTobRYSyuMlyO9guNKG4fNUpE9 xViUv9S5ktp2c1L75K7cqkZ4h57dlRp/L3WPRSSDKDB4mcsvXFE9PQJMm3m2dOhzXvU6 fGdESDwIRcZFepjwzUuHmAclSvIQdZKLX9+e7SypiCv2ODUd7VrYOFynFjF//Qn6enKx v7Ks8ikXwEzsJzcltLVzzlBkzpkrwJWGltXoTKSw9x4nSVTwOLhncGsnm9zzCpdQpzey YD1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :openpgp:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=TIhD9pDDsZJf/6lkeUXmuRbfBBreVMXjuA+FrRBf2k8=; b=qk0GD0+gfhTSUGnme67oidQ9BzJinLoVUGHB0isJ4rI1iOyKbSjVtr4DWTvp/EqaKx VGafd8uEOYIR4o2HevJ92uo6U51lzfxoaj3EFbMtaIYkvicdO/DfWX+IdbjBJwefcQAY MM2nx/gA3AKUhuPAuAne+lgdY7/+CQM+eWdyU1t4dSqMXGpJZ98gGLGSPpyBC/bTRUKs aPD3dVTARYpI5GOZOZkb9PJW5swrnBc4z10DOjBqb6ou8NRBGCmCSzd6u195BpXH4Etg 76FvDftHrPuogGxWA+Xn21TLS4FV/uuAyIt32f/KU1Kk37gSE03fgTtQ7WBlTfQcokdU 6DyQ== X-Gm-Message-State: APt69E0pM+6rtY4IJKSHKliJ6M/orblMwpb/NSbbpOFSLI2kecX/Zny6 YKuUej4GAHqfLD2xmPuYPLyvpTXX X-Google-Smtp-Source: ADUXVKIWLAz95T/xwb0ze/uXL5dlzqvtJDbIf79pep4X98Cw4WQdHSyz12AFlEFj2WdEZLHGKtVG4A== X-Received: by 2002:a17:902:7c8b:: with SMTP id y11-v6mr2325295pll.222.1528434425016; Thu, 07 Jun 2018 22:07:05 -0700 (PDT) Received: from [192.168.1.102] (116.133.220.111.sta.wbroadband.net.au. [111.220.133.116]) by smtp.gmail.com with ESMTPSA id c4-v6sm24814835pgv.86.2018.06.07.22.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 22:07:04 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r334819 - head/sys/vm To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806080015.w580F8fM062154@repo.freebsd.org> From: Kubilay Kocak Openpgp: preference=signencrypt Message-ID: <77e67765-4244-e207-ff8d-aa6156c985b8@FreeBSD.org> Date: Fri, 8 Jun 2018 15:07:07 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201806080015.w580F8fM062154@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:07:07 -0000 On 8/06/2018 10:15 am, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jun 8 00:15:08 2018 > New Revision: 334819 > URL: https://svnweb.freebsd.org/changeset/base/334819 > > Log: > UMA memory debugging enabled with INVARIANTS consists of two things: > trashing freed memory and checking that allocated memory is properly > trashed, and also of keeping a bitset of freed items. Trashing/checking > creates a lot of CPU cache poisoning, while keeping debugging bitsets > consistent creates a lot of contention on UMA zone lock(s). The performance > difference between INVARIANTS kernel and normal one is mostly attributed > to UMA debugging, rather than to all KASSERT checks in the kernel. > > Add loader tunable vm.debug.divisor that allows either to turn off UMA Is 'sample interval' a standard/common enough term for this kind of mechanism to name the sysctl with it rather than the implementation? Or 'sample frequency' > debugging completely, or turn it on only for a fraction of allocations, > while still running all KASSERTs in kernel. That allows to run INVARIANTS > kernels in production environments without reducing load by orders of > magnitude, but still doing useful extra checks. > > Default value is 1, meaning debug every allocation. Value of 0 would > disable UMA debugging completely. Values above 1 enable debugging only > for every N-th item. It isn't possible to strictly follow the number, > but still amount of debugging is reduced roughly by (N-1)/N percent. > > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D15199 > > +static u_int dbg_divisor = 1; > +SYSCTL_UINT(_vm_debug, OID_AUTO, divisor, > + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &dbg_divisor, 0, > + "Debug & thrash every this item in memory allocator"); Might "Nth" be better (more explicit) here ---^ ? > +static counter_u64_t uma_dbg_cnt = EARLY_COUNTER; > +static counter_u64_t uma_skip_cnt = EARLY_COUNTER; > +SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, trashed, CTLFLAG_RD, > + &uma_dbg_cnt, "memory items debugged"); > +SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFLAG_RD, > + &uma_skip_cnt, "memory items skipped, not debugged"); > #endif From owner-svn-src-head@freebsd.org Fri Jun 8 05:07:19 2018 Return-Path: Delivered-To: svn-src-head@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 EBED31010347; Fri, 8 Jun 2018 05:07:18 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 4DA1B72DD7; Fri, 8 Jun 2018 05:07:18 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it0-x229.google.com with SMTP id k17-v6so4104536ita.0; Thu, 07 Jun 2018 22:07:18 -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=EQ81TYL5ERNZEKvhGNzHcohdvYgOYLMVJZo1uEfne8k=; b=opKk57MDwvHQiVEqOMG+gpiVtMndnioCz3vOtFOoKF6fcPA++jnEOptEn8V7VxTy3g XmUvwi7cnLgOES6u14d6PDn16kmt7jCTBE2gIiYCYu17xQ+VTuWkvql0qkGz7WSACzzp 3ATg6CTpnbekBbUVJ97Eh+3BqmK5AJM4JwV5tvveqLm9KSTDqiQVoT8sKgB0VhISJjaF nkbXaRStRMICFjTBaaG7i02+GJ4kiT/D3wfrUjBezBAgl2i0eYLPIi5xBjIS9uJD7mty uFUduVto0lh5zEYEhHtwdutvEHgexdg6cx/qGbq0UFAmoM+Xah2Ocblzh20M+2dimbrv 4cSA== 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=EQ81TYL5ERNZEKvhGNzHcohdvYgOYLMVJZo1uEfne8k=; b=IJxhvvx/bPFQdmJuReU4opFh2avq03qMEZ2DnJab7fR2FtkaKiQk8iIO6O0f1emRmH BQu0aDAe4wkfjXvZMR8AKOy1TQ9PEDo/VVDM1wyTkZm4kH9YWPmBorMCvIp3VK4YyPNU BE+U1nXRXHn6Tputc16p93nucAFmd9RLhHy7B2G23TwnYwobUNCruK5MS3MH5TLq3it/ TXXXxFj7X6VXoyCoEE8Und9B79AsrrLB+Mow/9JlqJ73jtjY84WxNCv1TvAZtF31GAUa L5tKaDT0udKEPplm6ppISAP0rJrgdxza+tjGjzEAwywvFZ5zHLXqgMI/0OZ3NKIcib8D k1vg== X-Gm-Message-State: APt69E2jWagUy7UgeIqaXChwMDXXLmZCWwTFNRndH8AwSYFWX7LfroXm YD2BSzjklSZ+JziMYDD/J1cyhvrhtgQNHnoH9fk= X-Google-Smtp-Source: ADUXVKJfrqnbBMyvbgPlOXPVUr5EXblveyPvpUXJzVOcK/AXMUhregTTi2guJIWHM6B1QmlnAO4jG496JQ/xLvt+bE0= X-Received: by 2002:a24:4a15:: with SMTP id k21-v6mr496017itb.128.1528434437633; Thu, 07 Jun 2018 22:07:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 22:07:17 -0700 (PDT) In-Reply-To: References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> From: Matthew Macy Date: Thu, 7 Jun 2018 22:07:17 -0700 Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Mateusz Guzik Cc: Ryan Libby , Mark Johnston , Konstantin Belousov , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:07:19 -0000 > The main codepath which runs into this (... -> cache_lookup -> vhold) most > definitely does not need the fence for production operation. > > What is unclear without audit is whether there are vhold users which need > one. I think the patch is fine to go in if the other VI_FREE place gets a > comment about a fence stemming from mtx_unlock and there is another one > prior to the assertion explaining that this orders against v_iflag tests and > may > or may not be needed for other consumers. > > In general the code is *full* of data races and accidental reliance of > ordering > provided by amd64. Weeding this all out will be a painful exercise. > > Part of the problem is lack of primitives like READ_ONCE/WRITE_ONCE as > seen in the linux kernel, someone should hack up equivalents. CK of course has these. We can create a wrapper around them if we don't want to use them directly. -M From owner-svn-src-head@freebsd.org Fri Jun 8 05:17:07 2018 Return-Path: Delivered-To: svn-src-head@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 1A8931010717; Fri, 8 Jun 2018 05:17:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B33A973305; Fri, 8 Jun 2018 05:17:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E5AA2708; Fri, 8 Jun 2018 05:17:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w585H6ag017103; Fri, 8 Jun 2018 05:17:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w585H6cf017102; Fri, 8 Jun 2018 05:17:06 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806080517.w585H6cf017102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 05:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334829 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 334829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:17:07 -0000 Author: mmacy Date: Fri Jun 8 05:17:06 2018 New Revision: 334829 URL: https://svnweb.freebsd.org/changeset/base/334829 Log: rtentry_zinit: don't blindly pass through M_ZERO to counter alloc Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Jun 8 05:01:09 2018 (r334828) +++ head/sys/net/route.c Fri Jun 8 05:17:06 2018 (r334829) @@ -235,7 +235,7 @@ rtentry_zinit(void *mem, int size, int how) { struct rtentry *rt = mem; - rt->rt_pksent = counter_u64_alloc(how); + rt->rt_pksent = counter_u64_alloc(how & ~M_ZERO); if (rt->rt_pksent == NULL) return (ENOMEM); From owner-svn-src-head@freebsd.org Fri Jun 8 05:36:29 2018 Return-Path: Delivered-To: svn-src-head@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 69BDB101106E; Fri, 8 Jun 2018 05:36:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 D7FAE73E48; Fri, 8 Jun 2018 05:36:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w585aDKA053768; Fri, 8 Jun 2018 08:36:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w585aDKA053768 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w585aDkA053767; Fri, 8 Jun 2018 08:36:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 8 Jun 2018 08:36:13 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: Ryan Libby , Mark Johnston , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180608053613.GI2450@kib.kiev.ua> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:36:29 -0000 On Fri, Jun 08, 2018 at 07:03:04AM +0200, Mateusz Guzik wrote: > Part of the problem is lack of primitives like READ_ONCE/WRITE_ONCE as > seen in the linux kernel, someone should hack up equivalents. Only replying to this statement right now. What is the semantic of the _ONCE operations ? Isn't it the same as atomic_load/store (without fences) ? From owner-svn-src-head@freebsd.org Fri Jun 8 05:40:38 2018 Return-Path: Delivered-To: svn-src-head@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 487A31011182; Fri, 8 Jun 2018 05:40:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED8D17400D; Fri, 8 Jun 2018 05:40:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEAE42A3A; Fri, 8 Jun 2018 05:40:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w585ebQu027539; Fri, 8 Jun 2018 05:40:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w585ebLL027537; Fri, 8 Jun 2018 05:40:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806080540.w585ebLL027537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 05:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334830 - in head/sys: kern net vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern net vm X-SVN-Commit-Revision: 334830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:40:38 -0000 Author: mjg Date: Fri Jun 8 05:40:36 2018 New Revision: 334830 URL: https://svnweb.freebsd.org/changeset/base/334830 Log: uma: fix up r334824 Turns out there is code which ends up passing M_ZERO to counters. Since counters zero unconditionally on their own, just ignore drop the flag in that place. Modified: head/sys/kern/subr_counter.c head/sys/net/route.c head/sys/vm/uma_core.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Jun 8 05:17:06 2018 (r334829) +++ head/sys/kern/subr_counter.c Fri Jun 8 05:40:36 2018 (r334830) @@ -62,7 +62,7 @@ counter_u64_alloc(int flags) { counter_u64_t r; - r = uma_zalloc(pcpu_zone_64, flags); + r = uma_zalloc(pcpu_zone_64, flags & ~M_ZERO); if (r != NULL) counter_u64_zero(r); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Jun 8 05:17:06 2018 (r334829) +++ head/sys/net/route.c Fri Jun 8 05:40:36 2018 (r334830) @@ -235,7 +235,7 @@ rtentry_zinit(void *mem, int size, int how) { struct rtentry *rt = mem; - rt->rt_pksent = counter_u64_alloc(how & ~M_ZERO); + rt->rt_pksent = counter_u64_alloc(how); if (rt->rt_pksent == NULL) return (ENOMEM); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 8 05:17:06 2018 (r334829) +++ head/sys/vm/uma_core.c Fri Jun 8 05:40:36 2018 (r334830) @@ -2257,7 +2257,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zalloc_arg: called with spinlock or critical section held")); if (zone->uz_flags & UMA_ZONE_PCPU) - MPASS((flags & M_ZERO) == 0); + KASSERT((flags & M_ZERO) == 0, ("allocating from a pcpu zone " + "with M_ZERO passed")); #ifdef DEBUG_MEMGUARD if (memguard_cmp_zone(zone)) { From owner-svn-src-head@freebsd.org Fri Jun 8 05:48:29 2018 Return-Path: Delivered-To: svn-src-head@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 21C4E1011415; Fri, 8 Jun 2018 05:48:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B96E5744DB; Fri, 8 Jun 2018 05:48:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 962CE2BD7; Fri, 8 Jun 2018 05:48:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w585mSEo032773; Fri, 8 Jun 2018 05:48:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w585mSa2032772; Fri, 8 Jun 2018 05:48:28 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806080548.w585mSa2032772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 05:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334831 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:48:29 -0000 Author: mmacy Date: Fri Jun 8 05:48:28 2018 New Revision: 334831 URL: https://svnweb.freebsd.org/changeset/base/334831 Log: hwpmc: fix arm64 INVARIANTS build Modified: head/sys/dev/hwpmc/hwpmc_arm64.c Modified: head/sys/dev/hwpmc/hwpmc_arm64.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm64.c Fri Jun 8 05:40:36 2018 (r334830) +++ head/sys/dev/hwpmc/hwpmc_arm64.c Fri Jun 8 05:48:28 2018 (r334831) @@ -331,11 +331,11 @@ arm64_intr(struct trapframe *tf) int error; int reg, cpu; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[arm64,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; - cpu = curcpu; pc = arm64_pcpu[cpu]; for (ri = 0; ri < arm64_npmcs; ri++) { From owner-svn-src-head@freebsd.org Fri Jun 8 05:48:37 2018 Return-Path: Delivered-To: svn-src-head@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 CCA1D1011437; Fri, 8 Jun 2018 05:48:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E721745C5; Fri, 8 Jun 2018 05:48:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E6152BD8; Fri, 8 Jun 2018 05:48:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w585mbxs032831; Fri, 8 Jun 2018 05:48:37 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w585mbRb032830; Fri, 8 Jun 2018 05:48:37 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806080548.w585mbRb032830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 05:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334832 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 334832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 05:48:38 -0000 Author: mmacy Date: Fri Jun 8 05:48:36 2018 New Revision: 334832 URL: https://svnweb.freebsd.org/changeset/base/334832 Log: unbreak LINT build after r334804 Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jun 8 05:48:28 2018 (r334831) +++ head/sys/conf/NOTES Fri Jun 8 05:48:36 2018 (r334832) @@ -633,6 +633,8 @@ options ROUTETABLES=2 # allocated fibs up to 65536. options TCP_OFFLOAD # TCP offload support. +options TCPHPTS + # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration options IPSEC #IP security (requires device crypto) From owner-svn-src-head@freebsd.org Fri Jun 8 06:09:00 2018 Return-Path: Delivered-To: svn-src-head@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 49C021011A0B; Fri, 8 Jun 2018 06:09:00 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) (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 AFBB774E82; Fri, 8 Jun 2018 06:08:59 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pl0-f66.google.com with SMTP id z9-v6so7641074plk.11; Thu, 07 Jun 2018 23:08:59 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=j66XXLro73VuAPWcjhFEcJXrR6lRTT7xNLnWKS+TY3E=; b=DZFIsgxONNS4ZCV5C0W4XuXt5K6el7ez/AIuj7gkqaSisjegOwkQTOFnMgAoGXApnG diypHl7jvVsjvdGKKIjpcJZMkqY9a9mWpE+L5ZXKRjywwEuQlt0Yn2NZkGHSSZSeg8+t qyirYCPNP3bAoSBSsBXf/9XQJhzoISzV3rZ10+C52PUJ+PmEbgJkI88WU/nM8TZVlZcY PL+bhBYdlHV7AgGbn2ttosCChmQ8EaJHPFfdMP9vgJ/df8cTUL07UKUHSqHXxl37lf2x Sdi/34SmWuNsehgPUtUpPWDFtVU3re3XwalSTZHbbK5SwIyGwdB2bRPCw3BeB8L5AFTj umcQ== X-Gm-Message-State: APt69E3RPclDuV+5prSMl7vNHsdA7bPm9yKcyDmjKenbN7yupXiSdxx0 yV1XVeBz9x2eP5OwjId7X6cBkhs3qlI= X-Google-Smtp-Source: ADUXVKJfMzQ+1XE7KqxkDfQ0xyo3z/NSbvgOVd+49AHJyLFMXeCpmBAbtJtNN1U95LImFzqJJeMEtA== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr5076783plt.378.1528437750036; Thu, 07 Jun 2018 23:02:30 -0700 (PDT) Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com. [209.85.192.182]) by smtp.gmail.com with ESMTPSA id z28-v6sm62826861pfl.169.2018.06.07.23.02.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 23:02:29 -0700 (PDT) Received: by mail-pf0-f182.google.com with SMTP id b17-v6so6088297pfi.0; Thu, 07 Jun 2018 23:02:29 -0700 (PDT) X-Received: by 2002:a62:303:: with SMTP id 3-v6mr4587743pfd.255.1528437749698; Thu, 07 Jun 2018 23:02:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:1581:0:0:0:0 with HTTP; Thu, 7 Jun 2018 23:02:29 -0700 (PDT) In-Reply-To: References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> From: Ryan Libby Date: Thu, 7 Jun 2018 23:02:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Mateusz Guzik Cc: Mark Johnston , Konstantin Belousov , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 06:09:00 -0000 On Thu, Jun 7, 2018 at 10:03 PM, Mateusz Guzik wrote: > On Fri, Jun 8, 2018 at 6:29 AM, Ryan Libby wrote: >> >> On Thu, Jun 7, 2018 at 8:32 PM, Mark Johnston wrote: >> > On Wed, Jun 06, 2018 at 05:03:11PM +0300, Konstantin Belousov wrote: >> >> On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: >> >> > Author: jhibbits >> >> > Date: Wed Jun 6 12:57:11 2018 >> >> > New Revision: 334708 >> >> > URL: https://svnweb.freebsd.org/changeset/base/334708 >> >> > >> >> > Log: >> >> > Add a memory barrier after taking a reference on the vnode holdcnt >> >> > in _vhold >> >> > >> >> > This is needed to avoid a race between the VNASSERT() below, and >> >> > another >> >> > thread updating the VI_FREE flag, on weakly-ordered architectures. >> >> > >> >> > On a 72-thread POWER9, without this barrier a 'make -j72 >> >> > buildworld' would >> >> > panic on the assert regularly. >> >> > >> >> > It may be possible to use a weaker barrier, and I'll investigate >> >> > that once >> >> > all stability issues are worked out on POWER9. >> >> > >> >> > Modified: >> >> > head/sys/kern/vfs_subr.c >> >> > >> >> > Modified: head/sys/kern/vfs_subr.c >> >> > >> >> > ============================================================================== >> >> > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 >> >> > (r334707) >> >> > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 >> >> > (r334708) >> >> > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) >> >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); >> >> > if (!locked) { >> >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { >> >> > +#if !defined(__amd64__) && !defined(__i386__) >> >> > + mb(); >> >> > +#endif >> >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, >> >> > ("_vhold: vnode with holdcnt is free")); >> >> > return; >> >> First, mb() must not be used in the FreeBSD code at all. >> >> Look at atomic_thread_fenceXXX(9) KPI. >> >> >> >> Second, you need the reciprocal fence between clearing of VI_FREE and >> >> refcount_acquire(), otherwise the added barrier is nop. Most likely, >> >> you got away with it because there is a mutex unlock between clearing >> >> of VI_FREE and acquire, which release semantic you abused. >> > >> > I note that vnlru_free_locked() clears VI_FREE and increments v_holdcnt >> > without an intervening release fence. At this point the caller has not >> > purged the vnode from the name cache, so it seems possible that the >> > panicking thread observed the two stores out of order. In particular, it >> > seems to me that the patch below is necessary, but possibly (probably?) >> > not sufficient: >> >> Mark, Justin, and I looked at this. >> >> I think that the VNASSERT itself is not quite valid, since it is >> checking the value of v_iflag without the vnode interlock held (and >> without the vop lock also). If the rule is that we normally need the >> vnode interlock to check VI_FREE, then I don't think that possible >> reordering between the refcount_acquire and VI_FREE clearing in >> vnlru_free_locked is necessarily a problem in production. > > > Checking it without any locks is perfectly valid in this case. It is done > after v_holdcnt gets bumped from a non-zero value. So at that time it > is at least two. Of course that result is stale as an arbitrary number of > other threads could have bumped and dropped the ref past that point. > The minimum value is 1 since we hold the ref. But this means the > vnode must not be on the free list and that's what the assertion is > verifying. > > The problem is indeed lack of ordering against the code clearing the > flag for the case where 2 threads to vhold and one does the 0->1 > transition. > > That said, the fence is required for the assertion to work. > Yeah, I agree with this logic. What I mean is that reordering between v_holdcnt 0->1 and v_iflag is normally settled by the release and acquisition of the vnode interlock, which we are supposed to hold for v_*i*flag. A quick scan seems to show all of the checks of VI_FREE that are not asserts do hold the vnode interlock. So, I'm just saying that I don't think the possible reordering affects them. >> >> >> It might just be that unlocked assertions about v_iflag actually need >> additional synchronization (although it would be a little unfortunate to >> add synchronization only to INVARIANTS builds). >> >> > >> >> Does the fence needed for the non-invariants case ? >> >> >> >> Fourth, doesn't v_usecount has the same issues WRT inactivation ? >> > >> > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c >> > index 286a871c3631..c97a8ba63612 100644 >> > --- a/sys/kern/vfs_subr.c >> > +++ b/sys/kern/vfs_subr.c >> > @@ -1018,6 +1018,7 @@ vnlru_free_locked(int count, struct vfsops >> > *mnt_op) >> > */ >> > freevnodes--; >> > vp->v_iflag &= ~VI_FREE; >> > + atomic_thread_fence_rel(); > > > This probably has no added value for non-debug kernels. > >> >> > refcount_acquire(&vp->v_holdcnt); >> > >> > mtx_unlock(&vnode_free_list_mtx); >> > @@ -2807,9 +2808,7 @@ _vhold(struct vnode *vp, bool locked) >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); >> > if (!locked) { >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { >> > -#if !defined(__amd64__) && !defined(__i386__) >> > - mb(); >> > -#endif >> > + atomic_thread_fence_acq(); > > > Same as above. > >> >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, >> > ("_vhold: vnode with holdcnt is free")); >> > return; > > > The main codepath which runs into this (... -> cache_lookup -> vhold) most > definitely does not need the fence for production operation. > > What is unclear without audit is whether there are vhold users which need > one. I think the patch is fine to go in if the other VI_FREE place gets a > comment about a fence stemming from mtx_unlock and there is another one > prior to the assertion explaining that this orders against v_iflag tests and > may > or may not be needed for other consumers. > > In general the code is *full* of data races and accidental reliance of > ordering > provided by amd64. Weeding this all out will be a painful exercise. > > Part of the problem is lack of primitives like READ_ONCE/WRITE_ONCE as > seen in the linux kernel, someone should hack up equivalents. > > -- > Mateusz Guzik Yeah, I think we should understand whether the problem is just the unsynchronized assertions or whether there are some true bugs. It doesn't seem great to me to add synchronization which as you said > This probably has no added value for non-debug kernels. From owner-svn-src-head@freebsd.org Fri Jun 8 08:32:09 2018 Return-Path: Delivered-To: svn-src-head@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 7A0C110149FF for ; Fri, 8 Jun 2018 08:32:09 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (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 0D97E79105 for ; Fri, 8 Jun 2018 08:32:09 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22c.google.com with SMTP id j190-v6so3885637ywe.4 for ; Fri, 08 Jun 2018 01:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KBP+osRbhsRNa8B3EGgD8CpUcJ4oxWNLMRh8Vb4WMXs=; b=l4NkLaZweTezvNB10lvRVxeeEjwLYaJRG9sl064utJyVwtnDYHLTCPAndLcNV22+5F QTvWcXlX/G9GeyarPVzh3TwQ3EEPr3Ss8YdcDdmQsTx0D5Ti+qDNsg5r9Jm60OihFYw2 V2B0ftJ2YzXXl3dzgDucu5+TIWR8fZ4k8mdp4= 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=KBP+osRbhsRNa8B3EGgD8CpUcJ4oxWNLMRh8Vb4WMXs=; b=a/mdO2k0zLQalt2qpeW+lseDN/hBkT+gpmYDqMCHBTk2bvYKiRXFPJ2eB5rTb1jJaZ vh9pKO/Cj5f3PGuwrOy7rPx7ioFLGT7JK604+Aoe7ID3SNa004ZaYpkat3n5XfqInkjp GYhNLhMwbkE8uJ34acTnEzska58d+uK6PLLJR5dW3dI67x7+GqFbUcQtLrTD63Mz1nLl KIR828UPY9o8bo0H7VylS/cJ+kwn4ggbLmdjTdQdpGLlYB4A/7lI2SJCsco6KOvbzeyA D8OR4nzCL+xZxve8RYqk+tuwL8awOmDCQfCMQA2MUcAiDWEnDjyf3PZTwej85LRP2RJV 9ppw== X-Gm-Message-State: APt69E3x1BauwU9oR5Eo0RTdSq1gmdJ/U7d5pStSDbMtv+oyqco3SsoQ 9MV7kYnJFsZLVBU1PQBGRThSdp0w5OIudkvmsBi6uQ== X-Google-Smtp-Source: ADUXVKL6jfpGlXB+Rd97RcdC1gZYifaiwaaYX4OfsJ9M7MdZJn2Elt3imZev00gPyxoSCQ/7YCmQmtC/qO7kReKwMkc= X-Received: by 2002:a0d:e812:: with SMTP id r18-v6mr3071492ywe.19.1528446728229; Fri, 08 Jun 2018 01:32:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 01:31:37 -0700 (PDT) In-Reply-To: <201806080540.w585ebLL027537@repo.freebsd.org> References: <201806080540.w585ebLL027537@repo.freebsd.org> From: Eitan Adler Date: Fri, 8 Jun 2018 01:31:37 -0700 Message-ID: Subject: Re: svn commit: r334830 - in head/sys: kern net vm To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 08:32:09 -0000 On 7 June 2018 at 22:40, Mateusz Guzik wrote: > Modified: head/sys/vm/uma_core.c > ============================================================================== > --- head/sys/vm/uma_core.c Fri Jun 8 05:17:06 2018 (r334829) > +++ head/sys/vm/uma_core.c Fri Jun 8 05:40:36 2018 (r334830) > @@ -2257,7 +2257,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags > KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), > ("uma_zalloc_arg: called with spinlock or critical section held")); > if (zone->uz_flags & UMA_ZONE_PCPU) > - MPASS((flags & M_ZERO) == 0); > + KASSERT((flags & M_ZERO) == 0, ("allocating from a pcpu zone " > + "with M_ZERO passed")); After this I get a panic (inverted order) Panic: flags & MZERO @ uma_core.c line 2260 fast_syscall_common amd64_syscall sys_ioctl kern_ioctl if_up in6_attach in6_update_ifa rtinit rtrequest1_fib uma_zalloc_arg zone_import zone_fetch_slab keg_fetch_slab keb_alloc_slab rtentry_zinit counter_u64_alloc uma_zalloc_arg ... -- Eitan Adler From owner-svn-src-head@freebsd.org Fri Jun 8 08:45:03 2018 Return-Path: Delivered-To: svn-src-head@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 1E9E51014E03 for ; Fri, 8 Jun 2018 08:45:03 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (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 90A1479858 for ; Fri, 8 Jun 2018 08:45:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22c.google.com with SMTP id 81-v6so3893159ywb.6 for ; Fri, 08 Jun 2018 01:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IZMtcOh5McyqSmBXdUe2U3elOidZB2HMBpK5p0fgM5c=; b=AP45Fj9wzPk5vXW7NJTL+tsaEoSTIsb9a/tzV2nM/i3hbG2RNqhuUz+loWm8CaI/jj nI47sq8H2S2VCy6oRxLLL1po9dSwnIFfg5/IFIszW/cWncOCJRQ9DcnYfe4m2mDuZTmT xdSQiaBZhHctReMUfIzRGtFq0nUUmGh6rTwzQ= 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=IZMtcOh5McyqSmBXdUe2U3elOidZB2HMBpK5p0fgM5c=; b=Z5lfBpXAo+1BiG/kEbxt4u3wnpO+4SiHWKuLOavGDSJ4mHAI0CJY2R+zKktHrA/6FJ xZrBhWya5GWmxU+u1Jlx0hPfal6CoX0HAWV8JrXBoAuWRi5LCb/NeaviZDwsFDZeluSm qS8CQpXDup20KHlAgk5AZEzCqkyXLv8z9tbZrX01+QtrMvUR65IZLxytlHS1Xa3+MNl1 kOrr70iq5589GW79SkNFaXw/8uWhK2/xfpTmyaUds4izsKnFNl5qPCPVz2LyBZvMrnP4 V53P9OJ44wKRhc/BsI3SNeaxIO4SP1Ai2+TNYV7HT2tyqPCrM1rf2bZBFBAtlvw20CI7 oQ1Q== X-Gm-Message-State: APt69E1LS3y1+P9H9PmqnJASlso4bRGLuQywannJaJS/+hC1N3di3tv2 PsThvze1fPNZvvDHzPZ2eVy6vt1ORE3pHw5WKtzxow== X-Google-Smtp-Source: ADUXVKKiZMtMG6fNxlcTu0oogVUHt3TGeKXW0xnh4gQAHfgwB1hE7DT7aMx4o/+ZxYMk5+/IrbgwBH9+RQAlbtI3jEM= X-Received: by 2002:a81:b70b:: with SMTP id v11-v6mr2902335ywh.182.1528447501957; Fri, 08 Jun 2018 01:45:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 01:44:31 -0700 (PDT) In-Reply-To: References: <201806080540.w585ebLL027537@repo.freebsd.org> From: Eitan Adler Date: Fri, 8 Jun 2018 01:44:31 -0700 Message-ID: Subject: Re: svn commit: r334830 - in head/sys: kern net vm To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 08:45:03 -0000 On 8 June 2018 at 01:31, Eitan Adler wrote: > On 7 June 2018 at 22:40, Mateusz Guzik wrote: >> Modified: head/sys/vm/uma_core.c >> ============================================================================== >> --- head/sys/vm/uma_core.c Fri Jun 8 05:17:06 2018 (r334829) >> +++ head/sys/vm/uma_core.c Fri Jun 8 05:40:36 2018 (r334830) >> @@ -2257,7 +2257,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags >> KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), >> ("uma_zalloc_arg: called with spinlock or critical section held")); >> if (zone->uz_flags & UMA_ZONE_PCPU) >> - MPASS((flags & M_ZERO) == 0); >> + KASSERT((flags & M_ZERO) == 0, ("allocating from a pcpu zone " >> + "with M_ZERO passed")); > > After this I get a panic (inverted order) > > Panic: flags & MZERO @ uma_core.c line 2260 > > fast_syscall_common > amd64_syscall > sys_ioctl > kern_ioctl > if_up > in6_attach > in6_update_ifa > rtinit > rtrequest1_fib > uma_zalloc_arg > zone_import > zone_fetch_slab > keg_fetch_slab > keb_alloc_slab > rtentry_zinit > counter_u64_alloc > uma_zalloc_arg > ... ofc, kgdb has an internal error trying to open the core. -- Eitan Adler From owner-svn-src-head@freebsd.org Fri Jun 8 04:49:07 2018 Return-Path: Delivered-To: svn-src-head@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 CE83B100FDD7; Fri, 8 Jun 2018 04:49:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74E76720FB; Fri, 8 Jun 2018 04:49:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 51BA5ECB6; Fri, 8 Jun 2018 04:49:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8A0D03B7; Fri, 8 Jun 2018 04:49:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id GHTI1Rmnn1rA; Fri, 8 Jun 2018 04:49:04 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 433133B3 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r334617 - in head: . etc From: Bryan Drewery X-Mailer: iPhone Mail (15E302) In-Reply-To: <20180607072958.GA51308@FreeBSD.org> Date: Fri, 8 Jun 2018 00:49:02 -0400 Cc: Brad Davis , rgrimes@FreeBSD.org, src-committers , Kyle Evans , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Konstantin Belousov , Alexander Leidinger , Eugene Grosbein Content-Transfer-Encoding: quoted-printable Message-Id: <5891A407-BCE6-4792-BD1D-53C00C9A7ED6@FreeBSD.org> References: <201806061833.w56IXWBC006288@pdx.rh.CN85.dnsmgr.net> <1528311745.474139.1398838488.1527C06D@webmail.messagingengine.com> <20180607072958.GA51308@FreeBSD.org> To: Alexey Dokuchaev X-Mailman-Approved-At: Fri, 08 Jun 2018 10:32:39 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 04:49:08 -0000 > On Jun 7, 2018, at 03:29, Alexey Dokuchaev wrote: >=20 >> On Wed, Jun 06, 2018 at 01:02:25PM -0600, Brad Davis wrote: >>> On Wed, Jun 6, 2018, at 12:33 PM, Rodney W. Grimes wrote: >>> ... >>> So each installworld would wipe over the top of any localmod /etc/rc.d/ >>> and other stuff that mght exist? >>> One of the reasons that etc/Makefile is detached from Installword is so >>> that /etc does not get perturbuted unless specifically requested. >>=20 >> Yes, this is by design. >>=20 >> If people need custom tweaks for that stuff they should be upstreamed or >> moved into /usr/local/etc/rc.d as a custom startup script. >=20 > This is rather questionable design to me. I don't consider my scripts > as binaries and like them in /etc/rc.d/ and managed via mergemaster -Fi. > Everything was perfectly fine with it. What exactly the problem you're > trying to solve here? For me the biggest selling point of FreeBSD has always been how configurable= and customizable it has been (without modifying src). Especially the rc fil= es and patterns of .local in /etc. >=20 > ./danfe >=20 From owner-svn-src-head@freebsd.org Fri Jun 8 12:17:53 2018 Return-Path: Delivered-To: svn-src-head@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 5858310198B0; Fri, 8 Jun 2018 12:17:53 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 B2DA67FDD5; Fri, 8 Jun 2018 12:17:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2721C2183D; Fri, 8 Jun 2018 08:17:52 -0400 (EDT) Received: from web2 ([10.202.2.212]) by compute5.internal (MEProxy); Fri, 08 Jun 2018 08:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=HtMXp+ +fbMJ5B0q1r8AFhasvAt6acovJ/R/76vH/4uk=; b=emaYNfek90lE44j/P0vfOO tbqievQD1xisGLmwY58GDOnplOjr0kmGdHmj2M6in1U608IB4Pe2Bm+3z5x+zBgc FhUO2Y67sW6tSTzqX43lEcyrBN5T9B/lDA0VBjIIxKHHVywm1QQvWc9YdOWvcx0m xlA4UJaBQpq7NHo/je5kNOdAQq97KQ/tW4KOalUz2Ulg2t6UEWgJp/SfdtUL5zGe Y51ADQBa/RxUlJuLr4Lf/skzcWDzaVypmIho28nMHm/pM5OxITxo7+rmX/lqc0iQ 8+TyRiA+pyMW90kF1Uhb4C8RnAM+jyCKPCCS1HcKLIhl4kpwMstGfhJH2016Ew0g == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id D3F26621E6; Fri, 8 Jun 2018 08:17:51 -0400 (EDT) Message-Id: <1528460271.2913956.1400918032.76248AFF@webmail.messagingengine.com> From: Brad Davis To: Bryan Drewery Cc: Renato Botelho , Konstantin Belousov , "src-committers" , Kyle Evans , svn-src-all@freebsd.org, rgrimes@freebsd.org, svn-src-head@freebsd.org, Alexander Leidinger MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - ajax-ca618090 References: <201806041847.w54IlCUu097084@pdx.rh.CN85.dnsmgr.net> <1528138550.3632147.1396107464.614818A8@webmail.messagingengine.com> <20180605150022.Horde.emnJxb8rKYqAvChLgWoX9vf@webmail.leidinger.net> <1528212242.2273706.1397239144.6BEBF1F9@webmail.messagingengine.com> <20180605164627.GM2450@kib.kiev.ua> <1528222385.2736229.1397446048.17853CA8@webmail.messagingengine.com> <20180605182605.GN2450@kib.kiev.ua> <1528231416.2440607.1397619456.294EF898@webmail.messagingengine.com> In-Reply-To: Date: Fri, 08 Jun 2018 06:17:51 -0600 Subject: Re: svn commit: r334617 - in head: . etc Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 12:17:53 -0000 On Thu, Jun 7, 2018, at 10:38 PM, Bryan Drewery wrote: > > > > On Jun 5, 2018, at 16:43, Brad Davis wrote: > > > > > > On Tue, Jun 5, 2018, at 1:07 PM, Renato Botelho wrote: > > > On 05/06/18 15:26, Konstantin Belousov wrote: > > > > On Tue, Jun 05, 2018 at 12:13:05PM -0600, Brad Davis wrote: > > > >> On Tue, Jun 5, 2018, at 10:46 AM, Konstantin Belousov wrote: > > > >>> I find it often very useful to do > > > >>> (cd src/etc/rc.d && make install) > > > >>> Same for defaults and several other directories which in fact > > > >>> contains> > > >>> non-editable content. Is this planned to keep = working ? > > > >> > > > >> The short answer is, no. All rc.d scripts get moved to the src > > > >> of the program they start.> > > >> > > > >> That said, if there is a big need for this, we can see about > > > >> options to keep them working.> > > >> > > > >> What are you trying to accomplish when you do this? Just > > > >> verify the rc.d scripts match your src tree?> > > > > > > > I avoid mergemaster/etcupdate and whatever else. rc.d and > > > > /etc/rc,> > > > /etc/rc.subr /etc/rc.network are not suitable to et= c, they are > > > > binaries> > > > provided by the project not for the user editing. > > > > > > > > When upgrading the host, esp. on HEAD, i usually refresh scripts > > > > by this> > > > procedure and avoid any editing and implied conflict= resolution > > > > for real> > > > configs. > > > > > > > > Not being able to easily install clean copies of these scripts > > > > would> > > > be very inconvenient and time consuming. > > > > > > If I understood what Brad is saying, each rc.d script will be > > > installed> > > by the application it belongs to. So when it's install= ing SSH it > > > will> > > also install /etc/rc.d/sshd and you will not need to deal w= ith > > > rc.d> > > files on mergemaster anymore. > > > > > > Is it correct, Brad? > > > > Correct. > > > > This makes no sense. Many rc scripts, and other config files, have no> = =E2=80=9Cowner=E2=80=9D outside of etc/... > > Please don=E2=80=99t kill etc/Makefile. This is going to be very > painful to deal> with downstream. I was wrong. We moved startup scripts under sbin/init. So this would be easy to merge. Regards, Brad Davis From owner-svn-src-head@freebsd.org Fri Jun 8 12:19:46 2018 Return-Path: Delivered-To: svn-src-head@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 49861101993A; Fri, 8 Jun 2018 12:19:46 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 EB64B7FF70; Fri, 8 Jun 2018 12:19:45 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A295221B8D; Fri, 8 Jun 2018 08:19:45 -0400 (EDT) Received: from web2 ([10.202.2.212]) by compute5.internal (MEProxy); Fri, 08 Jun 2018 08:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0rRHP3 6YV3i87XsBXrWWlafTURtqy+28gf2NMZGUQBI=; b=lSRzRoEJD+KlNrq8HHaj/L uDxxYUa4N5AoB8O8NLGcDfgnJuD5AYw/L2fcxAfaIu1/abkkU9h/NAyoiDquAFPH 99tEbq4prOy9IzgRCIxGVtWRRExvX2uPJU3sjDADBCUQcBVSxiajuiulM3cZuEe7 GBauXk2PzFJ96VFXAuQhNRZH/PnKZeDAJ6eMKyxVwfo3bHXYPfCuq6zMbiH7xx8h ZPGcPg1ab5p92vYt9fCHm0IgyF3P3cbN97a1q4g2a3Hkera8uyzB/eUDFxbbGrvz R6gFRRd7KQafhnAnRFTfYg76FfJz7lMIA7K75xl3exwfwGSXbRUcxRTyh7c6Q7bw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 5684D621B8; Fri, 8 Jun 2018 08:19:44 -0400 (EDT) Message-Id: <1528460384.2914112.1400919488.64FBF5FC@webmail.messagingengine.com> From: Brad Davis To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - ajax-ca618090 Subject: Re: svn commit: r334617 - in head: . etc In-Reply-To: <8BBE4E4C-0E5F-4920-B057-E6F939074448@FreeBSD.org> Date: Fri, 08 Jun 2018 06:19:44 -0600 References: <201806041517.w54FHPn0072477@repo.freebsd.org> <8BBE4E4C-0E5F-4920-B057-E6F939074448@FreeBSD.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 12:19:46 -0000 On Thu, Jun 7, 2018, at 10:59 PM, Bryan Drewery wrote: > > > On Jun 4, 2018, at 11:17, Brad Davis wrote: > > > > Author: brd > > Date: Mon Jun 4 15:17:24 2018 > > New Revision: 334617 > > URL: https://svnweb.freebsd.org/changeset/base/334617 > > > > Log: > > Move /sys symlink creating out of etc/Makefile. > > > > This is prep for etc/Makefile going away. > > > > Approved by: bapt (mentor) > > > > Modified: > > head/Makefile.inc1 > > head/etc/Makefile > > > > Aside from other objections, I don=E2=80=99t think /Makefile nor > /Makefile.inc1> should =E2=80=9Cown=E2=80=9D anything on the system and s= hould only drive the build or> other general targets for users to interact = with. Please put this into> something like /hier or better yet the existing= directory > handling that> stuff /etc. (so a revert since simply moving everything to= it via a > rename or rewrite seems silly) I agree, I started creating a hier/ last night. Regards, Brad Davis From owner-svn-src-head@freebsd.org Fri Jun 8 12:58:56 2018 Return-Path: Delivered-To: svn-src-head@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 9A8EE101A698; Fri, 8 Jun 2018 12:58:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4892A8116B; Fri, 8 Jun 2018 12:58:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 220677549; Fri, 8 Jun 2018 12:58:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Cwu1B049788; Fri, 8 Jun 2018 12:58:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Cwugh049787; Fri, 8 Jun 2018 12:58:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806081258.w58Cwugh049787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Jun 2018 12:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334837 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 12:58:56 -0000 Author: kevans Date: Fri Jun 8 12:58:55 2018 New Revision: 334837 URL: https://svnweb.freebsd.org/changeset/base/334837 Log: bsdgrep(1): Evict character sequence that moved in Reported by: trasz Modified: head/usr.bin/grep/file.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Fri Jun 8 10:09:30 2018 (r334836) +++ head/usr.bin/grep/file.c Fri Jun 8 12:58:55 2018 (r334837) @@ -113,7 +113,7 @@ grep_fgetln(struct file *f, struct parsec *pc) return (bufpos); } - /* Look for a newline in the remaining part of the [6rbuffer */ + /* Look for a newline in the remaining part of the buffer */ if ((p = memchr(bufpos, fileeol, bufrem)) != NULL) { ++p; /* advance over newline */ ret = bufpos; From owner-svn-src-head@freebsd.org Fri Jun 8 14:08:47 2018 Return-Path: Delivered-To: svn-src-head@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 4E21C101B8C8; Fri, 8 Jun 2018 14:08:47 +0000 (UTC) (envelope-from carpeddiem@gmail.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 C8EDD83397; Fri, 8 Jun 2018 14:08:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x233.google.com with SMTP id u4-v6so2513682itg.0; Fri, 08 Jun 2018 07:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZeISHb7q7Qn8BggT2sn35YmgOEMcj84jAHb4JEZ0UlE=; b=oueEXZiaXk47gvu3hrwuYQk9tTc9EVpa9D87P6a51c+jKzx+3wFZ04LiLBUTuLXb0F A7LzgwU8ofk7/ETXPRxGBXSuanGgZcCU6Wygk00mM6hz0fzQsNm+I1UyGLeLglxz8ID6 6148VP/VW/Uv3NB354x6bLzYnUpHh5Wn64pb30RcHHfIPVxYpCXvi6p7ZFXu28d2JRvQ vt+A34yku/CxCSZ9NTIJsOIix/qm8A9Trxq9vpgbAZn8Q1vQRsmC4Fa8kgJ1jmg/cv0r CmJ5k+7vKhFZakG1NisCayuc+EEKNfggT7AezuxBeIh+Yzlhv720Swnzs5mKqf6EIp+u Ditw== 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=ZeISHb7q7Qn8BggT2sn35YmgOEMcj84jAHb4JEZ0UlE=; b=lBxkxroTDKOZhK8FlxH6Q+1Kz0N7DGiSqXG7QMvCwH5BXlut5IIE+dmmz84XpXDagE YUQ6kYk18Bid/8VB6GZC32xNR2QP94RksFi0Xt4CWb9ArPrg6hVXhjmurSLXcojx178Y L9hLaeJttouyKmW7k7IUEMWAEW54uc3XU9oY4nEUOUndS2dMVzEaPndei7LvRSgNiSir aqGU1j6HRoLfB7YAiu+KAxIjugtibgXOLACvFkDH2wArkQdV4I7GkvTGiXv+oVhzJ3l6 pmCgrWUYgLbb3zrrNo9ooIjTmCokhgW4qm+mbb57ohpjiTCvS66h/cVedlIfDcyXiL8b VHvQ== X-Gm-Message-State: APt69E1eC0bMR228h2m79ORyQhMaARR5xWLAL2wbz5HMHyF2YaGu/rst kynSb/MaVYglhoQrYwT9sd59nM3B1/dewoT5AFaZPg== X-Google-Smtp-Source: ADUXVKKDyMBsW3aFUrrytEdb3t4vsB//StUNlxYTzxj3FpszK7DEpxTBjTgtRFzter0NC1qxO2ZnS1GUw1nQBzZH7Ao= X-Received: by 2002:a24:1fce:: with SMTP id d197-v6mr1764364itd.52.1528466925968; Fri, 08 Jun 2018 07:08:45 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 2002:a6b:87c4:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 07:08:25 -0700 (PDT) In-Reply-To: <201806072049.w57Kn1Mk057119@repo.freebsd.org> References: <201806072049.w57Kn1Mk057119@repo.freebsd.org> From: Ed Maste Date: Fri, 8 Jun 2018 10:08:25 -0400 X-Google-Sender-Auth: ypGArUjKBuQrdJzpoq8m6UMrbqM Message-ID: Subject: Re: svn commit: r334814 - head/sbin/dump To: Kirk McKusick Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 14:08:47 -0000 On 7 June 2018 at 16:49, Kirk McKusick wrote: > Author: mckusick > Date: Thu Jun 7 20:49:01 2018 > New Revision: 334814 > URL: https://svnweb.freebsd.org/changeset/base/334814 > > Log: > Ensure proper initialization of superblock. > ... > --- head/sbin/dump/main.c Thu Jun 7 19:57:55 2018 (r334813) > +++ head/sbin/dump/main.c Thu Jun 7 20:49:01 2018 (r334814) > @@ -433,6 +433,7 @@ main(int argc, char *argv[]) > msgtail("to %s\n", tape); > > sync(); > + sblock = NULL; > if ((ret = sbget(diskfd, &sblock, -1)) != 0) { sblock is initialized to NULL at the beginning of ffs_sbget, so I'm not really sure what's happening here. From owner-svn-src-head@freebsd.org Fri Jun 8 14:27:45 2018 Return-Path: Delivered-To: svn-src-head@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 C259C101C0C6; Fri, 8 Jun 2018 14:27:44 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::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 366F2842D9; Fri, 8 Jun 2018 14:27:44 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id i83-v6so20372008lfh.5; Fri, 08 Jun 2018 07:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ulf/Nf/+DpudeLs7nYiWybt3BJROU+yiOp0Augpnx30=; b=uzLIMqPRB+rsuD5PG4mdzQTctU30+nEslYGpj8O7QmNVYUFPnNqouCS2gAj+XOnNX1 EABJQwnfDOkT7BZ39azr89o7n9p+n4piMVijw9eZbFF2EFRK7ZsrQvU8Lf5XIBDmpJEO /SZn/FPkA1d919GkqcrboD/4TJ1/HQB9KAJcQcuK+A+0Ys86EmzzPm50CtcS/MmoJtKd sdQqN5Nf+izO4V8aJZt1Gfc1wAXarFqIjp9TYFkDcZ13ix0jHwUtb/ElXfRzc5XvUDUT k7LzWVFNqWX9VPgFv8ctCHin1b8Ii29D229/pVyoFLZhjDZJGff0xkI+w1OrJ9tAeVrI U94w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ulf/Nf/+DpudeLs7nYiWybt3BJROU+yiOp0Augpnx30=; b=N8j0ZhLszWETaLo4oZQp3swk4xmMu2NcSc9wbmilJoGpxss+JPUDFlJMwGFtSOwsfc ftpdrp18KPRURz9ccYgYiNyQFfhRZvBb+BRfKbsgNYiH9q61fdnHf29bk+VdZeBXc76A bdcTrQaY1L4bZDHvKktSGZe+MY8/OEjM55b9QbMTol4ioipxXzZmKC0kU4MTdiAF3mlq iSbbaLrc7e2YUTnE6huppqA1fJ427SylyOVGMMNnwgRlTIv7lpQdcZE23I/PGSGeNOvh p0QJCmMpcU5mJRNypP/71w8m+9ppYgL1FQm7GQAmGxJ6T3RaVnsWuYpDQt+2Fpsji93x WIaw== 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=ulf/Nf/+DpudeLs7nYiWybt3BJROU+yiOp0Augpnx30=; b=CP/u0iXfQSJOH5zjR+ZG238RX1xMLh/wp2qFT4aTKcyvaqRqQaQyBso2tPdAMa+j6m yW5OvfJQfUkTFc0d8BSZOoobLJKdjY/4qyvayyL5ASqtRbk7goMnELZK1pdsDss6s8eq 55uEWIkMeZsysTY6kfU2a4wbx9noXTesY7wKBugtmivc3JJWw+jmrhz/pjw2tVpRozUb DoObesqQDv8bZcsTKNxaSswY6yWndQt3NfnbkyhGtDp5kw/yXtH3yYQTIzqerJyVkcq2 LYTDwwoAJ2maWiBWct2YZFeo/BrE1lTg1+1JceM4sQkYt4IVy/3CiY1dmoP6FKul7MtT GbRQ== X-Gm-Message-State: APt69E0HpqO1wPFMoeZ2wD2pqpVAVYM+PJal2On7D6V9xSBOVeSQx7iM z4ASsbx4tIQ4br7xRbs2F1jbvnWzGCcp07bdirA= X-Google-Smtp-Source: ADUXVKL225gKL5oXbH8EUzykywl8Cg6GF+R663w9HnKvquwWNCRybtOwdz6Q5OIe3qQHqwkdg5L9X18zleNSs9lpiS0= X-Received: by 2002:a19:51db:: with SMTP id g88-v6mr4334931lfl.78.1528468062383; Fri, 08 Jun 2018 07:27:42 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 2002:a2e:1702:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 07:27:41 -0700 (PDT) In-Reply-To: References: <201806072049.w57Kn1Mk057119@repo.freebsd.org> From: Justin Hibbits Date: Fri, 8 Jun 2018 10:27:41 -0400 X-Google-Sender-Auth: akZwVjKgQ8MWWrGPF3T-wYCL9rU Message-ID: Subject: Re: svn commit: r334814 - head/sbin/dump To: Ed Maste Cc: Kirk McKusick , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 14:27:45 -0000 On Fri, Jun 8, 2018 at 10:08 AM, Ed Maste wrote: > On 7 June 2018 at 16:49, Kirk McKusick wrote: >> Author: mckusick >> Date: Thu Jun 7 20:49:01 2018 >> New Revision: 334814 >> URL: https://svnweb.freebsd.org/changeset/base/334814 >> >> Log: >> Ensure proper initialization of superblock. >> > ... >> --- head/sbin/dump/main.c Thu Jun 7 19:57:55 2018 (r334813) >> +++ head/sbin/dump/main.c Thu Jun 7 20:49:01 2018 (r334814) >> @@ -433,6 +433,7 @@ main(int argc, char *argv[]) >> msgtail("to %s\n", tape); >> >> sync(); >> + sblock = NULL; >> if ((ret = sbget(diskfd, &sblock, -1)) != 0) { > > sblock is initialized to NULL at the beginning of ffs_sbget, so I'm > not really sure what's happening here. > Diane just found possibly the real cause of the problem. dump.h is included by almost every .c file, but defines variables, doesn't just declare them. I think the real solution would be to define them in main.c, or somewhere else, and just declare them in dump.h. Or if they're truly only needed on a per-file basis, not as globals, they could be marked static so there is no chance of conflict, and they're pre-initialized to 0. The linker "might" merge them into the common section, or might not, resulting in bizarre conflicts like what she's seeing. Though, I'm surprised we're not seeing a linker error or warning anyway. - Justin From owner-svn-src-head@freebsd.org Fri Jun 8 14:35:08 2018 Return-Path: Delivered-To: svn-src-head@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 789F9101C5A6; Fri, 8 Jun 2018 14:35:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) (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 1144484ADE; Fri, 8 Jun 2018 14:35:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22d.google.com with SMTP id q13-v6so13627783qtp.4; Fri, 08 Jun 2018 07:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BbkCeOMV1FKAS9R5BSREX2yNyQm0aeIwgCsYsjfBVJ4=; b=J5P2Xi6KP4tbwM35lYl14ggiTltH7xPn2jzjMEUYbBZQ+K4QcS4RDAi/q5X808oP8h 2AOya3y+eEKlvzWDxCVTqnGQI1p6RJhvJOzzUGxE9i78J5VomLUCvyVGkp8rxpq/bz1O ApsSHy3KSObjSaGX70uWTK/Ap1STy+kFZkxJEcymMCfeoF/lCoty2goVHG058+CCB6p/ JXdbXbYpfVnKcR7obQxzUVxgU5eh57tHZ9LJ/B3o/zsZbsAnb314GcssL13brX9kz0Ph Tfymvg9hRIi7NxmKQjdn6nEjReOAc5oWC00hDrr9MQl3IU9U5enJcvja6Keh4QDfZ6G4 r5GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BbkCeOMV1FKAS9R5BSREX2yNyQm0aeIwgCsYsjfBVJ4=; b=mhCR1NU/O/z1vit4Lacm8xoOCXblAUZji1vt6ZyKd3Cd50vQvIGMbhZ3ojiK6pnKDS rBFc0jSj4fQ1ouCbcMCcjM9gp93rgEevUwO7gnDee4kJjcnf0csMBmf/tyUEHf7acPfa 8oF44AVRBqlamFEiu/BlLVWfC0TpamtkS1/C6jrwrboAJdIR3+AObjTuxbZwlhv4oKjZ xSERVf0t/6h4NZz19wctwtIzuVrf8SLAVEmc9wlRyi7dTw+no/I2UCiXJPCmkmqigTiT 229XnfDSMAxSsV/UCXJfv+Fi++UTp1WNFbXiVa5Y9xXQgMjY6A4gimRrMaHffQxkVXge dUXg== X-Gm-Message-State: APt69E08FCQhFv0YQOaClJdxw0jIkyeavFgWwipgj7J1BI+OC4Zkshxw 5H18FxsYne14VMhT6almO8HJHw== X-Google-Smtp-Source: ADUXVKLHENzie8RgtS388NKukewQvg5FgRgsYgg6UPGmd05I3h6WPGTPOeLt1FvxXiS4Kzmr9r8UhQ== X-Received: by 2002:ac8:65d1:: with SMTP id t17-v6mr6273732qto.347.1528468507356; Fri, 08 Jun 2018 07:35:07 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id l25-v6sm11956761qkk.49.2018.06.08.07.35.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 07:35:06 -0700 (PDT) Sender: Mark Johnston Date: Fri, 8 Jun 2018 10:34:48 -0400 From: Mark Johnston To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys Message-ID: <20180608143448.GB57885@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806080458.w584w3rn006318@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 14:35:08 -0000 On Fri, Jun 08, 2018 at 04:58:03AM +0000, Matt Macy wrote: > Author: mmacy > Date: Fri Jun 8 04:58:03 2018 > New Revision: 334827 > URL: https://svnweb.freebsd.org/changeset/base/334827 > > Log: > hwpmc: simplify calling convention for hwpmc interrupt handling > > pmc_process_interrupt takes 5 arguments when only 3 are needed. > cpu is always available in curcpu and inuserspace can always be > derived from the passed trapframe. > > While facially a reasonable cleanup this change was motivated > by the need to workaround a compiler bug. What is the compiler bug? Do you have disassembly of the subroutines in question? > > core2_intr(cpu, tf) -> > pmc_process_interrupt(cpu, ring, pmc, tf, inuserspace) -> > pmc_add_sample(cpu, ring, pm, tf, inuserspace) > > In the process of optimizing the tail call the tf pointer was getting > clobbered: > > (kgdb) up > at /storage/mmacy/devel/freebsd/sys/dev/hwpmc/hwpmc_mod.c:4709 > 4709 pmc_save_kernel_callchain(ps->ps_pc, > (kgdb) up > 1205 error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, > > resulting in a crash in pmc_save_kernel_callchain. From owner-svn-src-head@freebsd.org Fri Jun 8 14:58:41 2018 Return-Path: Delivered-To: svn-src-head@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 DFD7E101D33B; Fri, 8 Jun 2018 14:58:40 +0000 (UTC) (envelope-from db@db.net) Received: from artemis.db.net (artemis.db.net [45.32.229.41]) by mx1.freebsd.org (Postfix) with ESMTP id 84D41864B1; Fri, 8 Jun 2018 14:58:40 +0000 (UTC) (envelope-from db@db.net) Received: from night.db.net (localhost [127.0.0.1]) by artemis.db.net (Postfix) with ESMTP id 3ACA21021E; Fri, 8 Jun 2018 14:58:38 +0000 (UTC) Received: by night.db.net (Postfix, from userid 1000) id 6FF2A39813; Fri, 8 Jun 2018 10:58:37 -0400 (EDT) Date: Fri, 8 Jun 2018 10:58:37 -0400 From: Diane Bruce To: Ed Maste Cc: Kirk McKusick , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r334814 - head/sbin/dump Message-ID: <20180608145837.GA31398@night.db.net> References: <201806072049.w57Kn1Mk057119@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 14:58:41 -0000 On Fri, Jun 08, 2018 at 10:08:25AM -0400, Ed Maste wrote: > On 7 June 2018 at 16:49, Kirk McKusick wrote: > > Author: mckusick > > Date: Thu Jun 7 20:49:01 2018 > > New Revision: 334814 > > URL: https://svnweb.freebsd.org/changeset/base/334814 > > > > Log: > > Ensure proper initialization of superblock. > > > ... > > --- head/sbin/dump/main.c Thu Jun 7 19:57:55 2018 (r334813) > > +++ head/sbin/dump/main.c Thu Jun 7 20:49:01 2018 (r334814) > > @@ -433,6 +433,7 @@ main(int argc, char *argv[]) > > msgtail("to %s\n", tape); > > > > sync(); > > + sblock = NULL; > > if ((ret = sbget(diskfd, &sblock, -1)) != 0) { > > sblock is initialized to NULL at the beginning of ffs_sbget, so I'm I saw that under lldb when I checked the assembler code. > not really sure what's happening here. ditto. But another data point this morning. I ran stock dump on a spinning rust portable drive I have with me today. It worked fine. the disk in the laptop is a SSD SATA. Another data point , the bug failed to manifest until my system had been running a few minutes. e.g. it did the demo mode failure when I tried to show it to jhibbits... I will boot from the spinning rust and fsck the ssd again. @dteske and I thoroughly fsck_ufs fsck_ffs etc. yesterday but I'll try again today from another root disk. That's an obvious one. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- - db@FreeBSD.org db@db.net http://www.db.net/~db From owner-svn-src-head@freebsd.org Fri Jun 8 15:05:27 2018 Return-Path: Delivered-To: svn-src-head@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 D8CEB101D54F; Fri, 8 Jun 2018 15:05:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8819B86967; Fri, 8 Jun 2018 15:05:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66AA810A32; Fri, 8 Jun 2018 15:05:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58F5R9f018541; Fri, 8 Jun 2018 15:05:27 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58F5RCd018540; Fri, 8 Jun 2018 15:05:27 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201806081505.w58F5RCd018540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 8 Jun 2018 15:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334841 - head/share/skel X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/share/skel X-SVN-Commit-Revision: 334841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 15:05:28 -0000 Author: brd Date: Fri Jun 8 15:05:26 2018 New Revision: 334841 URL: https://svnweb.freebsd.org/changeset/base/334841 Log: Simplify this Makefile. Approved by: bapt (mentor) Modified: head/share/skel/Makefile Modified: head/share/skel/Makefile ============================================================================== --- head/share/skel/Makefile Fri Jun 8 14:36:10 2018 (r334840) +++ head/share/skel/Makefile Fri Jun 8 15:05:26 2018 (r334841) @@ -1,13 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 6/8/93 # $FreeBSD$ -FILESGROUPS= FILES1 FILES2 -FILES1= dot.cshrc dot.login dot.login_conf dot.mailrc dot.profile \ - dot.shrc -FILES2= dot.mail_aliases -FILES1DIR= ${SHAREDIR}/skel -FILES2DIR= ${SHAREDIR}/skel -FILES1MODE= 0644 -FILES2MODE= 0600 +FILES= dot.cshrc dot.login dot.login_conf dot.mailrc dot.profile \ + dot.shrc dot.mail_aliases +FILESDIR= ${SHAREDIR}/skel +FILESMODE= 0644 +FILESMODE_dot.mail_aliases= 0600 .include From owner-svn-src-head@freebsd.org Fri Jun 8 16:08:05 2018 Return-Path: Delivered-To: svn-src-head@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 40028101EB71; Fri, 8 Jun 2018 16:08:05 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E58DA69172; Fri, 8 Jun 2018 16:08:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id AAB5D192B6; Fri, 8 Jun 2018 16:08:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f53.google.com with SMTP id m194-v6so2995674itg.2; Fri, 08 Jun 2018 09:08:04 -0700 (PDT) X-Gm-Message-State: APt69E1PT1qQl8nz/w49lRaOKxCAoS//c6n9CDqRrwof8mH6PZjKhNVO +V7NiPb5HLdhtgzL7y1/VqSu/Avr+tftQjBKu8c= X-Google-Smtp-Source: ADUXVKIPcBglRawfAjSe1Rt621cz+sw2zZlHLdV1ugSBI6w19lk5UTEVWneTI20Q/vrHJCIR7bma1fk3UhhqTaWH3S0= X-Received: by 2002:a24:459f:: with SMTP id c31-v6mr2248977itd.132.1528474084173; Fri, 08 Jun 2018 09:08:04 -0700 (PDT) MIME-Version: 1.0 References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> In-Reply-To: <20180608143448.GB57885@pesky> From: Matthew Macy Date: Fri, 8 Jun 2018 09:07:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:08:05 -0000 On Fri, Jun 8, 2018 at 07:35 Mark Johnston wrote: > On Fri, Jun 08, 2018 at 04:58:03AM +0000, Matt Macy wrote: > > Author: mmacy > > Date: Fri Jun 8 04:58:03 2018 > > New Revision: 334827 > > URL: https://svnweb.freebsd.org/changeset/base/334827 > > > > Log: > > hwpmc: simplify calling convention for hwpmc interrupt handling > > > > pmc_process_interrupt takes 5 arguments when only 3 are needed. > > cpu is always available in curcpu and inuserspace can always be > > derived from the passed trapframe. > > > > While facially a reasonable cleanup this change was motivated > > by the need to workaround a compiler bug. > > What is the compiler bug? Do you have disassembly of the subroutines in > question? > We talked about this online. How would that help without engaging in a huge diversion in to the toolchain? There is nothing wrong with the C code so I resorted to a voodoo fix to get hwpmc working again. If you're volunteering mjg or I or you can disassemble the code prior to my change. > -M > > > > > core2_intr(cpu, tf) -> > > pmc_process_interrupt(cpu, ring, pmc, tf, inuserspace) -> > > pmc_add_sample(cpu, ring, pm, tf, inuserspace) > > > > In the process of optimizing the tail call the tf pointer was getting > > clobbered: > > > > (kgdb) up > > at /storage/mmacy/devel/freebsd/sys/dev/hwpmc/hwpmc_mod.c:4709 > > 4709 > pmc_save_kernel_callchain(ps->ps_pc, > > (kgdb) up > > 1205 error = pmc_process_interrupt(cpu, PMC_HR, pm, > tf, > > > > resulting in a crash in pmc_save_kernel_callchain. > From owner-svn-src-head@freebsd.org Fri Jun 8 16:27:33 2018 Return-Path: Delivered-To: svn-src-head@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 D1822101EF65; Fri, 8 Jun 2018 16:27:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::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 64C8369B35; Fri, 8 Jun 2018 16:27:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x236.google.com with SMTP id i18-v6so13987207qtp.12; Fri, 08 Jun 2018 09:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GSOzT2A5lV4zf72PuKqs1WOX7k+6VqvZL5BC/LZ0nWU=; b=MV+Rr0KD8/5rNRzg36g0HV3mrUkmr941Oiq3S/hwfIfBdyiKuiGekypEY4hFMS5YL9 Nno835T+zAunb9a81c+RDfXNJIFhQZmLSsFpHqcMq3MU6w2H0rWgdkYPeCDTOaeMhQxe Hdc454lE69EUWDDZCY20ZpIDQdK6yAqswJ/cBM3nbq1tYSImD3VcLnNXlrUf6aNg0PjN 6Gtd8wQzFjAXf8hXqjZAhnEakYIPZdGvoTdoKfrGgFAydKjzCjmRxW3vzjCDeTWjATea vIcPiY5TB/wRRWxqUzuS4krPFr0ClZWnk3tFg9wrYVVMo5Nf+GJCD+SSC2Cd6nRmdtoQ fe+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GSOzT2A5lV4zf72PuKqs1WOX7k+6VqvZL5BC/LZ0nWU=; b=H8/Ao629ZtVw9aWoFTr3j/cpyE28u2fB+iLPPpgK8MsSA9UuMOjArAxuhDdFiTBMpA DURhVHZtnlcbJppihqxaEXxKvjZML0T1K1AaWEqB8OKkzyY7VeFRztxJcTyWJriUKte2 P2rvTba9AYCdh5ooSMDPvPiGpTu05gHatU7TopTd0W83E4R0fGouj/3knDyRgOEkJ7fH Y8fTWj3ZxvfbPNwtryYxUfuVguxKFmhFt98gmNrz20Frk/pq44uDoq6aTLa3x901YMz/ 3C+5yCOvNf+6pNmI0fdRvnsqC0gQTNWDat+buldJ4BGXAnDGfx0FalFZqidAQoj4y77i 5snA== X-Gm-Message-State: APt69E0+hPA1RItB17nQfHR7V+k8Bpqr9QL/YoyZsJT85xKlF4Hwvvul mxlNQyDb5VB79OQd99oyOXK2wg== X-Google-Smtp-Source: ADUXVKKvi9WebIOwaqIQhLqMFSFWHKuz4Qun1jp7S58uXIiNjHHjDgihAKDk9X98cgjazF+OAdNfog== X-Received: by 2002:ac8:185c:: with SMTP id n28-v6mr6530163qtk.136.1528475251404; Fri, 08 Jun 2018 09:27:31 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id c37-v6sm15908897qtd.47.2018.06.08.09.27.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 09:27:30 -0700 (PDT) Sender: Mark Johnston Date: Fri, 8 Jun 2018 12:27:01 -0400 From: Mark Johnston To: Matthew Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys Message-ID: <20180608162701.GA65388@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:27:33 -0000 On Fri, Jun 08, 2018 at 09:07:53AM -0700, Matthew Macy wrote: > On Fri, Jun 8, 2018 at 07:35 Mark Johnston wrote: > > > On Fri, Jun 08, 2018 at 04:58:03AM +0000, Matt Macy wrote: > > > Author: mmacy > > > Date: Fri Jun 8 04:58:03 2018 > > > New Revision: 334827 > > > URL: https://svnweb.freebsd.org/changeset/base/334827 > > > > > > Log: > > > hwpmc: simplify calling convention for hwpmc interrupt handling > > > > > > pmc_process_interrupt takes 5 arguments when only 3 are needed. > > > cpu is always available in curcpu and inuserspace can always be > > > derived from the passed trapframe. > > > > > > While facially a reasonable cleanup this change was motivated > > > by the need to workaround a compiler bug. > > > > What is the compiler bug? Do you have disassembly of the subroutines in > > question? > > > > We talked about this online. Not in any more detail than is present in the commit message. > How would that help without engaging in a huge > diversion in to the toolchain? If you can provide C code and point to the bug in the disassembly, that should be enough for an LLVM bug report. I don't think that's a huge diversion. > There is nothing wrong with the C code so I > resorted to a voodoo fix to get hwpmc working again. If you're volunteering > mjg or I or you can disassemble the code prior to my change. I'll volunteer to look at the disassembly, sure. "Nothing wrong with the C code" isn't the bar for claiming a compiler bug though. The fact that our NMI handler isn't re-entrant can lead to subtle problems. If while executing the NMI handler we hit a dtrace probe or DDB breakpoint, the iret executed upon return to the handler will re-enable NMIs. Then, if a second NMI arrives before the handler for the first has returned, the trapframe will be clobbered. Did you rule out an issue like this? From owner-svn-src-head@freebsd.org Fri Jun 8 16:34:44 2018 Return-Path: Delivered-To: svn-src-head@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 7D759101F26B; Fri, 8 Jun 2018 16:34:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1316A1A6; Fri, 8 Jun 2018 16:34:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id CAA92195BC; Fri, 8 Jun 2018 16:34:43 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f175.google.com with SMTP id t5-v6so16582071ioa.8; Fri, 08 Jun 2018 09:34:43 -0700 (PDT) X-Gm-Message-State: APt69E0Rx49TY7m/zstpGIwHUCKTDDXgWuOnsZBha92Iz7nsxjpIYv/A ltnPBlhAs8F4m1DwAlT4qBhZxDQSo7Cd7Dl9U54= X-Google-Smtp-Source: ADUXVKIR2ZIeRa4ohjbgTappT1vIEDJ0Y85pr9CwPEITo8X7hTSAy+r1X1y4kwpvuwf1eyquLAMIMcmh+p3rXPsy7Vg= X-Received: by 2002:a6b:3b49:: with SMTP id i70-v6mr6000297ioa.133.1528475683206; Fri, 08 Jun 2018 09:34:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 09:34:42 -0700 (PDT) In-Reply-To: <20180608162701.GA65388@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> From: Matthew Macy Date: Fri, 8 Jun 2018 09:34:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:34:44 -0000 > The fact that our NMI handler isn't re-entrant can lead to subtle > problems. If while executing the NMI handler we hit a dtrace > probe or DDB breakpoint, the iret executed upon return to the handler > will re-enable NMIs. Then, if a second NMI arrives before the handler > for the first has returned, the trapframe will be clobbered. Did you > rule out an issue like this? No, but it happened instantly on all CPUs an a non-debug kernel 100% of the time after I changed pmc_process_interrupt earlier this week. My voodoo fix now avoids it. What you're describing sounds episodic and doesn't sound like it would be fixed / worked around by my change. -M From owner-svn-src-head@freebsd.org Fri Jun 8 16:37:48 2018 Return-Path: Delivered-To: svn-src-head@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 5B014101F2F5; Fri, 8 Jun 2018 16:37:48 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id EF38A6A342; Fri, 8 Jun 2018 16:37:47 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 5471A17EC4; Fri, 8 Jun 2018 09:37:46 -0700 (PDT) Date: Fri, 8 Jun 2018 09:37:46 -0700 From: hiren panchasara To: Matthew Macy Cc: Randall Stewart , Randall Ray Stewart , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys Message-ID: <20180608163746.GE62424@strugglingcoder.info> References: <201806071818.w57IIENp080093@repo.freebsd.org> <20180607220121.GC62424@strugglingcoder.info> <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> <20180608015740.GD62424@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SWTRyWv/ijrBap1m" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:37:48 -0000 --SWTRyWv/ijrBap1m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/07/18 at 08:07P, Matthew Macy wrote: > > > > Okay. I believe there might be situations where we may want to still > > keep the 'default' stack alive. I know Windows doesn't yet use RACK when > > rtt is lesser than 10ms (or something like that), as an example. > > >=20 > Is there any reason RACK wouldn't work for tracking 10us RTTs? If we > know we know the peer doesn't do delack or have enough data in flight > and the other stack doesn't have broken LRO, could we just use this in > lieu of high resolution timestamps? I believe the issue is both ends having fine-grained timers for RACK to be able to do the right thing. If timer resolution ends up being coarser than rtt, just depending on rack may be problematic. I know 10ms is doable on most systems but just using this as an example that we probably want non-rack ('default') stack to be around a little longer and possibly with the enhancements that we can easily extract out to be shared among all the stacks. Also RACK needing pacing which requires but more CPU so question for us could be that do we want to keep the 'default' stack around for machines that can't take that extra CPU hit. SACK is inefficient in default stack and PRR could be super useful as "psuedo" pacing mechanism and could help recover faster but at the end of the day it all depends on someone with time/energy/motivation to maintain the 'default' stack with all shiny things that appear in non-default stacks. cheers, Hiren ps: I know we are not killing the default stack as of yet and just stopping active maintenance of it but just wanted to raise these (probably obvious) points. --SWTRyWv/ijrBap1m Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJbGrDXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l0QcIAKWf6UGXQDm/wILTuTYlMoc4 9ia14RqEi5bL5tjS5JmSjVK8xt85MkcyIBXYI12Cyf1hlf952d+wi0jqrVnkbwKi QQOMm5P8TtAN/PjX2lyxdNZdJ4Y5eWlEKG5vOmvHkBMtaXAovyXFbL90WNbcFllK umFSXPvOsxfTjF5Q8Dmx0Dbqr050pXF3L+aY11fxivWnLTVtnOC9ANTmF6y+jGXl pvKyuudvySUuRQp+rCddcgOPgammpqy7vj/UDRfDkxcpXzixytmyRZLcsquQK6hh 6iCyxjyaFZEB0o11LTfms4NSr09TmZS8al4qAfPh5m5ekm6o7OeNJeYkkikgq9A= =rAaV -----END PGP SIGNATURE----- --SWTRyWv/ijrBap1m-- From owner-svn-src-head@freebsd.org Fri Jun 8 16:51:29 2018 Return-Path: Delivered-To: svn-src-head@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 C97E9101F729 for ; Fri, 8 Jun 2018 16:51:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 539F56ACA2 for ; Fri, 8 Jun 2018 16:51:29 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 2b759ae4-6b3c-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 2b759ae4-6b3c-11e8-8837-614b7c574d04; Fri, 08 Jun 2018 16:51:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w58GpKs4047306; Fri, 8 Jun 2018 10:51:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528476680.53315.3.camel@freebsd.org> Subject: Re: svn commit: r334777 - head/sys/compat/linuxkpi/common/include/linux From: Ian Lepore To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 08 Jun 2018 10:51:20 -0600 In-Reply-To: <201806071141.w57BfhEe076323@repo.freebsd.org> References: <201806071141.w57BfhEe076323@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:51:30 -0000 On Thu, 2018-06-07 at 11:41 +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Jun  7 11:41:42 2018 > New Revision: 334777 > URL: https://svnweb.freebsd.org/changeset/base/334777 > > Log: >   Wrap timespec64 into timespec in the LinuxKPI. >    >   Submitted by: Johannes Lundberg >   MFC after: 1 week >   Sponsored by: Mellanox Technologies >   Sponsored by: Limelight Networks > > Modified: >   head/sys/compat/linuxkpi/common/include/linux/ktime.h >   head/sys/compat/linuxkpi/common/include/linux/time.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h > ===================================================================== > ========= > --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Thu > Jun  7 11:40:13 2018 (r334776) > +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Thu > Jun  7 11:41:42 2018 (r334777) > @@ -159,6 +159,7 @@ timeval_to_ktime(struct timeval tv) >  } >   >  #define ktime_to_timespec(kt) ns_to_timespec(k > t) > +#define ktime_to_timespec64(kt) ns_to_timespec > (kt) >  #define ktime_to_timeval(kt) ns_to_timeval(kt) >  #define ktime_to_ns(kt) (kt) >   > > Modified: head/sys/compat/linuxkpi/common/include/linux/time.h > ===================================================================== > ========= > --- head/sys/compat/linuxkpi/common/include/linux/time.h Thu > Jun  7 11:40:13 2018 (r334776) > +++ head/sys/compat/linuxkpi/common/include/linux/time.h Thu > Jun  7 11:41:42 2018 (r334777) > @@ -35,6 +35,8 @@ >  #define USEC_PER_MSEC 1000L >  #define USEC_PER_SEC 1000000L >   > +#define timespec64 timespec > + >  #include >  #include Will this be a problem on i386, where timespec contains a 32-bit time_t?  I think it's the only remaining arch with 32-bit time_t. -- Ian From owner-svn-src-head@freebsd.org Fri Jun 8 16:59:49 2018 Return-Path: Delivered-To: svn-src-head@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 A0755101F94A; Fri, 8 Jun 2018 16:59:49 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (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 155396B17A; Fri, 8 Jun 2018 16:59:49 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f47.google.com with SMTP id j15-v6so4996500wme.0; Fri, 08 Jun 2018 09:59:49 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VOwoA8ZWi6u+f3ll1paBzSE2xoROdxdWt7x5cJOtizQ=; b=KKewIZ1pCMfRwySV8ppvJF0wcKs7h2DhgydfkA3MAOE8mR6ZR6dhoLu3vdSm9+53nc 5E8XE/FL402+IY/b4csEBiyUaeFbmzSlHjTIFyXvtIl0PjMlDjtIfoiBfs6gjPClIzOG IasA0FkwkX+D7qnPKRWKrZLxeAcg/hLans3D+1NG84NU2CJlh4VYTlA2ZHvdsE3F2t9X BJwf564uAfLSEp2U5GagFf8pfjNf87k+IvjnoLBOyuLaQWjKp/k1Iru0iYAfzMuM1UZw MqEzhHTjRQyJcMKD2lvzxMNsKGGyu3sj/wLnDnVAexLosS1pIqKgIIZ5G3GoeE+j1nWw kljw== X-Gm-Message-State: APt69E1ykDkNtew32M0Qtk6pQZlcu/pX1Hv/YVqlMnPe0hcgfuC5QV7z PuIktyupCcFr/bpIf/efm3yQyLlHY9M= X-Google-Smtp-Source: ADUXVKIi/9qzuS7fptA2OnYrALEIn8FgpgqQ4cpAjNcemouQ18JBkC9NSyJNXklbWgr2V6gbbuUT6A== X-Received: by 2002:a50:a4c6:: with SMTP id x6-v6mr7767997edb.247.1528477182114; Fri, 08 Jun 2018 09:59:42 -0700 (PDT) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com. [74.125.82.44]) by smtp.gmail.com with ESMTPSA id l13-v6sm6882610edi.19.2018.06.08.09.59.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 09:59:41 -0700 (PDT) Received: by mail-wm0-f44.google.com with SMTP id z6-v6so7766914wma.0; Fri, 08 Jun 2018 09:59:41 -0700 (PDT) X-Received: by 2002:a1c:7a06:: with SMTP id v6-v6mr2131432wmc.90.1528477181761; Fri, 08 Jun 2018 09:59:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:98e2:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 09:59:41 -0700 (PDT) In-Reply-To: <20180608163746.GE62424@strugglingcoder.info> References: <201806071818.w57IIENp080093@repo.freebsd.org> <20180607220121.GC62424@strugglingcoder.info> <40CCC8B4-5667-4D4B-A4B4-7AD5779FE011@netflix.com> <20180608015740.GD62424@strugglingcoder.info> <20180608163746.GE62424@strugglingcoder.info> From: "Jonathan T. Looney" Date: Fri, 8 Jun 2018 12:59:41 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334804 - in head/sys: kern modules/tcp modules/tcp/rack netinet netinet/tcp_stacks sys To: hiren panchasara Cc: Matthew Macy , Randall Stewart , Randall Ray Stewart , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:59:49 -0000 On Fri, Jun 8, 2018 at 12:37 PM, hiren panchasara < hiren@strugglingcoder.info> wrote: > ps: I know we are not killing the default stack as of yet and just > stopping active maintenance of it but just wanted to raise these > (probably obvious) points. We absolutely are not stopping active maintenance of the "default" (soon to be renamed "base") TCP stack. RACK is an alternative which might be useful for some people. But, there is no suggestion that we should in any way change the priority we give to maintaining the base TCP stack anytime in the near future. Jonathan From owner-svn-src-head@freebsd.org Fri Jun 8 17:37:44 2018 Return-Path: Delivered-To: svn-src-head@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 9EA9310201A3; Fri, 8 Jun 2018 17:37:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9456C24A; Fri, 8 Jun 2018 17:37:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31889122DF; Fri, 8 Jun 2018 17:37:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Hbih9094529; Fri, 8 Jun 2018 17:37:44 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Hbi2R094528; Fri, 8 Jun 2018 17:37:44 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081737.w58Hbi2R094528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 17:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334842 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 334842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:37:44 -0000 Author: mmacy Date: Fri Jun 8 17:37:43 2018 New Revision: 334842 URL: https://svnweb.freebsd.org/changeset/base/334842 Log: hpts: remove redundant decl breaking gcc build Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Fri Jun 8 15:05:26 2018 (r334841) +++ head/sys/netinet/tcp_hpts.c Fri Jun 8 17:37:43 2018 (r334842) @@ -198,7 +198,6 @@ static void tcp_init_hptsi(void *st); int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; static int32_t tcp_hpts_callout_skip_swi = 0; -SYSCTL_DECL(_net_inet_tcp); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hpts, CTLFLAG_RW, 0, "TCP Hpts controls"); #define timersub(tvp, uvp, vvp) \ From owner-svn-src-head@freebsd.org Fri Jun 8 17:37:52 2018 Return-Path: Delivered-To: svn-src-head@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 79D6A10201C2; Fri, 8 Jun 2018 17:37:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9486C317; Fri, 8 Jun 2018 17:37:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF15B122E0; Fri, 8 Jun 2018 17:37:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Hbn4D094582; Fri, 8 Jun 2018 17:37:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58HbnWv094580; Fri, 8 Jun 2018 17:37:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081737.w58HbnWv094580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 17:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334843 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 334843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:37:52 -0000 Author: mmacy Date: Fri Jun 8 17:37:49 2018 New Revision: 334843 URL: https://svnweb.freebsd.org/changeset/base/334843 Log: avoid 'tcp_outflags defined but not used' Modified: head/sys/netinet/tcp_fsm.h head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_fsm.h ============================================================================== --- head/sys/netinet/tcp_fsm.h Fri Jun 8 17:37:43 2018 (r334842) +++ head/sys/netinet/tcp_fsm.h Fri Jun 8 17:37:49 2018 (r334843) @@ -78,27 +78,8 @@ #define TCPS_HAVERCVDFIN(s) \ ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2)) -#ifdef TCPOUTFLAGS -/* - * Flags used when sending segments in tcp_output. Basic flags (TH_RST, - * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso - * that TH_FIN is sent only if all data queued for output is included in the - * segment. - */ -static u_char tcp_outflags[TCP_NSTATES] = { - TH_RST|TH_ACK, /* 0, CLOSED */ - 0, /* 1, LISTEN */ - TH_SYN, /* 2, SYN_SENT */ - TH_SYN|TH_ACK, /* 3, SYN_RECEIVED */ - TH_ACK, /* 4, ESTABLISHED */ - TH_ACK, /* 5, CLOSE_WAIT */ - TH_FIN|TH_ACK, /* 6, FIN_WAIT_1 */ - TH_FIN|TH_ACK, /* 7, CLOSING */ - TH_FIN|TH_ACK, /* 8, LAST_ACK */ - TH_ACK, /* 9, FIN_WAIT_2 */ - TH_ACK, /* 10, TIME_WAIT */ -}; -#endif + +extern u_char tcp_outflags[TCP_NSTATES]; #ifdef KPROF int tcp_acounts[TCP_NSTATES][PRU_NREQ]; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri Jun 8 17:37:43 2018 (r334842) +++ head/sys/netinet/tcp_output.c Fri Jun 8 17:37:49 2018 (r334843) @@ -169,6 +169,26 @@ hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr #endif /* + * Flags used when sending segments in tcp_output. Basic flags (TH_RST, + * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso + * that TH_FIN is sent only if all data queued for output is included in the + * segment. + */ +u_char tcp_outflags[TCP_NSTATES] = { + TH_RST|TH_ACK, /* 0, CLOSED */ + 0, /* 1, LISTEN */ + TH_SYN, /* 2, SYN_SENT */ + TH_SYN|TH_ACK, /* 3, SYN_RECEIVED */ + TH_ACK, /* 4, ESTABLISHED */ + TH_ACK, /* 5, CLOSE_WAIT */ + TH_FIN|TH_ACK, /* 6, FIN_WAIT_1 */ + TH_FIN|TH_ACK, /* 7, CLOSING */ + TH_FIN|TH_ACK, /* 8, LAST_ACK */ + TH_ACK, /* 9, FIN_WAIT_2 */ + TH_ACK, /* 10, TIME_WAIT */ +}; + +/* * CC wrapper hook functions */ static void inline From owner-svn-src-head@freebsd.org Fri Jun 8 17:38:07 2018 Return-Path: Delivered-To: svn-src-head@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 14C1A10201F0; Fri, 8 Jun 2018 17:38:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 927CD6C45B; Fri, 8 Jun 2018 17:38:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w58HbtVK013373; Fri, 8 Jun 2018 20:37:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w58HbtVK013373 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w58Hbtbb013372; Fri, 8 Jun 2018 20:37:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 8 Jun 2018 20:37:55 +0300 From: Konstantin Belousov To: Ryan Libby Cc: Mateusz Guzik , Mark Johnston , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180608173755.GJ2450@kib.kiev.ua> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:38:07 -0000 On Thu, Jun 07, 2018 at 11:02:29PM -0700, Ryan Libby wrote: > On Thu, Jun 7, 2018 at 10:03 PM, Mateusz Guzik wrote: > > On Fri, Jun 8, 2018 at 6:29 AM, Ryan Libby wrote: > >> > >> On Thu, Jun 7, 2018 at 8:32 PM, Mark Johnston wrote: > >> > On Wed, Jun 06, 2018 at 05:03:11PM +0300, Konstantin Belousov wrote: > >> >> On Wed, Jun 06, 2018 at 12:57:12PM +0000, Justin Hibbits wrote: > >> >> > Author: jhibbits > >> >> > Date: Wed Jun 6 12:57:11 2018 > >> >> > New Revision: 334708 > >> >> > URL: https://svnweb.freebsd.org/changeset/base/334708 > >> >> > > >> >> > Log: > >> >> > Add a memory barrier after taking a reference on the vnode holdcnt > >> >> > in _vhold > >> >> > > >> >> > This is needed to avoid a race between the VNASSERT() below, and > >> >> > another > >> >> > thread updating the VI_FREE flag, on weakly-ordered architectures. > >> >> > > >> >> > On a 72-thread POWER9, without this barrier a 'make -j72 > >> >> > buildworld' would > >> >> > panic on the assert regularly. > >> >> > > >> >> > It may be possible to use a weaker barrier, and I'll investigate > >> >> > that once > >> >> > all stability issues are worked out on POWER9. > >> >> > > >> >> > Modified: > >> >> > head/sys/kern/vfs_subr.c > >> >> > > >> >> > Modified: head/sys/kern/vfs_subr.c > >> >> > > >> >> > ============================================================================== > >> >> > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 > >> >> > (r334707) > >> >> > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 > >> >> > (r334708) > >> >> > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > >> >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > >> >> > if (!locked) { > >> >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > >> >> > +#if !defined(__amd64__) && !defined(__i386__) > >> >> > + mb(); > >> >> > +#endif > >> >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > >> >> > ("_vhold: vnode with holdcnt is free")); > >> >> > return; > >> >> First, mb() must not be used in the FreeBSD code at all. > >> >> Look at atomic_thread_fenceXXX(9) KPI. > >> >> > >> >> Second, you need the reciprocal fence between clearing of VI_FREE and > >> >> refcount_acquire(), otherwise the added barrier is nop. Most likely, > >> >> you got away with it because there is a mutex unlock between clearing > >> >> of VI_FREE and acquire, which release semantic you abused. > >> > > >> > I note that vnlru_free_locked() clears VI_FREE and increments v_holdcnt > >> > without an intervening release fence. At this point the caller has not > >> > purged the vnode from the name cache, so it seems possible that the > >> > panicking thread observed the two stores out of order. In particular, it > >> > seems to me that the patch below is necessary, but possibly (probably?) > >> > not sufficient: > >> > >> Mark, Justin, and I looked at this. > >> > >> I think that the VNASSERT itself is not quite valid, since it is > >> checking the value of v_iflag without the vnode interlock held (and > >> without the vop lock also). If the rule is that we normally need the > >> vnode interlock to check VI_FREE, then I don't think that possible > >> reordering between the refcount_acquire and VI_FREE clearing in > >> vnlru_free_locked is necessarily a problem in production. > > > > > > Checking it without any locks is perfectly valid in this case. It is done > > after v_holdcnt gets bumped from a non-zero value. So at that time it > > is at least two. Of course that result is stale as an arbitrary number of > > other threads could have bumped and dropped the ref past that point. > > The minimum value is 1 since we hold the ref. But this means the > > vnode must not be on the free list and that's what the assertion is > > verifying. > > > > The problem is indeed lack of ordering against the code clearing the > > flag for the case where 2 threads to vhold and one does the 0->1 > > transition. > > > > That said, the fence is required for the assertion to work. > > > > Yeah, I agree with this logic. What I mean is that reordering between > v_holdcnt 0->1 and v_iflag is normally settled by the release and > acquisition of the vnode interlock, which we are supposed to hold for > v_*i*flag. A quick scan seems to show all of the checks of VI_FREE that > are not asserts do hold the vnode interlock. So, I'm just saying that I > don't think the possible reordering affects them. But do we know that only VI_FREE checks are affected ? My concern is that users of _vhold() rely on seeing up to date state of the vnode, and VI_FREE is only an example of the problem. Most likely, the code which fetched the vnode pointer before _vhold() call, should guarantee visibility. > > >> > >> > >> It might just be that unlocked assertions about v_iflag actually need > >> additional synchronization (although it would be a little unfortunate to > >> add synchronization only to INVARIANTS builds). > >> > >> > > >> >> Does the fence needed for the non-invariants case ? > >> >> > >> >> Fourth, doesn't v_usecount has the same issues WRT inactivation ? > >> > > >> > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > >> > index 286a871c3631..c97a8ba63612 100644 > >> > --- a/sys/kern/vfs_subr.c > >> > +++ b/sys/kern/vfs_subr.c > >> > @@ -1018,6 +1018,7 @@ vnlru_free_locked(int count, struct vfsops > >> > *mnt_op) > >> > */ > >> > freevnodes--; > >> > vp->v_iflag &= ~VI_FREE; > >> > + atomic_thread_fence_rel(); > > > > > > This probably has no added value for non-debug kernels. > > > >> > >> > refcount_acquire(&vp->v_holdcnt); > >> > > >> > mtx_unlock(&vnode_free_list_mtx); > >> > @@ -2807,9 +2808,7 @@ _vhold(struct vnode *vp, bool locked) > >> > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > >> > if (!locked) { > >> > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > >> > -#if !defined(__amd64__) && !defined(__i386__) > >> > - mb(); > >> > -#endif > >> > + atomic_thread_fence_acq(); > > > > > > Same as above. > > > >> > >> > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > >> > ("_vhold: vnode with holdcnt is free")); > >> > return; > > > > > > The main codepath which runs into this (... -> cache_lookup -> vhold) most > > definitely does not need the fence for production operation. > > > > What is unclear without audit is whether there are vhold users which need > > one. I think the patch is fine to go in if the other VI_FREE place gets a > > comment about a fence stemming from mtx_unlock and there is another one > > prior to the assertion explaining that this orders against v_iflag tests and > > may > > or may not be needed for other consumers. > > > > In general the code is *full* of data races and accidental reliance of > > ordering > > provided by amd64. Weeding this all out will be a painful exercise. > > > > Part of the problem is lack of primitives like READ_ONCE/WRITE_ONCE as > > seen in the linux kernel, someone should hack up equivalents. > > > > -- > > Mateusz Guzik > > Yeah, I think we should understand whether the problem is just the > unsynchronized assertions or whether there are some true bugs. It > doesn't seem great to me to add synchronization which as you said > > > This probably has no added value for non-debug kernels. From owner-svn-src-head@freebsd.org Fri Jun 8 17:38:32 2018 Return-Path: Delivered-To: svn-src-head@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 D6CB61020242; Fri, 8 Jun 2018 17:38:31 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86D916C592; Fri, 8 Jun 2018 17:38:31 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680BB122E1; Fri, 8 Jun 2018 17:38:31 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58HcVmR094670; Fri, 8 Jun 2018 17:38:31 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58HcSsM094656; Fri, 8 Jun 2018 17:38:28 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201806081738.w58HcSsM094656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Fri, 8 Jun 2018 17:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334844 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensol... X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common ... X-SVN-Commit-Revision: 334844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:38:32 -0000 Author: sef Date: Fri Jun 8 17:38:28 2018 New Revision: 334844 URL: https://svnweb.freebsd.org/changeset/base/334844 Log: This originated from ZFS On Linux, as https://github.com/zfsonlinux/zfs/commit/d4a72f23863382bdf6d0ae33196f5b5decbc48fd During scans (scrubs or resilvers), it sorts the blocks in each transaction group by block offset; the result can be a significant improvement. (On my test system just now, which I put some effort to introduce fragmentation into the pool since I set it up yesterday, a scrub went from 1h2m to 33.5m with the changes.) I've seen similar rations on production systems. Approved by: Alexander Motin Obtained from: ZFS On Linux Relnotes: Yes (improved scrub performance, with tunables) Differential Revision: https://reviews.freebsd.org/D15562 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Jun 8 17:38:28 2018 (r334844) @@ -2281,14 +2281,14 @@ dump_dir(objset_t *os) object_count++; } - ASSERT3U(object_count, ==, usedobjs); - (void) printf("\n"); if (error != ESRCH) { (void) fprintf(stderr, "dmu_object_next() = %d\n", error); abort(); } + + ASSERT3U(object_count, ==, usedobjs); } static void @@ -2788,6 +2788,7 @@ zdb_blkptr_done(zio_t *zio) mutex_enter(&spa->spa_scrub_lock); spa->spa_scrub_inflight--; + spa->spa_load_verify_ios--; cv_broadcast(&spa->spa_scrub_io_cv); if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { @@ -2859,9 +2860,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr flags |= ZIO_FLAG_SPECULATIVE; mutex_enter(&spa->spa_scrub_lock); - while (spa->spa_scrub_inflight > max_inflight) + while (spa->spa_load_verify_ios > max_inflight) cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); spa->spa_scrub_inflight++; + spa->spa_load_verify_ios++; mutex_exit(&spa->spa_scrub_lock); zio_nowait(zio_read(NULL, spa, bp, abd, size, Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jun 8 17:38:28 2018 (r334844) @@ -1643,7 +1643,7 @@ print_status_config(zpool_handle_t *zhp, const char *n (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &c); - if (ps && ps->pss_state == DSS_SCANNING && + if (ps != NULL && ps->pss_state == DSS_SCANNING && vs->vs_scan_processed != 0 && children == 0) { (void) printf(gettext(" (%s)"), (ps->pss_func == POOL_SCAN_RESILVER) ? @@ -4254,11 +4254,13 @@ static void print_scan_status(pool_scan_stat_t *ps) { time_t start, end, pause; - uint64_t elapsed, mins_left, hours_left; - uint64_t pass_exam, examined, total; - uint_t rate; + uint64_t total_secs_left; + uint64_t elapsed, secs_left, mins_left, hours_left, days_left; + uint64_t pass_scanned, scanned, pass_issued, issued, total; + uint_t scan_rate, issue_rate; double fraction_done; - char processed_buf[7], examined_buf[7], total_buf[7], rate_buf[7]; + char processed_buf[7], scanned_buf[7], issued_buf[7], total_buf[7]; + char srate_buf[7], irate_buf[7]; (void) printf(gettext(" scan: ")); @@ -4272,30 +4274,37 @@ print_scan_status(pool_scan_stat_t *ps) start = ps->pss_start_time; end = ps->pss_end_time; pause = ps->pss_pass_scrub_pause; + zfs_nicenum(ps->pss_processed, processed_buf, sizeof (processed_buf)); assert(ps->pss_func == POOL_SCAN_SCRUB || ps->pss_func == POOL_SCAN_RESILVER); - /* - * Scan is finished or canceled. - */ - if (ps->pss_state == DSS_FINISHED) { - uint64_t minutes_taken = (end - start) / 60; - char *fmt = NULL; + /* Scan is finished or canceled. */ + if (ps->pss_state == DSS_FINISHED) { + total_secs_left = end - start; + days_left = total_secs_left / 60 / 60 / 24; + hours_left = (total_secs_left / 60 / 60) % 24; + mins_left = (total_secs_left / 60) % 60; + secs_left = (total_secs_left % 60); + if (ps->pss_func == POOL_SCAN_SCRUB) { - fmt = gettext("scrub repaired %s in %lluh%um with " - "%llu errors on %s"); + (void) printf(gettext("scrub repaired %s " + "in %llu days %02llu:%02llu:%02llu " + "with %llu errors on %s"), processed_buf, + (u_longlong_t)days_left, (u_longlong_t)hours_left, + (u_longlong_t)mins_left, (u_longlong_t)secs_left, + (u_longlong_t)ps->pss_errors, ctime(&end)); } else if (ps->pss_func == POOL_SCAN_RESILVER) { - fmt = gettext("resilvered %s in %lluh%um with " - "%llu errors on %s"); + (void) printf(gettext("resilvered %s " + "in %llu days %02llu:%02llu:%02llu " + "with %llu errors on %s"), processed_buf, + (u_longlong_t)days_left, (u_longlong_t)hours_left, + (u_longlong_t)mins_left, (u_longlong_t)secs_left, + (u_longlong_t)ps->pss_errors, ctime(&end)); + } - /* LINTED */ - (void) printf(fmt, processed_buf, - (u_longlong_t)(minutes_taken / 60), - (uint_t)(minutes_taken % 60), - (u_longlong_t)ps->pss_errors, - ctime((time_t *)&end)); + return; } else if (ps->pss_state == DSS_CANCELED) { if (ps->pss_func == POOL_SCAN_SCRUB) { @@ -4310,19 +4319,15 @@ print_scan_status(pool_scan_stat_t *ps) assert(ps->pss_state == DSS_SCANNING); - /* - * Scan is in progress. - */ + /* Scan is in progress. Resilvers can't be paused. */ if (ps->pss_func == POOL_SCAN_SCRUB) { if (pause == 0) { (void) printf(gettext("scrub in progress since %s"), ctime(&start)); } else { - char buf[32]; - struct tm *p = localtime(&pause); - (void) strftime(buf, sizeof (buf), "%a %b %e %T %Y", p); - (void) printf(gettext("scrub paused since %s\n"), buf); - (void) printf(gettext("\tscrub started on %s"), + (void) printf(gettext("scrub paused since %s"), + ctime(&pause)); + (void) printf(gettext("\tscrub started on %s"), ctime(&start)); } } else if (ps->pss_func == POOL_SCAN_RESILVER) { @@ -4330,49 +4335,67 @@ print_scan_status(pool_scan_stat_t *ps) ctime(&start)); } - examined = ps->pss_examined ? ps->pss_examined : 1; + scanned = ps->pss_examined; + pass_scanned = ps->pss_pass_exam; + issued = ps->pss_issued; + pass_issued = ps->pss_pass_issued; total = ps->pss_to_examine; - fraction_done = (double)examined / total; - /* elapsed time for this pass */ + /* we are only done with a block once we have issued the IO for it */ + fraction_done = (double)issued / total; + + /* elapsed time for this pass, rounding up to 1 if it's 0 */ elapsed = time(NULL) - ps->pss_pass_start; elapsed -= ps->pss_pass_scrub_spent_paused; - elapsed = elapsed ? elapsed : 1; - pass_exam = ps->pss_pass_exam ? ps->pss_pass_exam : 1; - rate = pass_exam / elapsed; - rate = rate ? rate : 1; - mins_left = ((total - examined) / rate) / 60; - hours_left = mins_left / 60; + elapsed = (elapsed != 0) ? elapsed : 1; - zfs_nicenum(examined, examined_buf, sizeof (examined_buf)); + scan_rate = pass_scanned / elapsed; + issue_rate = pass_issued / elapsed; + total_secs_left = (issue_rate != 0) ? + ((total - issued) / issue_rate) : UINT64_MAX; + + days_left = total_secs_left / 60 / 60 / 24; + hours_left = (total_secs_left / 60 / 60) % 24; + mins_left = (total_secs_left / 60) % 60; + secs_left = (total_secs_left % 60); + + /* format all of the numbers we will be reporting */ + zfs_nicenum(scanned, scanned_buf, sizeof (scanned_buf)); + zfs_nicenum(issued, issued_buf, sizeof (issued_buf)); zfs_nicenum(total, total_buf, sizeof (total_buf)); + zfs_nicenum(scan_rate, srate_buf, sizeof (srate_buf)); + zfs_nicenum(issue_rate, irate_buf, sizeof (irate_buf)); - /* - * do not print estimated time if hours_left is more than 30 days - * or we have a paused scrub - */ + /* doo not print estimated time if we have a paused scrub */ if (pause == 0) { - zfs_nicenum(rate, rate_buf, sizeof (rate_buf)); - (void) printf(gettext("\t%s scanned out of %s at %s/s"), - examined_buf, total_buf, rate_buf); - if (hours_left < (30 * 24)) { - (void) printf(gettext(", %lluh%um to go\n"), - (u_longlong_t)hours_left, (uint_t)(mins_left % 60)); - } else { - (void) printf(gettext( - ", (scan is slow, no estimated time)\n")); - } + (void) printf(gettext("\t%s scanned at %s/s, " + "%s issued at %s/s, %s total\n"), + scanned_buf, srate_buf, issued_buf, irate_buf, total_buf); } else { - (void) printf(gettext("\t%s scanned out of %s\n"), - examined_buf, total_buf); + (void) printf(gettext("\t%s scanned, %s issued, %s total\n"), + scanned_buf, issued_buf, total_buf); } if (ps->pss_func == POOL_SCAN_RESILVER) { - (void) printf(gettext(" %s resilvered, %.2f%% done\n"), + (void) printf(gettext("\t%s resilvered, %.2f%% done"), processed_buf, 100 * fraction_done); } else if (ps->pss_func == POOL_SCAN_SCRUB) { - (void) printf(gettext(" %s repaired, %.2f%% done\n"), + (void) printf(gettext("\t%s repaired, %.2f%% done"), processed_buf, 100 * fraction_done); + } + + if (pause == 0) { + if (issue_rate >= 10 * 1024 * 1024) { + (void) printf(gettext(", %llu days " + "%02llu:%02llu:%02llu to go\n"), + (u_longlong_t)days_left, (u_longlong_t)hours_left, + (u_longlong_t)mins_left, (u_longlong_t)secs_left); + } else { + (void) printf(gettext(", no estimated " + "completion time\n")); + } + } else { + (void) printf(gettext("\n")); } } Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jun 8 17:38:28 2018 (r334844) @@ -374,15 +374,15 @@ ztest_info_t ztest_info[] = { { ztest_fzap, 1, &zopt_sometimes }, { ztest_dmu_snapshot_create_destroy, 1, &zopt_sometimes }, { ztest_spa_create_destroy, 1, &zopt_sometimes }, - { ztest_fault_inject, 1, &zopt_sometimes }, + { ztest_fault_inject, 1, &zopt_incessant }, { ztest_ddt_repair, 1, &zopt_sometimes }, { ztest_dmu_snapshot_hold, 1, &zopt_sometimes }, { ztest_reguid, 1, &zopt_rarely }, { ztest_spa_rename, 1, &zopt_rarely }, - { ztest_scrub, 1, &zopt_rarely }, + { ztest_scrub, 1, &zopt_often }, { ztest_spa_upgrade, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, - { ztest_vdev_attach_detach, 1, &zopt_sometimes }, + { ztest_vdev_attach_detach, 1, &zopt_incessant }, { ztest_vdev_LUN_growth, 1, &zopt_rarely }, { ztest_vdev_add_remove, 1, &ztest_opts.zo_vdevtime }, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jun 8 17:38:28 2018 (r334844) @@ -219,7 +219,7 @@ check_status(nvlist_t *config, boolean_t isimport) */ (void) nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &psc); - if (ps && ps->pss_func == POOL_SCAN_RESILVER && + if (ps != NULL && ps->pss_func == POOL_SCAN_RESILVER && ps->pss_state == DSS_SCANNING) return (ZPOOL_STATUS_RESILVERING); Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Jun 8 17:38:28 2018 (r334844) @@ -408,6 +408,7 @@ typedef struct taskq_ent { #define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */ #define TQ_FRONT 0x08 /* Queue in front */ +#define TASKQID_INVALID ((taskqid_t)0) extern taskq_t *system_taskq; @@ -421,6 +422,7 @@ extern void taskq_dispatch_ent(taskq_t *, task_func_t, taskq_ent_t *); extern void taskq_destroy(taskq_t *); extern void taskq_wait(taskq_t *); +extern void taskq_wait_id(taskq_t *, taskqid_t); extern int taskq_member(taskq_t *, void *); extern void system_taskq_init(void); extern void system_taskq_fini(void); Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Fri Jun 8 17:38:28 2018 (r334844) @@ -187,6 +187,12 @@ taskq_wait(taskq_t *tq) mutex_exit(&tq->tq_lock); } +void +taskq_wait_id(taskq_t *tq, taskqid_t id) +{ + taskq_wait(tq); +} + static void * taskq_thread(void *arg) { Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 8 17:38:28 2018 (r334844) @@ -173,3 +173,9 @@ taskq_wait(taskq_t *tq) { taskqueue_drain_all(tq->tq_queue); } + +void +taskq_wait_id(taskq_t *tq, taskqid_t id) +{ + taskq_wait(tq); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 8 17:38:28 2018 (r334844) @@ -339,7 +339,8 @@ int arc_no_grow_shift = 5; * minimum lifespan of a prefetch block in clock ticks * (initialized in arc_init()) */ -static int arc_min_prefetch_lifespan; +static int zfs_arc_min_prefetch_ms = 1; +static int zfs_arc_min_prescient_prefetch_ms = 6; /* * If this percent of memory is free, don't throttle. @@ -779,8 +780,9 @@ typedef struct arc_stats { kstat_named_t arcstat_meta_limit; kstat_named_t arcstat_meta_max; kstat_named_t arcstat_meta_min; - kstat_named_t arcstat_sync_wait_for_async; + kstat_named_t arcstat_async_upgrade_sync; kstat_named_t arcstat_demand_hit_predictive_prefetch; + kstat_named_t arcstat_demand_hit_prescient_prefetch; } arc_stats_t; static arc_stats_t arc_stats = { @@ -877,8 +879,9 @@ static arc_stats_t arc_stats = { { "arc_meta_limit", KSTAT_DATA_UINT64 }, { "arc_meta_max", KSTAT_DATA_UINT64 }, { "arc_meta_min", KSTAT_DATA_UINT64 }, - { "sync_wait_for_async", KSTAT_DATA_UINT64 }, + { "async_upgrade_sync", KSTAT_DATA_UINT64 }, { "demand_hit_predictive_prefetch", KSTAT_DATA_UINT64 }, + { "demand_hit_prescient_prefetch", KSTAT_DATA_UINT64 }, }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -974,22 +977,23 @@ typedef struct arc_callback arc_callback_t; struct arc_callback { void *acb_private; - arc_done_func_t *acb_done; + arc_read_done_func_t *acb_done; arc_buf_t *acb_buf; boolean_t acb_compressed; zio_t *acb_zio_dummy; + zio_t *acb_zio_head; arc_callback_t *acb_next; }; typedef struct arc_write_callback arc_write_callback_t; struct arc_write_callback { - void *awcb_private; - arc_done_func_t *awcb_ready; - arc_done_func_t *awcb_children_ready; - arc_done_func_t *awcb_physdone; - arc_done_func_t *awcb_done; - arc_buf_t *awcb_buf; + void *awcb_private; + arc_write_done_func_t *awcb_ready; + arc_write_done_func_t *awcb_children_ready; + arc_write_done_func_t *awcb_physdone; + arc_write_done_func_t *awcb_done; + arc_buf_t *awcb_buf; }; /* @@ -1229,6 +1233,8 @@ sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_ARGS) #define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) #define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_FLAG_IO_ERROR) #define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_FLAG_PREFETCH) +#define HDR_PRESCIENT_PREFETCH(hdr) \ + ((hdr)->b_flags & ARC_FLAG_PRESCIENT_PREFETCH) #define HDR_COMPRESSION_ENABLED(hdr) \ ((hdr)->b_flags & ARC_FLAG_COMPRESSED_ARC) @@ -1392,6 +1398,11 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_esize, SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2c_only_size, CTLFLAG_RD, &ARC_l2c_only.arcs_size.rc_count, 0, "size of mru state"); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, arc_min_prfetch_ms, CTLFLAG_RW, + &zfs_arc_min_prefetch_ms, 0, "Min life of prefetch block in ms"); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, arc_min_prescient_prefetch_ms, CTLFLAG_RW, + &zfs_arc_min_prescient_prefetch_ms, 0, "Min life oof prescient prefetched block in ms"); + /* * L2ARC Internals */ @@ -3544,6 +3555,8 @@ arc_evict_hdr(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) { arc_state_t *evicted_state, *state; int64_t bytes_evicted = 0; + int min_lifetime = HDR_PRESCIENT_PREFETCH(hdr) ? + zfs_arc_min_prescient_prefetch_ms : zfs_arc_min_prefetch_ms; ASSERT(MUTEX_HELD(hash_lock)); ASSERT(HDR_HAS_L1HDR(hdr)); @@ -3596,8 +3609,7 @@ arc_evict_hdr(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) /* prefetch buffers have a minimum lifespan */ if (HDR_IO_IN_PROGRESS(hdr) || ((hdr->b_flags & (ARC_FLAG_PREFETCH | ARC_FLAG_INDIRECT)) && - ddi_get_lbolt() - hdr->b_l1hdr.b_arc_access < - arc_min_prefetch_lifespan)) { + ddi_get_lbolt() - hdr->b_l1hdr.b_arc_access < min_lifetime * hz)) { ARCSTAT_BUMP(arcstat_evict_skip); return (bytes_evicted); } @@ -4968,13 +4980,15 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) * - move the buffer to the head of the list if this is * another prefetch (to make it less likely to be evicted). */ - if (HDR_PREFETCH(hdr)) { + if (HDR_PREFETCH(hdr) || HDR_PRESCIENT_PREFETCH(hdr)) { if (refcount_count(&hdr->b_l1hdr.b_refcnt) == 0) { /* link protected by hash lock */ ASSERT(multilist_link_active( &hdr->b_l1hdr.b_arc_node)); } else { - arc_hdr_clear_flags(hdr, ARC_FLAG_PREFETCH); + arc_hdr_clear_flags(hdr, + ARC_FLAG_PREFETCH | + ARC_FLAG_PRESCIENT_PREFETCH); ARCSTAT_BUMP(arcstat_mru_hits); } hdr->b_l1hdr.b_arc_access = now; @@ -5005,10 +5019,13 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) * MFU state. */ - if (HDR_PREFETCH(hdr)) { + if (HDR_PREFETCH(hdr) || HDR_PRESCIENT_PREFETCH(hdr)) { new_state = arc_mru; - if (refcount_count(&hdr->b_l1hdr.b_refcnt) > 0) - arc_hdr_clear_flags(hdr, ARC_FLAG_PREFETCH); + if (refcount_count(&hdr->b_l1hdr.b_refcnt) > 0) { + arc_hdr_clear_flags(hdr, + ARC_FLAG_PREFETCH | + ARC_FLAG_PRESCIENT_PREFETCH); + } DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, hdr); } else { new_state = arc_mfu; @@ -5029,11 +5046,7 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) * If it was a prefetch, we will explicitly move it to * the head of the list now. */ - if ((HDR_PREFETCH(hdr)) != 0) { - ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt)); - /* link protected by hash_lock */ - ASSERT(multilist_link_active(&hdr->b_l1hdr.b_arc_node)); - } + ARCSTAT_BUMP(arcstat_mfu_hits); hdr->b_l1hdr.b_arc_access = ddi_get_lbolt(); } else if (hdr->b_l1hdr.b_state == arc_mfu_ghost) { @@ -5044,12 +5057,11 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) * MFU state. */ - if (HDR_PREFETCH(hdr)) { + if (HDR_PREFETCH(hdr) || HDR_PRESCIENT_PREFETCH(hdr)) { /* * This is a prefetch access... * move this block back to the MRU state. */ - ASSERT0(refcount_count(&hdr->b_l1hdr.b_refcnt)); new_state = arc_mru; } @@ -5116,23 +5128,28 @@ arc_buf_access(arc_buf_t *buf) demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, hits); } -/* a generic arc_done_func_t which you can use */ +/* a generic arc_read_done_func_t which you can use */ /* ARGSUSED */ void -arc_bcopy_func(zio_t *zio, arc_buf_t *buf, void *arg) +arc_bcopy_func(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, + arc_buf_t *buf, void *arg) { - if (zio == NULL || zio->io_error == 0) - bcopy(buf->b_data, arg, arc_buf_size(buf)); + if (buf == NULL) + return; + + bcopy(buf->b_data, arg, arc_buf_size(buf)); arc_buf_destroy(buf, arg); } -/* a generic arc_done_func_t */ +/* a generic arc_read_done_func_t */ +/* ARGSUSED */ void -arc_getbuf_func(zio_t *zio, arc_buf_t *buf, void *arg) +arc_getbuf_func(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, + arc_buf_t *buf, void *arg) { arc_buf_t **bufp = arg; - if (zio && zio->io_error) { - arc_buf_destroy(buf, arg); + + if (buf == NULL) { *bufp = NULL; } else { *bufp = buf; @@ -5164,7 +5181,6 @@ arc_read_done(zio_t *zio) arc_callback_t *callback_list; arc_callback_t *acb; boolean_t freeable = B_FALSE; - boolean_t no_zio_error = (zio->io_error == 0); /* * The hdr was inserted into hash-table and removed from lists @@ -5190,7 +5206,7 @@ arc_read_done(zio_t *zio) ASSERT3P(hash_lock, !=, NULL); } - if (no_zio_error) { + if (zio->io_error == 0) { /* byteswap if necessary */ if (BP_SHOULD_BYTESWAP(zio->io_bp)) { if (BP_GET_LEVEL(zio->io_bp) > 0) { @@ -5211,7 +5227,8 @@ arc_read_done(zio_t *zio) callback_list = hdr->b_l1hdr.b_acb; ASSERT3P(callback_list, !=, NULL); - if (hash_lock && no_zio_error && hdr->b_l1hdr.b_state == arc_anon) { + if (hash_lock && zio->io_error == 0 && + hdr->b_l1hdr.b_state == arc_anon) { /* * Only call arc_access on anonymous buffers. This is because * if we've issued an I/O for an evicted buffer, we've already @@ -5232,14 +5249,21 @@ arc_read_done(zio_t *zio) if (!acb->acb_done) continue; - /* This is a demand read since prefetches don't use callbacks */ callback_cnt++; + if (zio->io_error != 0) + continue; + int error = arc_buf_alloc_impl(hdr, acb->acb_private, - acb->acb_compressed, no_zio_error, &acb->acb_buf); - if (no_zio_error) { - zio->io_error = error; + acb->acb_compressed, + B_TRUE, &acb->acb_buf); + if (error != 0) { + arc_buf_destroy(acb->acb_buf, acb->acb_private); + acb->acb_buf = NULL; } + + if (zio->io_error == 0) + zio->io_error = error; } hdr->b_l1hdr.b_acb = NULL; arc_hdr_clear_flags(hdr, ARC_FLAG_IO_IN_PROGRESS); @@ -5252,7 +5276,7 @@ arc_read_done(zio_t *zio) ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt) || callback_list != NULL); - if (no_zio_error) { + if (zio->io_error == 0) { arc_hdr_verify(hdr, zio->io_bp); } else { arc_hdr_set_flags(hdr, ARC_FLAG_IO_ERROR); @@ -5285,8 +5309,10 @@ arc_read_done(zio_t *zio) /* execute each callback and free its structure */ while ((acb = callback_list) != NULL) { - if (acb->acb_done) - acb->acb_done(zio, acb->acb_buf, acb->acb_private); + if (acb->acb_done) { + acb->acb_done(zio, &zio->io_bookmark, zio->io_bp, + acb->acb_buf, acb->acb_private); + } if (acb->acb_zio_dummy != NULL) { acb->acb_zio_dummy->io_error = zio->io_error; @@ -5320,7 +5346,7 @@ arc_read_done(zio_t *zio) * for readers of this block. */ int -arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, +arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_read_done_func_t *done, void *private, zio_priority_t priority, int zio_flags, arc_flags_t *arc_flags, const zbookmark_phys_t *zb) { @@ -5329,7 +5355,8 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, a zio_t *rzio; uint64_t guid = spa_load_guid(spa); boolean_t compressed_read = (zio_flags & ZIO_FLAG_RAW) != 0; - + int rc = 0; + ASSERT(!BP_IS_EMBEDDED(bp) || BPE_GET_ETYPE(bp) == BP_EMBEDDED_TYPE_DATA); @@ -5347,32 +5374,20 @@ top: *arc_flags |= ARC_FLAG_CACHED; if (HDR_IO_IN_PROGRESS(hdr)) { + zio_t *head_zio = hdr->b_l1hdr.b_acb->acb_zio_head; + ASSERT3P(head_zio, !=, NULL); if ((hdr->b_flags & ARC_FLAG_PRIO_ASYNC_READ) && priority == ZIO_PRIORITY_SYNC_READ) { /* - * This sync read must wait for an - * in-progress async read (e.g. a predictive - * prefetch). Async reads are queued - * separately at the vdev_queue layer, so - * this is a form of priority inversion. - * Ideally, we would "inherit" the demand - * i/o's priority by moving the i/o from - * the async queue to the synchronous queue, - * but there is currently no mechanism to do - * so. Track this so that we can evaluate - * the magnitude of this potential performance - * problem. - * - * Note that if the prefetch i/o is already - * active (has been issued to the device), - * the prefetch improved performance, because - * we issued it sooner than we would have - * without the prefetch. + * This is a sync read that needs to wait for + * an in-flight async read. Request that the + * zio have its priority upgraded. */ - DTRACE_PROBE1(arc__sync__wait__for__async, + zio_change_priority(head_zio, priority); + DTRACE_PROBE1(arc__async__upgrade__sync, arc_buf_hdr_t *, hdr); - ARCSTAT_BUMP(arcstat_sync_wait_for_async); + ARCSTAT_BUMP(arcstat_async_upgrade_sync); } if (hdr->b_flags & ARC_FLAG_PREDICTIVE_PREFETCH) { arc_hdr_clear_flags(hdr, @@ -5399,6 +5414,7 @@ top: spa, NULL, NULL, NULL, zio_flags); ASSERT3P(acb->acb_done, !=, NULL); + acb->acb_zio_head = head_zio; acb->acb_next = hdr->b_l1hdr.b_acb; hdr->b_l1hdr.b_acb = acb; mutex_exit(hash_lock); @@ -5426,17 +5442,32 @@ top: arc_hdr_clear_flags(hdr, ARC_FLAG_PREDICTIVE_PREFETCH); } - ASSERT(!BP_IS_EMBEDDED(bp) || !BP_IS_HOLE(bp)); + if (hdr->b_flags & ARC_FLAG_PRESCIENT_PREFETCH) { + ARCSTAT_BUMP( + arcstat_demand_hit_prescient_prefetch); + arc_hdr_clear_flags(hdr, + ARC_FLAG_PRESCIENT_PREFETCH); + } + + ASSERT(!BP_IS_EMBEDDED(bp) || !BP_IS_HOLE(bp)); /* Get a buf with the desired data in it. */ - VERIFY0(arc_buf_alloc_impl(hdr, private, - compressed_read, B_TRUE, &buf)); + rc = arc_buf_alloc_impl(hdr, private, + compressed_read, B_TRUE, &buf); + if (rc != 0) { + arc_buf_destroy(buf, private); + buf = NULL; + } + ASSERT((zio_flags & ZIO_FLAG_SPECULATIVE) || + rc == 0 || rc != ENOENT); } else if (*arc_flags & ARC_FLAG_PREFETCH && refcount_count(&hdr->b_l1hdr.b_refcnt) == 0) { arc_hdr_set_flags(hdr, ARC_FLAG_PREFETCH); } DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); arc_access(hdr, hash_lock); + if (*arc_flags & ARC_FLAG_PRESCIENT_PREFETCH) + arc_hdr_set_flags(hdr, ARC_FLAG_PRESCIENT_PREFETCH); if (*arc_flags & ARC_FLAG_L2CACHE) arc_hdr_set_flags(hdr, ARC_FLAG_L2CACHE); mutex_exit(hash_lock); @@ -5446,7 +5477,7 @@ top: data, metadata, hits); if (done) - done(NULL, buf, private); + done(NULL, zb, bp, buf, private); } else { uint64_t lsize = BP_GET_LSIZE(bp); uint64_t psize = BP_GET_PSIZE(bp); @@ -5520,6 +5551,9 @@ top: if (*arc_flags & ARC_FLAG_PREFETCH) arc_hdr_set_flags(hdr, ARC_FLAG_PREFETCH); + if (*arc_flags & ARC_FLAG_PRESCIENT_PREFETCH) + arc_hdr_set_flags(hdr, ARC_FLAG_PRESCIENT_PREFETCH); + if (*arc_flags & ARC_FLAG_L2CACHE) arc_hdr_set_flags(hdr, ARC_FLAG_L2CACHE); if (BP_GET_LEVEL(bp) > 0) @@ -5549,14 +5583,17 @@ top: vd = NULL; } - if (priority == ZIO_PRIORITY_ASYNC_READ) + /* + * We count both async reads and scrub IOs as asynchronous so + * that both can be upgraded in the event of a cache hit while + * the read IO is still in-flight. + */ + if (priority == ZIO_PRIORITY_ASYNC_READ || + priority == ZIO_PRIORITY_SCRUB) arc_hdr_set_flags(hdr, ARC_FLAG_PRIO_ASYNC_READ); else arc_hdr_clear_flags(hdr, ARC_FLAG_PRIO_ASYNC_READ); - if (hash_lock != NULL) - mutex_exit(hash_lock); - /* * At this point, we have a level 1 cache miss. Try again in * L2ARC if possible. @@ -5637,6 +5674,11 @@ top: ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY, B_FALSE); + acb->acb_zio_head = rzio; + + if (hash_lock != NULL) + mutex_exit(hash_lock); + DTRACE_PROBE2(l2arc__read, vdev_t *, vd, zio_t *, rzio); ARCSTAT_INCR(arcstat_l2_read_bytes, size); @@ -5651,6 +5693,8 @@ top: return (0); /* l2arc read error; goto zio_read() */ + if (hash_lock != NULL) + mutex_enter(hash_lock); } else { DTRACE_PROBE1(l2arc__miss, arc_buf_hdr_t *, hdr); @@ -5671,7 +5715,11 @@ top: rzio = zio_read(pio, spa, bp, hdr->b_l1hdr.b_pabd, size, arc_read_done, hdr, priority, zio_flags, zb); + acb->acb_zio_head = rzio; + if (hash_lock != NULL) + mutex_exit(hash_lock); + if (*arc_flags & ARC_FLAG_WAIT) return (zio_wait(rzio)); @@ -6162,9 +6210,9 @@ arc_write_done(zio_t *zio) zio_t * arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, - boolean_t l2arc, const zio_prop_t *zp, arc_done_func_t *ready, - arc_done_func_t *children_ready, arc_done_func_t *physdone, - arc_done_func_t *done, void *private, zio_priority_t priority, + boolean_t l2arc, const zio_prop_t *zp, arc_write_done_func_t *ready, + arc_write_done_func_t *children_ready, arc_write_done_func_t *physdone, + arc_write_done_func_t *done, void *private, zio_priority_t priority, int zio_flags, const zbookmark_phys_t *zb) { arc_buf_hdr_t *hdr = buf->b_hdr; @@ -6590,9 +6638,6 @@ arc_init(void) mutex_init(&arc_dnlc_evicts_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arc_dnlc_evicts_cv, NULL, CV_DEFAULT, NULL); - - /* Convert seconds to clock ticks */ - arc_min_prefetch_lifespan = 1 * hz; /* set min cache to 1/32 of all memory, or arc_abs_min, whichever is more */ arc_c_min = MAX(allmem / 32, arc_abs_min); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jun 8 17:38:28 2018 (r334844) @@ -902,7 +902,8 @@ dbuf_whichblock(dnode_t *dn, int64_t level, uint64_t o } static void -dbuf_read_done(zio_t *zio, arc_buf_t *buf, void *vdb) +dbuf_read_done(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, + arc_buf_t *buf, void *vdb) { dmu_buf_impl_t *db = vdb; @@ -916,19 +917,22 @@ dbuf_read_done(zio_t *zio, arc_buf_t *buf, void *vdb) ASSERT(db->db.db_data == NULL); if (db->db_level == 0 && db->db_freed_in_flight) { /* we were freed in flight; disregard any error */ + if (buf == NULL) { + buf = arc_alloc_buf(db->db_objset->os_spa, + db, DBUF_GET_BUFC_TYPE(db), db->db.db_size); + } arc_release(buf, db); bzero(buf->b_data, db->db.db_size); arc_buf_freeze(buf); db->db_freed_in_flight = FALSE; dbuf_set_data(db, buf); db->db_state = DB_CACHED; - } else if (zio == NULL || zio->io_error == 0) { + } else if (buf != NULL) { dbuf_set_data(db, buf); db->db_state = DB_CACHED; } else { ASSERT(db->db_blkid != DMU_BONUS_BLKID); ASSERT3P(db->db_buf, ==, NULL); - arc_buf_destroy(buf, db); db->db_state = DB_UNCACHED; } cv_broadcast(&db->db_changed); @@ -2326,7 +2330,8 @@ dbuf_issue_final_prefetch(dbuf_prefetch_arg_t *dpa, bl * prefetch if the next block down is our target. */ static void -dbuf_prefetch_indirect_done(zio_t *zio, arc_buf_t *abuf, void *private) +dbuf_prefetch_indirect_done(zio_t *zio, const zbookmark_phys_t *zb, + const blkptr_t *iobp, arc_buf_t *abuf, void *private) { dbuf_prefetch_arg_t *dpa = private; @@ -2365,13 +2370,18 @@ dbuf_prefetch_indirect_done(zio_t *zio, arc_buf_t *abu dbuf_rele(db, FTAG); } + if (abuf == NULL) { + kmem_free(dpa, sizeof(*dpa)); + return; + } + dpa->dpa_curlevel--; uint64_t nextblkid = dpa->dpa_zb.zb_blkid >> (dpa->dpa_epbs * (dpa->dpa_curlevel - dpa->dpa_zb.zb_level)); blkptr_t *bp = ((blkptr_t *)abuf->b_data) + P2PHASE(nextblkid, 1ULL << dpa->dpa_epbs); - if (BP_IS_HOLE(bp) || (zio != NULL && zio->io_error != 0)) { + if (BP_IS_HOLE(bp)) { kmem_free(dpa, sizeof (*dpa)); } else if (dpa->dpa_curlevel == dpa->dpa_zb.zb_level) { ASSERT3U(nextblkid, ==, dpa->dpa_zb.zb_blkid); @@ -3746,7 +3756,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, d * ready callback so that we can properly handle an indirect * block that only contains holes. */ - arc_done_func_t *children_ready_cb = NULL; + arc_write_done_func_t *children_ready_cb = NULL; if (db->db_level != 0) children_ready_cb = dbuf_write_children_ready; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Jun 8 17:38:28 2018 (r334844) @@ -1112,14 +1112,26 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, uint64_t txg) void ddt_sync(spa_t *spa, uint64_t txg) { + dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; dmu_tx_t *tx; - zio_t *rio = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_SELF_HEAL); + zio_t *rio; ASSERT(spa_syncing_txg(spa) == txg); tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg); + rio = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_SELF_HEAL); + + /* + * This function may cause an immediate scan of ddt blocks (see + * the comment above dsl_scan_ddt() for details). We set the + * scan's root zio here so that we can wait for any scan IOs in + * addition to the regular ddt IOs. + */ + ASSERT3P(scn->scn_zio_root, ==, NULL); + scn->scn_zio_root = rio; + for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) { ddt_t *ddt = spa->spa_ddt[c]; if (ddt == NULL) @@ -1129,6 +1141,7 @@ ddt_sync(spa_t *spa, uint64_t txg) } (void) zio_wait(rio); + scn->scn_zio_root = NULL; dmu_tx_commit(tx); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Jun 8 17:38:28 2018 (r334844) @@ -349,6 +349,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, bl ASSERT(ds == NULL || MUTEX_HELD(&ds->ds_opening_lock)); +#if 0 /* * The $ORIGIN dataset (if it exists) doesn't have an associated * objset, so there's no reason to open it. The $ORIGIN dataset @@ -359,6 +360,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, bl ASSERT3P(ds->ds_dir, !=, spa_get_dsl(spa)->dp_origin_snap->ds_dir); } +#endif os = kmem_zalloc(sizeof (objset_t), KM_SLEEP); os->os_dsl_dataset = ds; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Fri Jun 8 17:38:28 2018 (r334844) @@ -499,8 +499,9 @@ traverse_prefetcher(spa_t *spa, zilog_t *zilog, const const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { prefetch_data_t *pfd = arg; - arc_flags_t aflags = ARC_FLAG_NOWAIT | ARC_FLAG_PREFETCH; - + arc_flags_t aflags = ARC_FLAG_NOWAIT | ARC_FLAG_PREFETCH | + ARC_FLAG_PRESCIENT_PREFETCH; + ASSERT(pfd->pd_bytes_fetched >= 0); if (bp == NULL) return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Jun 8 17:37:49 2018 (r334843) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Jun 8 17:38:28 2018 (r334844) @@ -51,28 +51,136 @@ #include #include #include +#include #ifdef _KERNEL #include #endif +/* + * Grand theory statement on scan queue sorting + * + * Scanning is implemented by recursively traversing all indirection levels + * in an object and reading all blocks referenced from said objects. This + * results in us approximately traversing the object from lowest logical + * offset to the highest. For best performance, we would want the logical + * blocks to be physically contiguous. However, this is frequently not the + * case with pools given the allocation patterns of copy-on-write filesystems. + * So instead, we put the I/Os into a reordering queue and issue them in a + * way that will most benefit physical disks (LBA-order). + * + * Queue management: + * + * Ideally, we would want to scan all metadata and queue up all block I/O + * prior to starting to issue it, because that allows us to do an optimal + * sorting job. This can however consume large amounts of memory. Therefore + * we continuously monitor the size of the queues and constrain them to 5% + * (zfs_scan_mem_lim_fact) of physmem. If the queues grow larger than this + * limit, we clear out a few of the largest extents at the head of the queues + * to make room for more scanning. Hopefully, these extents will be fairly + * large and contiguous, allowing us to approach sequential I/O throughput + * even without a fully sorted tree. + * + * Metadata scanning takes place in dsl_scan_visit(), which is called from + * dsl_scan_sync() every spa_sync(). If we have either fully scanned all + * metadata on the pool, or we need to make room in memory because our + * queues are too large, dsl_scan_visit() is postponed and + * scan_io_queues_run() is called from dsl_scan_sync() instead. This implies + * that metadata scanning and queued I/O issuing are mutually exclusive. This + * allows us to provide maximum sequential I/O throughput for the majority of + * I/O's issued since sequential I/O performance is significantly negatively + * impacted if it is interleaved with random I/O. + * + * Implementation Notes + * + * One side effect of the queued scanning algorithm is that the scanning code + * needs to be notified whenever a block is freed. This is needed to allow + * the scanning code to remove these I/Os from the issuing queue. Additionally, + * we do not attempt to queue gang blocks to be issued sequentially since this + * is very hard to do and would have an extremely limitted performance benefit. + * Instead, we simply issue gang I/Os as soon as we find them using the legacy + * algorithm. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jun 8 17:41:50 2018 Return-Path: Delivered-To: svn-src-head@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 AAE3210203C6; Fri, 8 Jun 2018 17:41:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5226CA5A; Fri, 8 Jun 2018 17:41:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E79C12358; Fri, 8 Jun 2018 17:41:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58HfoNF099073; Fri, 8 Jun 2018 17:41:50 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58HfnS5099069; Fri, 8 Jun 2018 17:41:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081741.w58HfnS5099069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 17:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334845 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:41:50 -0000 Author: mmacy Date: Fri Jun 8 17:41:49 2018 New Revision: 334845 URL: https://svnweb.freebsd.org/changeset/base/334845 Log: hwpmc: update files missed by r334827 Modified: head/sys/dev/hwpmc/hwpmc_e500.c head/sys/dev/hwpmc/hwpmc_mips.c head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_ppc970.c Modified: head/sys/dev/hwpmc/hwpmc_e500.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_e500.c Fri Jun 8 17:38:28 2018 (r334844) +++ head/sys/dev/hwpmc/hwpmc_e500.c Fri Jun 8 17:41:49 2018 (r334845) @@ -565,13 +565,14 @@ e500_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -e500_intr(int cpu, struct trapframe *tf) +e500_intr(struct trapframe *tf) { - int i, error, retval; + int i, error, retval, cpu; uint32_t config; struct pmc *pm; struct powerpc_cpu *pac; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); @@ -607,8 +608,7 @@ e500_intr(int cpu, struct trapframe *tf) continue; /* Stop the counter if logging fails. */ - error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, - TRAPF_USERMODE(tf)); + error = pmc_process_interrupt(PMC_HR, pm, tf); if (error != 0) e500_stop_pmc(cpu, i); Modified: head/sys/dev/hwpmc/hwpmc_mips.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips.c Fri Jun 8 17:38:28 2018 (r334844) +++ head/sys/dev/hwpmc/hwpmc_mips.c Fri Jun 8 17:41:49 2018 (r334845) @@ -252,15 +252,16 @@ mips_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -mips_pmc_intr(int cpu, struct trapframe *tf) +mips_pmc_intr(struct trapframe *tf) { int error; - int retval, ri; + int retval, ri, cpu; struct pmc *pm; struct mips_cpu *pc; uint32_t r0, r2; pmc_value_t r; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[mips,%d] CPU %d out of range", __LINE__, cpu)); Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Jun 8 17:38:28 2018 (r334844) +++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Jun 8 17:41:49 2018 (r334845) @@ -660,13 +660,14 @@ mpc7xxx_release_pmc(int cpu, int ri, struct pmc *pmc) } static int -mpc7xxx_intr(int cpu, struct trapframe *tf) +mpc7xxx_intr(struct trapframe *tf) { - int i, error, retval; + int i, error, retval, cpu; uint32_t config; struct pmc *pm; struct powerpc_cpu *pac; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); Modified: head/sys/dev/hwpmc/hwpmc_ppc970.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Jun 8 17:38:28 2018 (r334844) +++ head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Jun 8 17:41:49 2018 (r334845) @@ -479,13 +479,14 @@ ppc970_write_pmc(int cpu, int ri, pmc_value_t v) } static int -ppc970_intr(int cpu, struct trapframe *tf) +ppc970_intr(struct trapframe *tf) { struct pmc *pm; struct powerpc_cpu *pac; uint32_t config; - int i, error, retval; + int i, error, retval, cpu; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); From owner-svn-src-head@freebsd.org Fri Jun 8 17:42:16 2018 Return-Path: Delivered-To: svn-src-head@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 E251010204FA; Fri, 8 Jun 2018 17:42:15 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 7AC076CBE3; Fri, 8 Jun 2018 17:42:15 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D64AC260B57; Fri, 8 Jun 2018 19:42:07 +0200 (CEST) Subject: Re: svn commit: r334777 - head/sys/compat/linuxkpi/common/include/linux To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806071141.w57BfhEe076323@repo.freebsd.org> <1528476680.53315.3.camel@freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 8 Jun 2018 19:41:53 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1528476680.53315.3.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:42:16 -0000 On 06/08/18 18:51, Ian Lepore wrote: > Will this be a problem on i386, where timespec contains a 32-bit > time_t?  I think it's the only remaining arch with 32-bit time_t. The LinuxKPI has no need for 64-bit time. These defines are currently only used for debug printouts in drm-next-kmod. --HPS From owner-svn-src-head@freebsd.org Fri Jun 8 17:55:07 2018 Return-Path: Delivered-To: svn-src-head@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 45FA21020767; Fri, 8 Jun 2018 17:55:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF2BF6D157; Fri, 8 Jun 2018 17:55:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D023012623; Fri, 8 Jun 2018 17:55:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Ht63t005054; Fri, 8 Jun 2018 17:55:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Ht66c005053; Fri, 8 Jun 2018 17:55:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806081755.w58Ht66c005053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 8 Jun 2018 17:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334846 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 334846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 17:55:07 -0000 Author: markj Date: Fri Jun 8 17:55:06 2018 New Revision: 334846 URL: https://svnweb.freebsd.org/changeset/base/334846 Log: Correct the list of supported drivers. - bnxt(4) is supported via iflib. - mlx4en(4) support has not yet been committed. Modified: head/share/man/man4/netdump.4 Modified: head/share/man/man4/netdump.4 ============================================================================== --- head/share/man/man4/netdump.4 Fri Jun 8 17:41:49 2018 (r334845) +++ head/share/man/man4/netdump.4 Fri Jun 8 17:55:06 2018 (r334846) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2018 +.Dd June 8, 2018 .Dt NETDUMP 4 .Os .Sh NAME @@ -99,12 +99,12 @@ message to the server. The following network drivers support netdump: .Xr alc 4 , .Xr bge 4 , +.Xr bnxt 4 , .Xr bxe 4 , .Xr cxgb 4 , .Xr em 4 , .Xr igb 4 , .Xr ix 4 , -.Xr mlx4en 4 , .Xr re 4 , .Xr vtnet 4 . .Sh SYSCTL VARIABLES From owner-svn-src-head@freebsd.org Fri Jun 8 18:09:21 2018 Return-Path: Delivered-To: svn-src-head@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 068B710209E2; Fri, 8 Jun 2018 18:09:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C6A86D6F4; Fri, 8 Jun 2018 18:09:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E33A127BB; Fri, 8 Jun 2018 18:09:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58I9KLY010005; Fri, 8 Jun 2018 18:09:20 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58I9KvV010004; Fri, 8 Jun 2018 18:09:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081809.w58I9KvV010004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 18:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334847 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:09:21 -0000 Author: mmacy Date: Fri Jun 8 18:09:19 2018 New Revision: 334847 URL: https://svnweb.freebsd.org/changeset/base/334847 Log: hwpmc: retire never completed xscale support hwpmc xscale support is not actually functional and the architecture is well past its shelf life. Deleted: head/sys/dev/hwpmc/hwpmc_xscale.c From owner-svn-src-head@freebsd.org Fri Jun 8 18:15:24 2018 Return-Path: Delivered-To: svn-src-head@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 CBAE61020E28; Fri, 8 Jun 2018 18:15:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9986DC5C; Fri, 8 Jun 2018 18:15:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2E81294C; Fri, 8 Jun 2018 18:15:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58IFOAu014691; Fri, 8 Jun 2018 18:15:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58IFN23014690; Fri, 8 Jun 2018 18:15:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201806081815.w58IFN23014690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 Jun 2018 18:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334848 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-SVN-Commit-Revision: 334848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:15:25 -0000 Author: adrian Date: Fri Jun 8 18:15:23 2018 New Revision: 334848 URL: https://svnweb.freebsd.org/changeset/base/334848 Log: [ath_hal] Don't do ANI processing if we've reset. If we've reset then we can't trust the current state of the ANI tracking, so just wait until next time. Tested: * AR5424, STA mode (2GHz) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jun 8 18:09:19 2018 (r334847) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jun 8 18:15:23 2018 (r334848) @@ -1000,6 +1000,9 @@ ar5212AniPoll(struct ath_hal *ah, const struct ieee802 ahp->ah_stats.ast_ani_lneg++; /* restart ANI period if listenTime is invalid */ ar5212AniRestart(ah, aniState); + + /* Don't do any further ANI processing here */ + return; } /* XXX beware of overflow? */ aniState->listenTime += listenTime; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jun 8 18:09:19 2018 (r334847) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jun 8 18:15:23 2018 (r334848) @@ -950,6 +950,9 @@ ar5416AniPoll(struct ath_hal *ah, const struct ieee802 HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid listenTime\n", __func__); ar5416AniRestart(ah, aniState); + + /* Don't do any further processing */ + return; } /* XXX beware of overflow? */ aniState->listenTime += listenTime; From owner-svn-src-head@freebsd.org Fri Jun 8 18:21:58 2018 Return-Path: Delivered-To: svn-src-head@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 C1BF5FD00E3; Fri, 8 Jun 2018 18:21:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE616E08A; Fri, 8 Jun 2018 18:21:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EDF212AC8; Fri, 8 Jun 2018 18:21:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58ILwjT017703; Fri, 8 Jun 2018 18:21:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58ILvBn017699; Fri, 8 Jun 2018 18:21:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201806081821.w58ILvBn017699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 Jun 2018 18:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334849 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal/ar5416 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal/ar5416 X-SVN-Commit-Revision: 334849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:21:59 -0000 Author: adrian Date: Fri Jun 8 18:21:57 2018 New Revision: 334849 URL: https://svnweb.freebsd.org/changeset/base/334849 Log: [ath_hal] Return failure if noise floor calibration fails. If we fail noise floor calibration then we may end up with a deaf NIC which we can't recover without a full chip reset. Earlier chips seem to get less stuck in this condition versus AR9280/later and AR9300/later, but whilst here just fix up the AR5212 era chips to also return NF calibration failures. This HAL routine would only return failure if the channel was not configured. This is a no-op until the driver side code for doing resets and the HAL code for being told about the reset type (and then handling it!) is implemented. Tested: * AR9280, STA mode * AR2425, STA mode * AR9380, STA mode Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Fri Jun 8 18:15:23 2018 (r334848) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Fri Jun 8 18:21:57 2018 (r334849) @@ -1188,6 +1188,15 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ cck_phy_err_cnt - ani_state->cck_phy_err_count; ani_state->cck_phy_err_count = cck_phy_err_cnt; + /* + * Note - the ANI code is using the aggregate listen time. + * The AR_PHY_CNT1/AR_PHY_CNT2 registers here are also + * free running, not clear-on-read and are free-running. + * + * So, ofdm_phy_err_rate / cck_phy_err_rate are accumulating + * the same as listenTime is accumulating. + */ + #if HAL_ANI_DEBUG HALDEBUG(ah, HAL_DEBUG_ANI, "%s: Errors: OFDM=0x%08x-0x0=%d CCK=0x%08x-0x0=%d\n", Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Jun 8 18:15:23 2018 (r334848) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Fri Jun 8 18:21:57 2018 (r334849) @@ -704,11 +704,16 @@ ar9300_proc_rx_desc_freebsd(struct ath_hal *ah, struct (void *) ds)); } +/* + * This is the primary way the ANI code gets the node statistics per packet. + */ void ar9300_ani_rxmonitor_freebsd(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan) { + struct ath_hal_9300 *ahp = AH9300(ah); + ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi; } void Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Jun 8 18:15:23 2018 (r334848) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Jun 8 18:21:57 2018 (r334849) @@ -2493,15 +2493,23 @@ ar9300_calibration(struct ath_hal *ah, struct ieee8021 chan->ic_state &= ~IEEE80211_CHANSTATE_CWINT; if (nf_done) { + int ret; /* * Load the NF from history buffer of the current channel. * NF is slow time-variant, so it is OK to use a historical value. */ ar9300_get_nf_hist_base(ah, ichan, is_scan, nf_buf); - ar9300_load_nf(ah, nf_buf); - + + ret = ar9300_load_nf(ah, nf_buf); /* start NF calibration, without updating BB NF register*/ - ar9300_start_nf_cal(ah); + ar9300_start_nf_cal(ah); + + /* + * If we failed the NF cal then tell the upper layer that we + * failed so we can do a full reset + */ + if (! ret) + return AH_FALSE; } } return AH_TRUE; @@ -4479,6 +4487,7 @@ First_NFCal(struct ath_hal *ah, HAL_CHANNEL_INTERNAL * ar9300_reset_nf_hist_buff(ah, ichan); ar9300_get_nf_hist_base(ah, ichan, is_scan, nf_buf); ar9300_load_nf(ah, nf_buf); + /* XXX TODO: handle failure from load_nf */ stats = 0; } else { stats = 1; @@ -5303,6 +5312,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, st /* XXX FreeBSD is ichan appropariate? It was curchan.. */ ar9300_get_nf_hist_base(ah, ichan, is_scan, nf_buf); ar9300_load_nf(ah, nf_buf); + /* XXX TODO: handle NF load failure */ if (nf_hist_buff_reset == 1) { nf_hist_buff_reset = 0; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jun 8 18:15:23 2018 (r334848) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jun 8 18:21:57 2018 (r334849) @@ -36,7 +36,7 @@ #define NUM_NOISEFLOOR_READINGS 6 /* 3 chains * (ctl + ext) */ static void ar5416StartNFCal(struct ath_hal *ah); -static void ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *); +static HAL_BOOL ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *); static int16_t ar5416GetNf(struct ath_hal *, struct ieee80211_channel *); static uint16_t ar5416GetDefaultNF(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -513,6 +513,7 @@ ar5416PerCalibrationN(struct ath_hal *ah, struct ieee8 HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: NF calibration" " didn't finish; delaying CCA\n", __func__); } else { + int ret; /* * NF calibration result is valid. * @@ -520,10 +521,17 @@ ar5416PerCalibrationN(struct ath_hal *ah, struct ieee8 * NF is slow time-variant, so it is OK to use a * historical value. */ - ar5416LoadNF(ah, AH_PRIVATE(ah)->ah_curchan); + ret = ar5416LoadNF(ah, AH_PRIVATE(ah)->ah_curchan); /* start NF calibration, without updating BB NF register*/ ar5416StartNFCal(ah); + + /* + * If we failed calibration then tell the driver + * we failed and it should do a full chip reset + */ + if (! ret) + return AH_FALSE; } } return AH_TRUE; @@ -578,7 +586,7 @@ ar5416StartNFCal(struct ath_hal *ah) OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); } -static void +static HAL_BOOL ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *chan) { static const uint32_t ar5416_cca_regs[] = { @@ -657,7 +665,7 @@ ar5416LoadNF(struct ath_hal *ah, const struct ieee8021 HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "Timeout while waiting for " "nf to load: AR_PHY_AGC_CONTROL=0x%x\n", OS_REG_READ(ah, AR_PHY_AGC_CONTROL)); - return; + return AH_FALSE; } /* @@ -679,6 +687,7 @@ ar5416LoadNF(struct ath_hal *ah, const struct ieee8021 OS_REG_WRITE(ah, ar5416_cca_regs[i], val); } } + return AH_TRUE; } /* From owner-svn-src-head@freebsd.org Fri Jun 8 18:24:47 2018 Return-Path: Delivered-To: svn-src-head@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 71717FD019E; Fri, 8 Jun 2018 18:24:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2071A6E2B6; Fri, 8 Jun 2018 18:24:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 023B112B01; Fri, 8 Jun 2018 18:24:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58IOkPH020261; Fri, 8 Jun 2018 18:24:46 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58IOkgG020260; Fri, 8 Jun 2018 18:24:46 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081824.w58IOkgG020260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 18:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334850 - head/sys/arm/xscale/ixp425 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/arm/xscale/ixp425 X-SVN-Commit-Revision: 334850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:24:47 -0000 Author: mmacy Date: Fri Jun 8 18:24:46 2018 New Revision: 334850 URL: https://svnweb.freebsd.org/changeset/base/334850 Log: hwpmc: remove hwpmc_xscale.c from corresponding arm build Modified: head/sys/arm/xscale/ixp425/files.ixp425 Modified: head/sys/arm/xscale/ixp425/files.ixp425 ============================================================================== --- head/sys/arm/xscale/ixp425/files.ixp425 Fri Jun 8 18:21:57 2018 (r334849) +++ head/sys/arm/xscale/ixp425/files.ixp425 Fri Jun 8 18:24:46 2018 (r334850) @@ -13,7 +13,6 @@ arm/xscale/ixp425/uart_bus_ixp425.c optional uart arm/xscale/ixp425/ixp425_a4x_space.c optional uart arm/xscale/ixp425/ixp425_a4x_io.S optional uart dev/cfi/cfi_bus_ixp4xx.c optional cfi -dev/hwpmc/hwpmc_xscale.c optional hwpmc dev/uart/uart_dev_ns8250.c optional uart # # NPE-based Ethernet support (requires qmgr also). From owner-svn-src-head@freebsd.org Fri Jun 8 18:30:26 2018 Return-Path: Delivered-To: svn-src-head@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 E5B05FD03B6; Fri, 8 Jun 2018 18:30:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (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 7EDDA6E526; Fri, 8 Jun 2018 18:30:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x242.google.com with SMTP id u4-v6so3522746itg.0; Fri, 08 Jun 2018 11:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OBUycBvq5IIeXbDY2myqnOGNf6ptjGXn38taexhEZVw=; b=h5uhzTm4JudcGMPm/30MIbvyZE9lmaLG+YuED1BTSYl7Xwn/Z0J0Z2UUoMoJ026YuU FBT5KF/ifFBYOnnMLpFhWkuDrVUsygqTG2r20YUJScN/3fg8Tqu0lPwl3YegkVFnPtaG OFLJW2RCbpSwIs45EWQhVdeDMzHVpBNm5RvyM93w3HLEP0EQS1JFPee88vRy4p9oq3vx ni424dUl4KxzTEE+ZgqC9lXsSfRXJACkmgjhPutorTq/0t3eeZXDKrZypOvyZQ4hHAJJ iJVVKWy+X26RL+2tJB+aKGMocjJcNqAJfCmNOkGtRq+8QWNXkiM+vpLf81Tdr6BIhR8f 5vvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=OBUycBvq5IIeXbDY2myqnOGNf6ptjGXn38taexhEZVw=; b=Ww60yoN53uI4QtyF11ERTaEHghVy1QTnErMXGrwxG9N0Hyl/yXfFS4f3s5ta0vG/+W i0Ti/nzsottxeHoOEQTRzyTu7UBxR8MzXi21KDzxt6M+equNmIgj0uIP9VOq3wIrQPDF 4L4d+FOBUzZRYqqbB8n4VlIIzHh9joOZDzm6krfJjcCizpI6OhPyQKr7XzhM94taU4Ef WJ1ClPhbKRQDoKAJuOUZEt8hdIl1jQiH4O4Xr5aQ5WUPlKhpmb0H/fIfMvOtWQvS3P6O 1AquG/LXV98RVp+7mvRMn6+K/+Rv5S15GBgEYZr83OD0cGH+gMbrPui8MCvEtDC3dAK3 bLKA== X-Gm-Message-State: APt69E3n6A/hB0lM2YlaawPIwzMjs/HJyoJLlZhySwcEorh8/RpElyK2 7BpXRcT8z/glgsOnQFidydQ= X-Google-Smtp-Source: ADUXVKKFHRVt/iZxgxpY8LIqc6hFAL5Ln8bDyMgQZbtZed+gnuuiWKa58kr7B9UDHbaEDCSwa2tLNA== X-Received: by 2002:a24:28c9:: with SMTP id h192-v6mr2789714ith.124.1528482624810; Fri, 08 Jun 2018 11:30:24 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id h68-v6sm1075525ith.28.2018.06.08.11.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 11:30:23 -0700 (PDT) Sender: Mark Johnston Date: Fri, 8 Jun 2018 14:30:10 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Ryan Libby , Mateusz Guzik , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180608183010.GC65388@pesky> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> <20180608173755.GJ2450@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180608173755.GJ2450@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:30:26 -0000 On Fri, Jun 08, 2018 at 08:37:55PM +0300, Konstantin Belousov wrote: > On Thu, Jun 07, 2018 at 11:02:29PM -0700, Ryan Libby wrote: > > On Thu, Jun 7, 2018 at 10:03 PM, Mateusz Guzik wrote: > > > Checking it without any locks is perfectly valid in this case. It is done > > > after v_holdcnt gets bumped from a non-zero value. So at that time it > > > is at least two. Of course that result is stale as an arbitrary number of > > > other threads could have bumped and dropped the ref past that point. > > > The minimum value is 1 since we hold the ref. But this means the > > > vnode must not be on the free list and that's what the assertion is > > > verifying. > > > > > > The problem is indeed lack of ordering against the code clearing the > > > flag for the case where 2 threads to vhold and one does the 0->1 > > > transition. > > > > > > That said, the fence is required for the assertion to work. > > > > > > > Yeah, I agree with this logic. What I mean is that reordering between > > v_holdcnt 0->1 and v_iflag is normally settled by the release and > > acquisition of the vnode interlock, which we are supposed to hold for > > v_*i*flag. A quick scan seems to show all of the checks of VI_FREE that > > are not asserts do hold the vnode interlock. So, I'm just saying that I > > don't think the possible reordering affects them. > But do we know that only VI_FREE checks are affected ? > > My concern is that users of _vhold() rely on seeing up to date state of the > vnode, and VI_FREE is only an example of the problem. Most likely, the > code which fetched the vnode pointer before _vhold() call, should guarantee > visibility. Wouldn't this be a problem only if we permit lockless accesses of vnode state outside of _vhold() and other vnode subroutines? The current protocol requires that the interlock be held, and this synchronizes with code which performs 0->1 and 1->0 transitions of the hold count. If this requirement is relaxed in the future, then fences would indeed be needed. From owner-svn-src-head@freebsd.org Fri Jun 8 18:32:27 2018 Return-Path: Delivered-To: svn-src-head@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 A344DFD05E5; Fri, 8 Jun 2018 18:32:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 553596E8F8; Fri, 8 Jun 2018 18:32:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37C1812C8C; Fri, 8 Jun 2018 18:32:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58IWRB9024946; Fri, 8 Jun 2018 18:32:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58IWRth024945; Fri, 8 Jun 2018 18:32:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806081832.w58IWRth024945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Jun 2018 18:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334851 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 334851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:32:27 -0000 Author: kib Date: Fri Jun 8 18:32:26 2018 New Revision: 334851 URL: https://svnweb.freebsd.org/changeset/base/334851 Log: Restore release semantic for the old thread unlock on arm64. With the introduction of pmap_switch(), the DSB instruction on the address map switch is not necessary executed, which is fixed by changing the unlock store to release. Also remove comment which documented pre-pmap_switch() code. Reviewed by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Fri Jun 8 18:24:46 2018 (r334850) +++ head/sys/arm64/arm64/swtch.S Fri Jun 8 18:32:26 2018 (r334851) @@ -165,10 +165,9 @@ ENTRY(cpu_switch) mov x0, x19 /* - * Release the old thread. This doesn't need to be a store-release - * as the above dsb instruction will provide release semantics. + * Release the old thread. */ - str x2, [x0, #TD_LOCK] + stlr x2, [x0, #TD_LOCK] #if defined(SCHED_ULE) && defined(SMP) /* Spin if TD_LOCK points to a blocked_lock */ ldr x2, =_C_LABEL(blocked_lock) From owner-svn-src-head@freebsd.org Fri Jun 8 18:37:48 2018 Return-Path: Delivered-To: svn-src-head@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 10EA1FD06DF; Fri, 8 Jun 2018 18:37:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 7D7066EAFF; Fri, 8 Jun 2018 18:37:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTP id w58IbWct027129; Fri, 8 Jun 2018 21:37:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w58IbWct027129 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w58IbWwv027128; Fri, 8 Jun 2018 21:37:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 8 Jun 2018 21:37:32 +0300 From: Konstantin Belousov To: Mark Johnston Cc: Ryan Libby , Mateusz Guzik , Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180608183732.GK2450@kib.kiev.ua> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> <20180608173755.GJ2450@kib.kiev.ua> <20180608183010.GC65388@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180608183010.GC65388@pesky> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:37:48 -0000 On Fri, Jun 08, 2018 at 02:30:10PM -0400, Mark Johnston wrote: > On Fri, Jun 08, 2018 at 08:37:55PM +0300, Konstantin Belousov wrote: > > On Thu, Jun 07, 2018 at 11:02:29PM -0700, Ryan Libby wrote: > > > On Thu, Jun 7, 2018 at 10:03 PM, Mateusz Guzik wrote: > > > > Checking it without any locks is perfectly valid in this case. It is done > > > > after v_holdcnt gets bumped from a non-zero value. So at that time it > > > > is at least two. Of course that result is stale as an arbitrary number of > > > > other threads could have bumped and dropped the ref past that point. > > > > The minimum value is 1 since we hold the ref. But this means the > > > > vnode must not be on the free list and that's what the assertion is > > > > verifying. > > > > > > > > The problem is indeed lack of ordering against the code clearing the > > > > flag for the case where 2 threads to vhold and one does the 0->1 > > > > transition. > > > > > > > > That said, the fence is required for the assertion to work. > > > > > > > > > > Yeah, I agree with this logic. What I mean is that reordering between > > > v_holdcnt 0->1 and v_iflag is normally settled by the release and > > > acquisition of the vnode interlock, which we are supposed to hold for > > > v_*i*flag. A quick scan seems to show all of the checks of VI_FREE that > > > are not asserts do hold the vnode interlock. So, I'm just saying that I > > > don't think the possible reordering affects them. > > But do we know that only VI_FREE checks are affected ? > > > > My concern is that users of _vhold() rely on seeing up to date state of the > > vnode, and VI_FREE is only an example of the problem. Most likely, the > > code which fetched the vnode pointer before _vhold() call, should guarantee > > visibility. > > Wouldn't this be a problem only if we permit lockless accesses of vnode > state outside of _vhold() and other vnode subroutines? The current > protocol requires that the interlock be held, and this synchronizes with > code which performs 0->1 and 1->0 transitions of the hold count. If this > requirement is relaxed in the future, then fences would indeed be > needed. I do not claim that my concern is a real problem. I stated it as a thing to look at when deciding whether the fences should be added (unconditionally ?). If you argument is that the only current lock-less protocol for the struct vnode state is the v_holdcnt transitions for > 1, then I can agree with it. From owner-svn-src-head@freebsd.org Fri Jun 8 18:54:48 2018 Return-Path: Delivered-To: svn-src-head@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 3FB98FD0BD1; Fri, 8 Jun 2018 18:54:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E65106F473; Fri, 8 Jun 2018 18:54:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C149612FFB; Fri, 8 Jun 2018 18:54:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58IslvM035312; Fri, 8 Jun 2018 18:54:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Islga035311; Fri, 8 Jun 2018 18:54:47 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806081854.w58Islga035311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 18:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334852 - head/sys/mips/atheros X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/mips/atheros X-SVN-Commit-Revision: 334852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 18:54:48 -0000 Author: mmacy Date: Fri Jun 8 18:54:47 2018 New Revision: 334852 URL: https://svnweb.freebsd.org/changeset/base/334852 Log: hwpmc: yet another missed fixup Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Fri Jun 8 18:32:26 2018 (r334851) +++ head/sys/mips/atheros/apb.c Fri Jun 8 18:54:47 2018 (r334852) @@ -388,7 +388,7 @@ apb_filter(void *arg) tf = td->td_intr_frame; if (pmc_intr) - (*pmc_intr)(PCPU_GET(tf); + (*pmc_intr)(tf); continue; } /* Ignore timer interrupts */ From owner-svn-src-head@freebsd.org Fri Jun 8 19:11:05 2018 Return-Path: Delivered-To: svn-src-head@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 F41EAFD3050; Fri, 8 Jun 2018 19:11:04 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD7E86FBCD; Fri, 8 Jun 2018 19:11:04 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1403) id A5CB21BC7D; Fri, 8 Jun 2018 19:11:04 +0000 (UTC) Date: Fri, 8 Jun 2018 21:11:04 +0200 From: "Piotr P. Stefaniak" To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334817 - in head/usr.sbin/cron: cron crontab lib Message-ID: <20180608191104.GA88867@freefall.freebsd.org> References: <201806072238.w57Mcehx011811@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <201806072238.w57Mcehx011811@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 19:11:05 -0000 On 2018-06-07 22:38:40, Gleb Smirnoff wrote: >Author: glebius >Date: Thu Jun 7 22:38:40 2018 >New Revision: 334817 >URL: https://svnweb.freebsd.org/changeset/base/334817 > >Log: > Add new functionality and syntax to cron(1) to allow to run jobs at a > given interval, which is counted in seconds since exit of the previous > invocation of the job. Example user crontab entry: > > @25 sleep 10 > > The example will launch 'sleep 10' every 35 seconds. This is a rather > useless example above, but clearly explains the functionality. > > The practical goal here is to avoid overlap of previous job invocation > to a new one, or to avoid too short interval(s) for jobs that last long > and doesn't have any point of immediate launch soon after previous run. > > Another useful effect of interval jobs can be noticed when a cluster of > machines periodically communicates with a single node. Running the task > time based creates too much load on the node. Running interval based > spreads invocations across machines in cluster. Note that -j/-J won't > help in this case. > > Sponsored by: Netflix Missing a Relnotes tag, possibly. From owner-svn-src-head@freebsd.org Fri Jun 8 19:35:26 2018 Return-Path: Delivered-To: svn-src-head@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 2A163FD3BFD; Fri, 8 Jun 2018 19:35:26 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAEB370A4F; Fri, 8 Jun 2018 19:35:25 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADB591366F; Fri, 8 Jun 2018 19:35:25 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58JZPCH055586; Fri, 8 Jun 2018 19:35:25 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58JZPLM055582; Fri, 8 Jun 2018 19:35:25 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806081935.w58JZPLM055582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 8 Jun 2018 19:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334853 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 334853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 19:35:26 -0000 Author: jtl Date: Fri Jun 8 19:35:24 2018 New Revision: 334853 URL: https://svnweb.freebsd.org/changeset/base/334853 Log: Add a socket destructor callback. This allows kernel providers to set callbacks to perform additional cleanup actions at the time a socket is closed. Michio Honda presented a use for this at BSDCan 2018. (See https://www.bsdcan.org/2018/schedule/events/965.en.html .) Submitted by: Michio Honda (previous version) Reviewed by: lstewart (previous version) Differential Revision: https://reviews.freebsd.org/D15706 Modified: head/share/man/man9/socket.9 head/sys/kern/uipc_socket.c head/sys/sys/socketvar.h Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Fri Jun 8 18:54:47 2018 (r334852) +++ head/share/man/man9/socket.9 Fri Jun 8 19:35:24 2018 (r334853) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2014 +.Dd June 8, 2018 .Dt SOCKET 9 .Os .Sh NAME @@ -54,6 +54,11 @@ .Fc .Ft int .Fn sodisconnect "struct socket *so" +.Ft void +.Fo sodtor_set +.Fa "struct socket *so" +.Fa "void (*func)(struct socket *)" +.Fc .Ft struct sockaddr * .Fn sodupsockaddr "const struct sockaddr *sa" "int mflags" .Ft void @@ -369,6 +374,13 @@ be cleared, with .Dv SO_RCV or .Dv SO_SND . +.Ss Socket Destructor Callback +A kernel system can use the +.Fn sodtor_set +function to set a destructor for a socket. +The destructor is called when the socket is closed. +The destructor is called after the protocol close routine has completed. +The destructor can serve as a callback to initiate additional cleanup actions. .Ss Socket I/O The .Fn soreceive Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jun 8 18:54:47 2018 (r334852) +++ head/sys/kern/uipc_socket.c Fri Jun 8 19:35:24 2018 (r334853) @@ -1101,6 +1101,8 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + if (so->so_dtor != NULL) + so->so_dtor(so); SOCK_LOCK(so); if ((listening = (so->so_options & SO_ACCEPTCONN))) { @@ -3810,6 +3812,17 @@ sodupsockaddr(const struct sockaddr *sa, int mflags) if (sa2) bcopy(sa, sa2, sa->sa_len); return sa2; +} + +/* + * Register per-socket destructor. + */ +void +sodtor_set(struct socket *so, so_dtor_t *func) +{ + + SOCK_LOCK_ASSERT(so); + so->so_dtor = func; } /* Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Fri Jun 8 18:54:47 2018 (r334852) +++ head/sys/sys/socketvar.h Fri Jun 8 19:35:24 2018 (r334853) @@ -63,6 +63,7 @@ struct vnet; * private data and error information. */ typedef int so_upcall_t(struct socket *, void *, int); +typedef void so_dtor_t(struct socket *); struct socket; @@ -99,6 +100,7 @@ struct socket { /* NB: generation count must not be first. */ so_gen_t so_gencnt; /* (h) generation count */ void *so_emuldata; /* (b) private data for emulators */ + so_dtor_t *so_dtor; /* (b) optional destructor */ struct osd osd; /* Object Specific extensions */ /* * so_fibnum, so_user_cookie and friends can be used to attach @@ -397,6 +399,7 @@ int soconnect2(struct socket *so1, struct socket *so2) int socreate(int dom, struct socket **aso, int type, int proto, struct ucred *cred, struct thread *td); int sodisconnect(struct socket *so); +void sodtor_set(struct socket *, so_dtor_t *); struct sockaddr *sodupsockaddr(const struct sockaddr *sa, int mflags); void sofree(struct socket *so); void sohasoutofband(struct socket *so); From owner-svn-src-head@freebsd.org Fri Jun 8 19:47:05 2018 Return-Path: Delivered-To: svn-src-head@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 4B74BFD420F; Fri, 8 Jun 2018 19:47:05 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E324F71238; Fri, 8 Jun 2018 19:47:04 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFEAE1386A; Fri, 8 Jun 2018 19:47:04 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Jl472060777; Fri, 8 Jun 2018 19:47:04 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Jl4SP060776; Fri, 8 Jun 2018 19:47:04 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201806081947.w58Jl4SP060776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 8 Jun 2018 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334854 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 334854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 19:47:05 -0000 Author: jtl Date: Fri Jun 8 19:47:04 2018 New Revision: 334854 URL: https://svnweb.freebsd.org/changeset/base/334854 Log: Create a symlink for sodtor_set(9) to the socket(9) man page. Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jun 8 19:35:24 2018 (r334853) +++ head/share/man/man9/Makefile Fri Jun 8 19:47:04 2018 (r334854) @@ -1895,6 +1895,7 @@ MLINKS+=socket.9 soabort.9 \ socket.9 soconnect.9 \ socket.9 socreate.9 \ socket.9 sodisconnect.9 \ + socket.9 sodtor_set.9 \ socket.9 sodupsockaddr.9 \ socket.9 sofree.9 \ socket.9 sogetopt.9 \ From owner-svn-src-head@freebsd.org Fri Jun 8 20:32:00 2018 Return-Path: Delivered-To: svn-src-head@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 C6867FD50E8; Fri, 8 Jun 2018 20:32:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75F68726C2; Fri, 8 Jun 2018 20:32:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 556A914035; Fri, 8 Jun 2018 20:32:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58KW090084690; Fri, 8 Jun 2018 20:32:00 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58KW0Ie084689; Fri, 8 Jun 2018 20:32:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806082032.w58KW0Ie084689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 20:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334855 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 20:32:01 -0000 Author: mmacy Date: Fri Jun 8 20:31:59 2018 New Revision: 334855 URL: https://svnweb.freebsd.org/changeset/base/334855 Log: AF_UNIX: bring uipc_ready in compliance with new locking protocol PR: 228742 Submitted by: markj Reviewed by: markj Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jun 8 19:47:04 2018 (r334854) +++ head/sys/kern/uipc_usrreq.c Fri Jun 8 20:31:59 2018 (r334855) @@ -1262,14 +1262,21 @@ uipc_ready(struct socket *so, struct mbuf *m, int coun unp = sotounpcb(so); - UNP_LINK_RLOCK(); + UNP_PCB_LOCK(unp); if ((unp2 = unp->unp_conn) == NULL) { - UNP_LINK_RUNLOCK(); - for (int i = 0; i < count; i++) - m = m_free(m); - return (ECONNRESET); + UNP_PCB_UNLOCK(unp); + goto error; } - UNP_PCB_LOCK(unp2); + if (unp != unp2) { + if (UNP_PCB_TRYLOCK(unp2) == 0) { + unp_pcb_hold(unp2); + UNP_PCB_UNLOCK(unp); + UNP_PCB_LOCK(unp2); + if (unp_pcb_rele(unp2)) + goto error; + } else + UNP_PCB_UNLOCK(unp); + } so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_rcv); @@ -1279,9 +1286,12 @@ uipc_ready(struct socket *so, struct mbuf *m, int coun SOCKBUF_UNLOCK(&so2->so_rcv); UNP_PCB_UNLOCK(unp2); - UNP_LINK_RUNLOCK(); return (error); + error: + for (int i = 0; i < count; i++) + m = m_free(m); + return (ECONNRESET); } static int From owner-svn-src-head@freebsd.org Fri Jun 8 20:35:59 2018 Return-Path: Delivered-To: svn-src-head@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 B83B7FD534A; Fri, 8 Jun 2018 20:35:59 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DC6372932; Fri, 8 Jun 2018 20:35:59 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FEBF14060; Fri, 8 Jun 2018 20:35:59 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58KZx9r085838; Fri, 8 Jun 2018 20:35:59 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58KZxmA085837; Fri, 8 Jun 2018 20:35:59 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201806082035.w58KZxmA085837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Fri, 8 Jun 2018 20:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334856 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 334856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 20:35:59 -0000 Author: tychon Date: Fri Jun 8 20:35:58 2018 New Revision: 334856 URL: https://svnweb.freebsd.org/changeset/base/334856 Log: Don't bother looking for non-executable pages when a process is excluded from PTI. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15708 Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Jun 8 20:31:59 2018 (r334855) +++ head/sys/amd64/amd64/trap.c Fri Jun 8 20:35:58 2018 (r334856) @@ -770,7 +770,8 @@ trap_pfault(struct trapframe *frame, int usermode) * If nx protection of the usermode portion of kernel page * tables caused trap, panic. */ - if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | + if (PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && usermode && + pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)== (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK)) From owner-svn-src-head@freebsd.org Fri Jun 8 20:39:50 2018 Return-Path: Delivered-To: svn-src-head@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 4890CFD551A; Fri, 8 Jun 2018 20:39:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE6A572AE8; Fri, 8 Jun 2018 20:39:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7E3414064; Fri, 8 Jun 2018 20:39:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58KdneL086000; Fri, 8 Jun 2018 20:39:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Kdnc4085999; Fri, 8 Jun 2018 20:39:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806082039.w58Kdnc4085999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 8 Jun 2018 20:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334857 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 334857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 20:39:50 -0000 Author: mmacy Date: Fri Jun 8 20:39:49 2018 New Revision: 334857 URL: https://svnweb.freebsd.org/changeset/base/334857 Log: hwpmc: remove dangling references to hwpmc_xscale Reported by: mjg Modified: head/sys/dev/hwpmc/hwpmc_arm.c Modified: head/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm.c Fri Jun 8 20:35:58 2018 (r334856) +++ head/sys/dev/hwpmc/hwpmc_arm.c Fri Jun 8 20:39:49 2018 (r334857) @@ -58,10 +58,6 @@ __FBSDID("$FreeBSD$"); struct pmc_mdep * pmc_md_initialize() { -#ifdef CPU_XSCALE_IXP425 - if (cpu_class == CPU_CLASS_XSCALE) - return pmc_xscale_initialize(); -#endif #ifdef CPU_CORTEXA if (cpu_class == CPU_CLASS_CORTEXA) return pmc_armv7_initialize(); @@ -72,13 +68,6 @@ pmc_md_initialize() void pmc_md_finalize(struct pmc_mdep *md) { -#ifdef CPU_XSCALE_IXP425 - if (cpu_class == CPU_CLASS_XSCALE) - pmc_xscale_finalize(md); - else - KASSERT(0, ("[arm,%d] Unknown CPU Class 0x%x", __LINE__, - cpu_class)); -#endif #ifdef CPU_CORTEXA if (cpu_class == CPU_CLASS_CORTEXA) pmc_armv7_finalize(md); From owner-svn-src-head@freebsd.org Fri Jun 8 21:40:05 2018 Return-Path: Delivered-To: svn-src-head@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 5E6A9FDB0F0; Fri, 8 Jun 2018 21:40:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0318A73F36; Fri, 8 Jun 2018 21:40:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3C61149FC; Fri, 8 Jun 2018 21:40:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58Le4e3015846; Fri, 8 Jun 2018 21:40:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58Le4Vf015842; Fri, 8 Jun 2018 21:40:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806082140.w58Le4Vf015842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 21:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334858 - in head/sys: netipsec netpfil/ipfw vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: netipsec netpfil/ipfw vm X-SVN-Commit-Revision: 334858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 21:40:05 -0000 Author: mjg Date: Fri Jun 8 21:40:03 2018 New Revision: 334858 URL: https://svnweb.freebsd.org/changeset/base/334858 Log: uma: implement provisional api for per-cpu zones Per-cpu zone allocations are very rarely done compared to regular zones. The intent is to avoid pessimizing the latter case with per-cpu specific code. In particular contrary to the claim in r334824, M_ZERO is sometimes being used for such zones. But the zeroing method is completely different and braching on it in the fast path for regular zones is a waste of time. Modified: head/sys/netipsec/key.c head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Jun 8 20:39:49 2018 (r334857) +++ head/sys/netipsec/key.c Fri Jun 8 21:40:03 2018 (r334858) @@ -2957,7 +2957,7 @@ key_newsav(const struct sadb_msghdr *mhp, struct secas goto done; } mtx_init(sav->lock, "ipsec association", NULL, MTX_DEF); - sav->lft_c = uma_zalloc(V_key_lft_zone, M_NOWAIT); + sav->lft_c = uma_zalloc_pcpu(V_key_lft_zone, M_NOWAIT); if (sav->lft_c == NULL) { *errp = ENOBUFS; goto done; @@ -3049,7 +3049,7 @@ done: free(sav->lock, M_IPSEC_MISC); } if (sav->lft_c != NULL) - uma_zfree(V_key_lft_zone, sav->lft_c); + uma_zfree_pcpu(V_key_lft_zone, sav->lft_c); free(sav, M_IPSEC_SA), sav = NULL; } if (sah != NULL) Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Jun 8 20:39:49 2018 (r334857) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri Jun 8 21:40:03 2018 (r334858) @@ -208,7 +208,7 @@ ipfw_alloc_rule(struct ip_fw_chain *chain, size_t rule struct ip_fw *rule; rule = malloc(rulesize, M_IPFW, M_WAITOK | M_ZERO); - rule->cntr = uma_zalloc(V_ipfw_cntr_zone, M_WAITOK | M_ZERO); + rule->cntr = uma_zalloc_pcpu(V_ipfw_cntr_zone, M_WAITOK | M_ZERO); return (rule); } @@ -217,7 +217,7 @@ static void free_rule(struct ip_fw *rule) { - uma_zfree(V_ipfw_cntr_zone, rule->cntr); + uma_zfree_pcpu(V_ipfw_cntr_zone, rule->cntr); free(rule, M_IPFW); } Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Fri Jun 8 20:39:49 2018 (r334857) +++ head/sys/vm/uma.h Fri Jun 8 21:40:03 2018 (r334858) @@ -333,6 +333,7 @@ void uma_zdestroy(uma_zone_t zone); */ void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); +void *uma_zalloc_pcpu_arg(uma_zone_t zone, void *arg, int flags); /* * Allocate an item from a specific NUMA domain. This uses a slow path in @@ -354,6 +355,7 @@ void *uma_zalloc_domain(uma_zone_t zone, void *arg, in * */ static __inline void *uma_zalloc(uma_zone_t zone, int flags); +static __inline void *uma_zalloc_pcpu(uma_zone_t zone, int flags); static __inline void * uma_zalloc(uma_zone_t zone, int flags) @@ -361,6 +363,12 @@ uma_zalloc(uma_zone_t zone, int flags) return uma_zalloc_arg(zone, NULL, flags); } +static __inline void * +uma_zalloc_pcpu(uma_zone_t zone, int flags) +{ + return uma_zalloc_pcpu_arg(zone, NULL, flags); +} + /* * Frees an item back into the specified zone. * @@ -374,6 +382,7 @@ uma_zalloc(uma_zone_t zone, int flags) */ void uma_zfree_arg(uma_zone_t zone, void *item, void *arg); +void uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void *arg); /* * Frees an item back to the specified zone's domain specific pool. @@ -392,11 +401,18 @@ void uma_zfree_domain(uma_zone_t zone, void *item, voi * */ static __inline void uma_zfree(uma_zone_t zone, void *item); +static __inline void uma_zfree_pcpu(uma_zone_t zone, void *item); static __inline void uma_zfree(uma_zone_t zone, void *item) { uma_zfree_arg(zone, item, NULL); +} + +static __inline void +uma_zfree_pcpu(uma_zone_t zone, void *item) +{ + uma_zfree_pcpu_arg(zone, item, NULL); } /* Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 8 20:39:49 2018 (r334857) +++ head/sys/vm/uma_core.c Fri Jun 8 21:40:03 2018 (r334858) @@ -2230,6 +2230,32 @@ uma_zwait(uma_zone_t zone) uma_zfree(zone, item); } +void * +uma_zalloc_pcpu_arg(uma_zone_t zone, void *udata, int flags) +{ + void *item; + int i; + + MPASS(zone->uz_flags & UMA_ZONE_PCPU); + item = uma_zalloc_arg(zone, udata, flags &~ M_ZERO); + if (item != NULL && (flags & M_ZERO)) { + CPU_FOREACH(i) + bzero(zpcpu_get_cpu(item, i), zone->uz_size); + } + return (item); +} + +/* + * A stub while both regular and pcpu cases are identical. + */ +void +uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void *udata) +{ + + MPASS(zone->uz_flags & UMA_ZONE_PCPU); + uma_zfree_arg(zone, item, udata); +} + /* See uma.h */ void * uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) From owner-svn-src-head@freebsd.org Fri Jun 8 21:49:20 2018 Return-Path: Delivered-To: svn-src-head@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 90CE4FDBA70; Fri, 8 Jun 2018 21:49:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3569874929; Fri, 8 Jun 2018 21:49:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14D8B14B8B; Fri, 8 Jun 2018 21:49:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58LnJT6021083; Fri, 8 Jun 2018 21:49:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58LnJmx021082; Fri, 8 Jun 2018 21:49:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201806082149.w58LnJmx021082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 8 Jun 2018 21:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334862 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 334862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 21:49:20 -0000 Author: shurd Date: Fri Jun 8 21:49:19 2018 New Revision: 334862 URL: https://svnweb.freebsd.org/changeset/base/334862 Log: Remove tx task spinning added in r333686 This caused issues with PASTE. Just remove the reschedule since the DELAY() should be enough for use cases such as pkt-gen which were failing before the change. Reported by: Michio Honda Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Jun 8 21:47:17 2018 (r334861) +++ head/sys/net/iflib.c Fri Jun 8 21:49:19 2018 (r334862) @@ -3728,16 +3728,6 @@ _task_fn_tx(void *context) */ if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); - else { -#ifdef DEV_NETMAP - if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { - struct netmap_kring *kring = NA(ctx->ifc_ifp)->tx_rings[txq->ift_id]; - - if (kring->nr_hwtail != nm_prev(kring->rhead, kring->nkr_num_slots - 1)) - GROUPTASK_ENQUEUE(&txq->ift_task); - } -#endif - } IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; } From owner-svn-src-head@freebsd.org Fri Jun 8 22:06:33 2018 Return-Path: Delivered-To: svn-src-head@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 76952FDBECF; Fri, 8 Jun 2018 22:06:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28BD1750D7; Fri, 8 Jun 2018 22:06:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0954514EBC; Fri, 8 Jun 2018 22:06:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58M6Wao030989; Fri, 8 Jun 2018 22:06:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58M6WsF030988; Fri, 8 Jun 2018 22:06:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201806082206.w58M6WsF030988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Jun 2018 22:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334863 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 334863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 22:06:33 -0000 Author: mjg Date: Fri Jun 8 22:06:32 2018 New Revision: 334863 URL: https://svnweb.freebsd.org/changeset/base/334863 Log: counter: add a bit missed in r334858 It happens to be a noop. Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Jun 8 21:49:19 2018 (r334862) +++ head/sys/kern/subr_counter.c Fri Jun 8 22:06:32 2018 (r334863) @@ -62,7 +62,7 @@ counter_u64_alloc(int flags) { counter_u64_t r; - r = uma_zalloc(pcpu_zone_64, flags & ~M_ZERO); + r = uma_zalloc_pcpu(pcpu_zone_64, flags); if (r != NULL) counter_u64_zero(r); @@ -73,7 +73,7 @@ void counter_u64_free(counter_u64_t c) { - uma_zfree(pcpu_zone_64, c); + uma_zfree_pcpu(pcpu_zone_64, c); } int From owner-svn-src-head@freebsd.org Fri Jun 8 22:59:12 2018 Return-Path: Delivered-To: svn-src-head@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 C7606FDCE30 for ; Fri, 8 Jun 2018 22:59:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (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 5156476475 for ; Fri, 8 Jun 2018 22:59:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x232.google.com with SMTP id p129-v6so4624892ywg.7 for ; Fri, 08 Jun 2018 15:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=F9XC8BB5SCTXytYK7Wz3mFes/LTBPbeA71bvpajG+BA=; b=Z4F2DZOrbbpaRBPZPnPGo9fEWPKwZTCcWcKoZwvm98/bP4kqZJuGY5Cy31kz9C/MAW OxrZ5r/mrzTHF8g9VzktKZK9dgDGt4Gc4hlTBF500YA3xP1gans8o2amc4TxJ2Dkibxp NqGdRwuLldQy4KxGSg0nL4Y+KGcJrr76kUehA= 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=F9XC8BB5SCTXytYK7Wz3mFes/LTBPbeA71bvpajG+BA=; b=HIdmqB2o88VnCfXv5vjS5enm5BSGudecna4DYzfyVmykrUb931a6FKO1xhcn81id1U sVJ/2gmsgbnnxcxi3R+DXZOvtkK+cgmKjYxF3Z0idbJ83msIXIrbq94/bdq6YkwxsQ9q l95iNpIhRuP6Uv+GXNJYHMmZi8d2Os798SwGhHXEwl9GKjfuNsWroa5fnAqLCYQDQ5vd 7UjjAork1fN+sm/uz25V0yPt7CsWgfwplF6AooClQRRqF9hOOVr5EA765l0PBf2Mvyn7 KvRqojSuZ8dxfJ4GUticFhjvBykZ4ZObtETlzpYIJy7lJvW7PiQLRO1eSZhFaEXPZd1O OZpA== X-Gm-Message-State: APt69E0YptAtF1kgnm6KKt1WiGBkiDQ1FIPRl5GgqaI0L2BnLHi2hJ6o +X2+BBIjjNXEG3I1Q8XbTqjcpHLCpp4aC3rzVsw/TQ== X-Google-Smtp-Source: ADUXVKK23emKB3yTYOqOhOvHS7ykDbcIbaT6zDLz2j9omYrpB6XkGETPa3IUOFP5inkkGDOwFfFkJOH3sqk3a8lyDyE= X-Received: by 2002:a81:2c56:: with SMTP id s83-v6mr4703817yws.387.1528498751488; Fri, 08 Jun 2018 15:59:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 15:58:40 -0700 (PDT) In-Reply-To: <201806071836.w57IaCQw090029@repo.freebsd.org> References: <201806071836.w57IaCQw090029@repo.freebsd.org> From: Eitan Adler Date: Fri, 8 Jun 2018 15:58:40 -0700 Message-ID: Subject: Re: svn commit: r334807 - head/usr.bin/grep To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 22:59:13 -0000 On 7 June 2018 at 11:36, Kyle Evans wrote: > Author: kevans > Date: Thu Jun 7 18:36:12 2018 > New Revision: 334807 > URL: https://svnweb.freebsd.org/changeset/base/334807 > > Log: > bsdgrep(1): whoops, garbage collect the now write-only variable Picking a random email to respond to: thanks for your work on grep! It's nice to have someone working on it :) -- Eitan Adler From owner-svn-src-head@freebsd.org Fri Jun 8 23:58:59 2018 Return-Path: Delivered-To: svn-src-head@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 AEC0EFDDE39; Fri, 8 Jun 2018 23:58:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3783377AB0; Fri, 8 Jun 2018 23:58:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w55MqFDP001459 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Jun 2018 15:52:16 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w55MqF2B001458; Tue, 5 Jun 2018 15:52:15 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Jun 2018 15:52:15 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: Eric van Gyzen , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys Message-ID: <20180605225215.GC1005@FreeBSD.org> References: <201806022220.w52MK9TT026244@repo.freebsd.org> <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 23:58:59 -0000 On Tue, Jun 05, 2018 at 06:35:37PM +0200, Mateusz Guzik wrote: M> > On 06/02/2018 17:20, Mateusz Guzik wrote: M> > > +#ifdef _KERNEL M> > > +#define malloc(size, type, flags) ({ \ M> > > + void *_malloc_item; \ M> > > + size_t _size = (size); \ M> > > + if (__builtin_constant_p(size) && __builtin_constant_p(flags) &&\ M> > > + ((flags) & M_ZERO)) { \ M> > > + _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ M> > > + if (((flags) & M_WAITOK) || _malloc_item != NULL) \ M> > > + bzero(_malloc_item, _size); \ M> > > + } else { \ M> > > + _malloc_item = malloc(_size, type, flags); \ M> > > + } \ M> > > + _malloc_item; \ M> > > +}) M> > > +#endif M> > M> > Mateusz, M> > M> > Thank you for this and for all of your performance work. It is all very M> > interesting stuff. M> > M> > M> Thank you for the kind words. It is positive feedback like this which M> keeps me going! Btw, what was the point of checking flags || result? Most places in kernel ignore flags and just test result regerdless of M_WAITOK/M_NOWAIT. The result is already in a register, why do you think checking for absense of M_WAITOK is faster that checking for !NULL _malloc_item? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Fri Jun 8 23:58:59 2018 Return-Path: Delivered-To: svn-src-head@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 33B95FDDE31; Fri, 8 Jun 2018 23:58:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 65B3A77AAF; Fri, 8 Jun 2018 23:58:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w55N2Gp4001530 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Jun 2018 16:02:16 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w55N2GUD001529; Tue, 5 Jun 2018 16:02:16 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Jun 2018 16:02:16 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: Eric van Gyzen , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334545 - in head/sys: contrib/zstd/lib/freebsd kern netinet/libalias sys Message-ID: <20180605230216.GD1005@FreeBSD.org> References: <201806022220.w52MK9TT026244@repo.freebsd.org> <1b77e282-e24b-d14c-9811-4cf214d58280@vangyzen.net> <20180605225215.GC1005@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 23:58:59 -0000 On Wed, Jun 06, 2018 at 12:56:47AM +0200, Mateusz Guzik wrote: M> > M> Thank you for the kind words. It is positive feedback like this which M> > M> keeps me going! M> > M> > Btw, what was the point of checking flags || result? Most places in kernel M> > ignore flags and just test result regerdless of M_WAITOK/M_NOWAIT. M> > M> > The result is already in a register, why do you think checking for absense M> > of M_WAITOK is faster that checking for !NULL _malloc_item? M> > M> M> This part is only reachable if flags are known at compilation time. If they M> contain M> M_WAITOK, the flag check will get elided along (we know for a fact it M> passes) M> and subsequently the NULL check will be short circuited, iow for known M> M_WAITOK|M_ZERO flags this is: M> M> _malloc_item = malloc(_size, type, flags & ~ M_ZERO); M> bzero(_malloc_item, _size); Thanks a lot for explanation! -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Sat Jun 9 00:26:17 2018 Return-Path: Delivered-To: svn-src-head@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 9B465FE3A06; Sat, 9 Jun 2018 00:26:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BE297935C; Sat, 9 Jun 2018 00:26:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w58IGglL017967 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jun 2018 11:16:42 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w58IGgne017966; Fri, 8 Jun 2018 11:16:42 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jun 2018 11:16:42 -0700 From: Gleb Smirnoff To: Kubilay Kocak Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334819 - head/sys/vm Message-ID: <20180608181641.GN1005@FreeBSD.org> References: <201806080015.w580F8fM062154@repo.freebsd.org> <77e67765-4244-e207-ff8d-aa6156c985b8@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <77e67765-4244-e207-ff8d-aa6156c985b8@FreeBSD.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 00:26:17 -0000 On Fri, Jun 08, 2018 at 03:07:07PM +1000, Kubilay Kocak wrote: K> > UMA memory debugging enabled with INVARIANTS consists of two things: K> > trashing freed memory and checking that allocated memory is properly K> > trashed, and also of keeping a bitset of freed items. Trashing/checking K> > creates a lot of CPU cache poisoning, while keeping debugging bitsets K> > consistent creates a lot of contention on UMA zone lock(s). The performance K> > difference between INVARIANTS kernel and normal one is mostly attributed K> > to UMA debugging, rather than to all KASSERT checks in the kernel. K> > K> > Add loader tunable vm.debug.divisor that allows either to turn off UMA K> K> Is 'sample interval' a standard/common enough term for this kind of K> mechanism to name the sysctl with it rather than the implementation? K> K> Or 'sample frequency' Interval definitely doesn't fit here. Frequency is closer, but still not the right term, IMHO. Native speaker required here to judge. I am okay if anyone who is confident changes wording here. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Sat Jun 9 00:26:17 2018 Return-Path: Delivered-To: svn-src-head@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 3886FFE39FB; Sat, 9 Jun 2018 00:26:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B881F7935B; Sat, 9 Jun 2018 00:26:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w58Lpcao019050 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jun 2018 14:51:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w58LpcmT019049; Fri, 8 Jun 2018 14:51:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jun 2018 14:51:38 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334824 - head/sys/vm Message-ID: <20180608215138.GQ1005@FreeBSD.org> References: <201806080316.w583GHp7054103@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806080316.w583GHp7054103@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 00:26:17 -0000 On Fri, Jun 08, 2018 at 03:16:17AM +0000, Mateusz Guzik wrote: M> Author: mjg M> Date: Fri Jun 8 03:16:16 2018 M> New Revision: 334824 M> URL: https://svnweb.freebsd.org/changeset/base/334824 M> M> Log: M> uma: remove M_ZERO support for pcpu zones M> M> Nothing in the tree uses it and pcpu zones have a fundamentally different use M> case than the regular zones - they are not supposed to be allocated and freed M> all the time. M> M> This reduces pollution in the allocation fast path. Now counter(9) is broken and r334830 doesn't yet fix the problem. This won't happen if commit was reviewed. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Sat Jun 9 02:18:16 2018 Return-Path: Delivered-To: svn-src-head@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 C364CFF3204; Sat, 9 Jun 2018 02:18:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 609EA7E413; Sat, 9 Jun 2018 02:18:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41D46178D3; Sat, 9 Jun 2018 02:18:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592IG1a056782; Sat, 9 Jun 2018 02:18:16 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592IGOE056781; Sat, 9 Jun 2018 02:18:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090218.w592IGOE056781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 02:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334866 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:18:16 -0000 Author: eadler Date: Sat Jun 9 02:18:15 2018 New Revision: 334866 URL: https://svnweb.freebsd.org/changeset/base/334866 Log: top(1): actually make change for tid vs pid Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 9 02:15:45 2018 (r334865) +++ head/usr.bin/top/machine.c Sat Jun 9 02:18:15 2018 (r334866) @@ -98,7 +98,6 @@ static const char smp_header_thr_and_pid[] = " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; static const char smp_header_tid_only[] = " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; - static const char smp_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; @@ -106,7 +105,6 @@ static char up_header_thr_and_pid[] = " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_header_tid_only[] = " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; - static char up_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; @@ -1131,7 +1129,7 @@ format_next_process(void* xhandle, char *(*get_userid) (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); snprintf(fmt, sizeof(fmt), proc_fmt, - (ps.thread) ? pp->ki_tid : pp->ki_pid, + (ps.thread_id) ? pp->ki_tid : pp->ki_pid, jidlength, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), thr_buf, From owner-svn-src-head@freebsd.org Sat Jun 9 02:19:26 2018 Return-Path: Delivered-To: svn-src-head@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 712B2FF3310 for ; Sat, 9 Jun 2018 02:19:26 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E8487E560 for ; Sat, 9 Jun 2018 02:19:26 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.161.179]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id DCEC61D09B for ; Sat, 9 Jun 2018 02:19:25 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f179.google.com with SMTP id v197-v6so4713970ywc.13 for ; Fri, 08 Jun 2018 19:19:25 -0700 (PDT) X-Gm-Message-State: APt69E0k81CxNMqagRHv0epqfjFNwU4Hdx5MAuMu4N0gL+/tjK3yPWYD ReQZ4zn0FO4KUaLaylwa7zeV1fcJomhmRLU8Wt6/og== X-Google-Smtp-Source: ADUXVKLQAYwsRyZbtTSMkxouqaRt7uHy4apRLIXrQ/Z18kBndvBAKnemDddeRg/JFPiGh+Un1HEhI/HUbN7AnUr9tTQ= X-Received: by 2002:a81:6d52:: with SMTP id i79-v6mr4922091ywc.141.1528510765472; Fri, 08 Jun 2018 19:19:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 19:18:54 -0700 (PDT) In-Reply-To: References: <201806010551.w515pfoB090926@repo.freebsd.org> <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> <20180604112919.GA8618@mail.smeets.xyz> From: Eitan Adler Date: Fri, 8 Jun 2018 19:18:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334474 - head/usr.bin/top To: Florian Smeets Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:19:26 -0000 On 8 June 2018 at 19:14, Eitan Adler wrote: > On 4 June 2018 at 04:29, Florian Smeets wrote: >> On Mon, Jun 04, 2018 at 03:42:40AM -0700, Eitan Adler wrote: >>> On 3 June 2018 at 22:45, Baptiste Daroussin wrote: >>> >> Hi, >>> >> >>> > IMHO showing TIDs should >>> >> be a separate flag, 'h' maybe, as this commit changes current/expected >>> >> behavior (POLA?). >>> >>> Its a reasonable idea to split this out into a separate flag. I'll do that. >>> >> >> Ok, thanks. > > r334864 ... and r334866 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 02:14:36 2018 Return-Path: Delivered-To: svn-src-head@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 E4D0CFF2A86; Sat, 9 Jun 2018 02:14:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD0B7DE06; Sat, 9 Jun 2018 02:14:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BE4B178AB; Sat, 9 Jun 2018 02:14:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592EZcr056432; Sat, 9 Jun 2018 02:14:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592EYsJ056425; Sat, 9 Jun 2018 02:14:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090214.w592EYsJ056425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 02:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334864 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:14:36 -0000 Author: eadler Date: Sat Jun 9 02:14:33 2018 New Revision: 334864 URL: https://svnweb.freebsd.org/changeset/base/334864 Log: top(1): use a different command to toggle tid vs pid - By popular demand, implement a different switch ("T") for toggling between thread id and process id. - Add an assert that the size of command chars is as expected. - Also clean up some messiness I found when implementing this. - Further document the new flag. Requested by: flo, ronald-lists@klop.ws, bapt PR: 139389 (for the record) X-MFC-With: r334474 Modified: head/usr.bin/top/commands.c head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.1 head/usr.bin/top/top.c head/usr.bin/top/top.h Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/commands.c Sat Jun 9 02:14:33 2018 (r334864) @@ -99,6 +99,7 @@ r - renice a process\n\ s - change number of seconds to delay between updates\n\ S - toggle the displaying of system processes\n\ a - toggle the displaying of process titles\n\ +T - toggle the displaying of thread IDs\n\ t - toggle the display of this process\n\ u - display processes for only one user (+ selects all users)\n\ w - toggle the display of swap use for each process\n\ Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/machine.c Sat Jun 9 02:14:33 2018 (r334864) @@ -433,8 +433,8 @@ format_header(const char *uname_field) * separate lines). */ prehead = smpmode ? - (ps.thread ? smp_header_tid_only : smp_header_thr_and_pid) : - (ps.thread ? up_header_tid_only : up_header_thr_and_pid); + (ps.thread_id ? smp_header_tid_only : smp_header_thr_and_pid) : + (ps.thread_id ? up_header_tid_only : up_header_thr_and_pid); snprintf(Header, sizeof(Header), prehead, jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field, @@ -828,7 +828,7 @@ get_process_info(struct system_info *si, struct proces /* not in use */ continue; - if (sel->self != -1 && pp->ki_pid == sel->self) + if (!sel->self && pp->ki_pid == mypid) /* skip self */ continue; Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/machine.h Sat Jun 9 02:14:33 2018 (r334864) @@ -58,25 +58,26 @@ struct system_info */ /* - * the process_select struct tells get_process_info what processes we - * are interested in seeing + * the process_select struct tells get_process_info what processes + * and information we are interested in seeing */ struct process_select { - int idle; /* show idle processes */ - int self; /* show self */ - int system; /* show system processes */ - int thread; /* show threads */ + bool idle; /* show idle processes */ + bool self; /* show self */ + bool system; /* show system processes */ + bool thread; /* show threads */ + bool thread_id; /* show thread ids */ #define TOP_MAX_UIDS 8 int uid[TOP_MAX_UIDS]; /* only these uids (unless uid[0] == -1) */ - int wcpu; /* show weighted cpu */ + bool wcpu; /* show weighted cpu */ int jid; /* only this jid (unless jid == -1) */ - int jail; /* show jail ID */ - int swap; /* show swap usage */ - int kidle; /* show per-CPU idle threads */ - pid_t pid; /* only this pid (unless pid == -1) */ - char *command; /* only this command (unless == NULL) */ + bool jail; /* show jail ID */ + bool swap; /* show swap usage */ + bool kidle; /* show per-CPU idle threads */ + int pid; /* only this pid (unless pid == -1) */ + const char *command; /* only this command (unless == NULL) */ }; /* routines defined by the machine dependent module */ Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/top.1 Sat Jun 9 02:14:33 2018 (r334864) @@ -116,6 +116,9 @@ Display the .IR jail (8) ID. .TP +.B \-T +Toggle displaying thread ID (tid) instead of process id (pid). +.TP .B \-t Do not display the .I top @@ -238,6 +241,7 @@ The options .BR \-j , .BR \-P , .BR \-S , +.BR \-T , .BR \-t , .BR \-u , .BR \-w , @@ -342,7 +346,6 @@ command. .TP .B H Toggle the display of threads. -Also toggles the display of PID or TID. .TP .B i (or @@ -362,6 +365,9 @@ This will also enable the display of JID. .TP .B P Toggle the display of per-CPU statistics. +.TP +.B T +Toggle display of TID vs PID .TP .B t Toggle the display of the Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/top.c Sat Jun 9 02:14:33 2018 (r334864) @@ -70,6 +70,7 @@ static int max_topn; /* maximum displayable processes /* miscellaneous things */ struct process_select ps; const char * myname = "top"; +pid_t mypid; /* pointers to display routines */ static void (*d_loadave)(int mpid, double *avenrun) = i_loadave; @@ -230,7 +231,7 @@ main(int argc, char *argv[]) fd_set readfds; char old_system = false; - static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwop"; + static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwopT"; /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 #define CMD_update 1 @@ -261,7 +262,10 @@ main(int argc, char *argv[]) #define CMD_swaptog 25 #define CMD_order 26 #define CMD_pid 27 +#define CMD_toggletid 28 +_Static_assert(sizeof(command_chars) == CMD_toggletid + 2, "command chars size"); + /* set the buffer for stdout */ #ifdef DEBUG extern FILE *debug; @@ -271,7 +275,6 @@ main(int argc, char *argv[]) setbuffer(stdout, stdoutbuf, Buffersize); #endif - /* get our name */ if (argc > 0) { if ((myname = strrchr(argv[0], '/')) == 0) @@ -284,9 +287,12 @@ main(int argc, char *argv[]) } } + mypid = getpid(); + + /* get our name */ /* initialize some selection options */ ps.idle = true; - ps.self = -1; + ps.self = false; ps.system = false; reset_uids(); ps.thread = false; @@ -297,6 +303,7 @@ main(int argc, char *argv[]) ps.kidle = true; ps.pid = -1; ps.command = NULL; + ps.thread_id = false; /* get preset options from the environment */ if ((env_top = getenv("TOP")) != NULL) @@ -437,7 +444,7 @@ main(int argc, char *argv[]) break; case 't': - ps.self = (ps.self == -1) ? getpid() : -1; + ps.self = !ps.self; break; case 'C': @@ -448,6 +455,10 @@ main(int argc, char *argv[]) ps.thread = !ps.thread; break; + case 'T': + ps.thread_id = !ps.thread_id; + break; + case 'j': ps.jail = !ps.jail; break; @@ -712,7 +723,6 @@ restart: new_message(MT_standout, " Write error on stdout"); putchar('\r'); quit(1); - /*NOTREACHED*/ } /* only do the rest if we have more displays to show */ @@ -809,7 +819,7 @@ restart: if (sel_ret > 0) { int newval; - char *errmsg; + const char *errmsg; /* something to read -- clear the message area first */ clear_message(); @@ -822,7 +832,6 @@ restart: new_message(MT_standout, " Read error on stdin"); putchar('\r'); quit(1); - /*NOTREACHED*/ } if ((iptr = strchr(command_chars, ch)) == NULL) { @@ -863,7 +872,6 @@ restart: case CMD_quit: /* quit */ quit(0); - /*NOTREACHED*/ break; case CMD_help1: /* help */ @@ -997,10 +1005,10 @@ restart: break; case CMD_selftog: - ps.self = (ps.self == -1) ? getpid() : -1; + ps.self = !ps.self; new_message(MT_standout | MT_delayed, " %sisplaying self.", - (ps.self == -1) ? "D" : "Not d"); + (ps.self) ? "D" : "Not d"); putchar('\r'); break; @@ -1018,6 +1026,17 @@ restart: reset_display(); putchar('\r'); break; + + case CMD_toggletid: + ps.thread_id = !ps.thread_id; + new_message(MT_standout | MT_delayed, + " Displaying %s", + ps.thread_id ? "tid" : "pid"); + header_text = format_header(uname_field); + reset_display(); + putchar('\r'); + break; + case CMD_wcputog: ps.wcpu = !ps.wcpu; new_message(MT_standout | MT_delayed, @@ -1184,7 +1203,6 @@ restart: fclose(debug); #endif quit(0); - /*NOTREACHED*/ } /* Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Fri Jun 8 22:06:32 2018 (r334863) +++ head/usr.bin/top/top.h Sat Jun 9 02:14:33 2018 (r334864) @@ -10,6 +10,8 @@ #ifndef TOP_H #define TOP_H +#include + #define Default_DELAY 2 /* Number of lines of header information on the standard screen */ @@ -42,8 +44,10 @@ enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX }; extern enum displaymodes displaymode; extern int pcpu_stats; -extern int overstrike; +extern int overstrike; +extern pid_t mypid; + extern const char * myname; extern int (*compares[])(const void*, const void*); @@ -52,9 +56,8 @@ char* kill_procs(char *); char* renice_procs(char *); extern char copyright[]; -/* internal routines */ -void quit(int); +void quit(int); /* * The space command forces an immediate update. Sometimes, on loaded From owner-svn-src-head@freebsd.org Sat Jun 9 02:15:46 2018 Return-Path: Delivered-To: svn-src-head@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 3DFB3FF2B27; Sat, 9 Jun 2018 02:15:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D70007E024; Sat, 9 Jun 2018 02:15:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4BCB178BD; Sat, 9 Jun 2018 02:15:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592FjYc056532; Sat, 9 Jun 2018 02:15:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592FjPF056531; Sat, 9 Jun 2018 02:15:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806090215.w592FjPF056531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 9 Jun 2018 02:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334865 - in head: lib usr.sbin X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib usr.sbin X-SVN-Commit-Revision: 334865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:15:46 -0000 Author: mmacy Date: Sat Jun 9 02:15:45 2018 New Revision: 334865 URL: https://svnweb.freebsd.org/changeset/base/334865 Log: pmc: don't build on riscv where there's no kmod support Modified: head/lib/Makefile head/usr.sbin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Jun 9 02:14:33 2018 (r334864) +++ head/lib/Makefile Sat Jun 9 02:15:45 2018 (r334865) @@ -202,7 +202,7 @@ _libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") SUBDIR.${MK_PMC}+= libpmc libpmcstat .endif SUBDIR.${MK_RADIUS_SUPPORT}+= libradius Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Jun 9 02:14:33 2018 (r334864) +++ head/usr.sbin/Makefile Sat Jun 9 02:15:45 2018 (r334865) @@ -179,7 +179,7 @@ SUBDIR.${MK_OPENSSL}+= keyserv SUBDIR.${MK_PC_SYSINSTALL}+= pc-sysinstall SUBDIR.${MK_PF}+= ftp-proxy SUBDIR.${MK_PKGBOOTSTRAP}+= pkg -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") SUBDIR.${MK_PMC}+= pmc SUBDIR.${MK_PMC}+= pmcannotate SUBDIR.${MK_PMC}+= pmccontrol From owner-svn-src-head@freebsd.org Sat Jun 9 02:15:21 2018 Return-Path: Delivered-To: svn-src-head@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 21477FF2B00 for ; Sat, 9 Jun 2018 02:15:21 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC28B7DF2E for ; Sat, 9 Jun 2018 02:15:20 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f169.google.com (mail-yb0-f169.google.com [209.85.213.169]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 846101D095 for ; Sat, 9 Jun 2018 02:15:20 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f169.google.com with SMTP id f79-v6so5010286ybg.2 for ; Fri, 08 Jun 2018 19:15:20 -0700 (PDT) X-Gm-Message-State: APt69E3Ah+Wc9JdBF3+LZ579l+fhqdwvPwblMcoKtjWynEJm5pcfZHR/ 5K4fnIqZ5MmDwDqfAWXwQJf7St2HWQkmy390yvDAHQ== X-Google-Smtp-Source: ADUXVKLNgWpBMmzeFyTsKdAAKaceJo7yzeH3+TMOrNmNLkIjmM878f0rHN0DkhO8ThR0/359313WGLd5S/FqxXoCH80= X-Received: by 2002:a25:786:: with SMTP id 128-v6mr5216148ybh.338.1528510519914; Fri, 08 Jun 2018 19:15:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:50c9:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 19:14:48 -0700 (PDT) In-Reply-To: <20180604112919.GA8618@mail.smeets.xyz> References: <201806010551.w515pfoB090926@repo.freebsd.org> <20180604054500.zqcnqmyuu6mjxn7t@ivaldir.net> <20180604112919.GA8618@mail.smeets.xyz> From: Eitan Adler Date: Fri, 8 Jun 2018 19:14:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334474 - head/usr.bin/top To: Florian Smeets Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:15:21 -0000 On 4 June 2018 at 04:29, Florian Smeets wrote: > On Mon, Jun 04, 2018 at 03:42:40AM -0700, Eitan Adler wrote: >> On 3 June 2018 at 22:45, Baptiste Daroussin wrote: >> >> Hi, >> >> >> > IMHO showing TIDs should >> >> be a separate flag, 'h' maybe, as this commit changes current/expected >> >> behavior (POLA?). >> >> Its a reasonable idea to split this out into a separate flag. I'll do that. >> > > Ok, thanks. r334864 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 03:08:05 2018 Return-Path: Delivered-To: svn-src-head@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 50244FF57FF; Sat, 9 Jun 2018 03:08:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 048F88054F; Sat, 9 Jun 2018 03:08:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB07B181A6; Sat, 9 Jun 2018 03:08:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59384td082795; Sat, 9 Jun 2018 03:08:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59384e9082794; Sat, 9 Jun 2018 03:08:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090308.w59384e9082794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 03:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334871 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 334871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 03:08:05 -0000 Author: eadler Date: Sat Jun 9 03:08:04 2018 New Revision: 334871 URL: https://svnweb.freebsd.org/changeset/base/334871 Log: LOCKS: update current locks - use a wild card for releng instead of listing them out. This ignores a technicality that re@ owns the branches during release cycles, but this has not been document in this file in a long time (if ever). Approved by: core Modified: head/LOCKS Modified: head/LOCKS ============================================================================== --- head/LOCKS Sat Jun 9 03:01:38 2018 (r334870) +++ head/LOCKS Sat Jun 9 03:08:04 2018 (r334871) @@ -7,11 +7,7 @@ subsystem login expires notes -------------------------------------- Special cases: -releng/4.* Requires Security Officer approval. -releng/5.* Requires Security Officer approval. -releng/6.* Requires Security Officer approval. -releng/7.* Requires Security Officer approval. -releng/8.* Requires Security Officer approval. +releng/* Requires Security Officer approval. head/sys/dev/random Requires Security Officer approval. head/sys/libkern/arc4random.c Requires Security Officer approval. stable/*/sys/dev/random Requires Security Officer approval. From owner-svn-src-head@freebsd.org Sat Jun 9 02:25:19 2018 Return-Path: Delivered-To: svn-src-head@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 67611FF39D1; Sat, 9 Jun 2018 02:25:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DF207EB01; Sat, 9 Jun 2018 02:25:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDECF17A7C; Sat, 9 Jun 2018 02:25:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592PIFE061578; Sat, 9 Jun 2018 02:25:18 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592PIMH061577; Sat, 9 Jun 2018 02:25:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806090225.w592PIMH061577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 9 Jun 2018 02:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334867 - in head: lib usr.sbin X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib usr.sbin X-SVN-Commit-Revision: 334867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:25:19 -0000 Author: mmacy Date: Sat Jun 9 02:25:18 2018 New Revision: 334867 URL: https://svnweb.freebsd.org/changeset/base/334867 Log: pmc: fix logic in skipping riscv Modified: head/lib/Makefile head/usr.sbin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Jun 9 02:18:15 2018 (r334866) +++ head/lib/Makefile Sat Jun 9 02:25:18 2018 (r334867) @@ -202,7 +202,7 @@ _libdl= libdl .endif SUBDIR.${MK_OPENSSL}+= libmp -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv")) SUBDIR.${MK_PMC}+= libpmc libpmcstat .endif SUBDIR.${MK_RADIUS_SUPPORT}+= libradius Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Jun 9 02:18:15 2018 (r334866) +++ head/usr.sbin/Makefile Sat Jun 9 02:25:18 2018 (r334867) @@ -179,7 +179,7 @@ SUBDIR.${MK_OPENSSL}+= keyserv SUBDIR.${MK_PC_SYSINSTALL}+= pc-sysinstall SUBDIR.${MK_PF}+= ftp-proxy SUBDIR.${MK_PKGBOOTSTRAP}+= pkg -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv")) SUBDIR.${MK_PMC}+= pmc SUBDIR.${MK_PMC}+= pmcannotate SUBDIR.${MK_PMC}+= pmccontrol From owner-svn-src-head@freebsd.org Sat Jun 9 02:41:52 2018 Return-Path: Delivered-To: svn-src-head@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 67F43FF44C5; Sat, 9 Jun 2018 02:41:52 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 167A27F429; Sat, 9 Jun 2018 02:41:52 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA4EE17DC1; Sat, 9 Jun 2018 02:41:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592fpwc070737; Sat, 9 Jun 2018 02:41:51 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592fp0S070736; Sat, 9 Jun 2018 02:41:51 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201806090241.w592fp0S070736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 9 Jun 2018 02:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334868 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 334868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:41:52 -0000 Author: sjg Date: Sat Jun 9 02:41:51 2018 New Revision: 334868 URL: https://svnweb.freebsd.org/changeset/base/334868 Log: Add st_mtime, st_ino and st_dev for ufs_stat Differential Revision: D15064 Modified: head/stand/libsa/ufs.c Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Sat Jun 9 02:25:18 2018 (r334867) +++ head/stand/libsa/ufs.c Sat Jun 9 02:41:51 2018 (r334868) @@ -124,6 +124,7 @@ struct file { ufs2_daddr_t f_buf_blkno; /* block number of data block */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ + int f_inumber; /* inumber */ }; #define DIP(fp, field) \ ((fp)->f_fs->fs_magic == FS_UFS1_MAGIC ? \ @@ -190,6 +191,7 @@ read_inode(inumber, f) fp->f_buf_blkno = -1; } fp->f_seekp = 0; + fp->f_inumber = inumber; out: free(buf); return (rc); @@ -836,6 +838,20 @@ ufs_stat(f, sb) sb->st_uid = DIP(fp, di_uid); sb->st_gid = DIP(fp, di_gid); sb->st_size = DIP(fp, di_size); + sb->st_mtime = DIP(fp, di_mtime); + /* + * The items below are ufs specific! + * Other fs types will need their own solution + * if these fields are needed. + */ + sb->st_ino = fp->f_inumber; + /* + * We need something to differentiate devs. + * fs_id is unique but 64bit, we xor the two + * halves to squeeze it into 32bits. + */ + sb->st_dev = (dev_t)(fp->f_fs->fs_id[0] ^ fp->f_fs->fs_id[1]); + return (0); } From owner-svn-src-head@freebsd.org Sat Jun 9 02:47:03 2018 Return-Path: Delivered-To: svn-src-head@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 604D5FF4DD5; Sat, 9 Jun 2018 02:47:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05B797F961; Sat, 9 Jun 2018 02:47:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D610E17E14; Sat, 9 Jun 2018 02:47:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w592l28n071662; Sat, 9 Jun 2018 02:47:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w592l2b2071661; Sat, 9 Jun 2018 02:47:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090247.w592l2b2071661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 02:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334869 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 02:47:03 -0000 Author: eadler Date: Sat Jun 9 02:47:02 2018 New Revision: 334869 URL: https://svnweb.freebsd.org/changeset/base/334869 Log: top(1): correct header, align it. THR is always 6 digits or longer. Now that the PID/THR change is separated, use correct headers. PR: 228823 Reported by: Trond.Endrestol@ximalas.info Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 9 02:41:51 2018 (r334868) +++ head/usr.bin/top/machine.c Sat Jun 9 02:47:02 2018 (r334869) @@ -94,17 +94,20 @@ static const char io_header[] = static const char io_Proc_format[] = "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; +/* XXX: build up header instead of statically defining them. + * This will also allow for a "format string" to be supplied + * as an argument to top(1) instead of having predefined options */ static const char smp_header_thr_and_pid[] = - " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; -static const char smp_header_tid_only[] = - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; + " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; +static const char smp_header_id_only[] = + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; static const char smp_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; static char up_header_thr_and_pid[] = " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; -static char up_header_tid_only[] = - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; +static char up_header_id_only[] = + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; @@ -425,19 +428,31 @@ format_header(const char *uname_field) switch (displaymode) { case DISP_CPU: /* - * The logic of picking the right header format seems reverse - * here because we only want to display a THR column when - * "thread mode" is off (and threads are not listed as - * separate lines). + * The logic of picking the right header is confusing, and + * depends on too much. We should instead have a struct of + * "header name", and "header format" which we build up. + * This would also fix the duplicate of effort into up vs smp + * mode. */ - prehead = smpmode ? - (ps.thread_id ? smp_header_tid_only : smp_header_thr_and_pid) : - (ps.thread_id ? up_header_tid_only : up_header_thr_and_pid); - snprintf(Header, sizeof(Header), prehead, - jidlength, ps.jail ? " JID" : "", - namelength, namelength, uname_field, - swaplength, ps.swap ? " SWAP" : "", - ps.wcpu ? "WCPU" : "CPU"); + if (smpmode) { + prehead = ps.thread ? + smp_header_id_only : smp_header_thr_and_pid; + snprintf(Header, sizeof(Header), prehead, + ps.thread_id ? " THR" : "PID", + jidlength, ps.jail ? " JID" : "", + namelength, namelength, uname_field, + swaplength, ps.swap ? " SWAP" : "", + ps.wcpu ? "WCPU" : "CPU"); + } else { + prehead = ps.thread ? + up_header_id_only : up_header_thr_and_pid; + snprintf(Header, sizeof(Header), prehead, + ps.thread_id ? " THR" : "PID", + jidlength, ps.jail ? " JID" : "", + namelength, namelength, uname_field, + swaplength, ps.swap ? " SWAP" : "", + ps.wcpu ? "WCPU" : "CPU"); + } break; case DISP_IO: prehead = io_header; From owner-svn-src-head@freebsd.org Sat Jun 9 04:54:38 2018 Return-Path: Delivered-To: svn-src-head@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 99C2910009CD; Sat, 9 Jun 2018 04:54:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E63684C66; Sat, 9 Jun 2018 04:54:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E23194B4; Sat, 9 Jun 2018 04:54:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w594sbVf038122; Sat, 9 Jun 2018 04:54:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w594sbIL038116; Sat, 9 Jun 2018 04:54:37 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090454.w594sbIL038116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 04:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334874 - head/usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.sbin/pmc X-SVN-Commit-Revision: 334874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 04:54:38 -0000 Author: eadler Date: Sat Jun 9 04:54:36 2018 New Revision: 334874 URL: https://svnweb.freebsd.org/changeset/base/334874 Log: pmc: mark some dead functions as such Also change a single instance of the comma operator to a semi-colon. Reviewed by: mmacy Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc head/usr.sbin/pmc/cmd_pmc_list.c head/usr.sbin/pmc/cmd_pmc_stat.c head/usr.sbin/pmc/cmd_pmc_summary.cc head/usr.sbin/pmc/pmc.c Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.cc Sat Jun 9 04:40:17 2018 (r334873) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Sat Jun 9 04:54:36 2018 (r334874) @@ -89,7 +89,7 @@ static struct option longopts[] = { {NULL, 0, NULL, 0} }; -static void +static void __dead2 usage(void) { errx(EX_USAGE, Modified: head/usr.sbin/pmc/cmd_pmc_list.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_list.c Sat Jun 9 04:40:17 2018 (r334873) +++ head/usr.sbin/pmc/cmd_pmc_list.c Sat Jun 9 04:54:36 2018 (r334874) @@ -75,7 +75,7 @@ static struct option longopts[] = { {NULL, 0, NULL, 0} }; -static void +static void __dead2 usage(void) { errx(EX_USAGE, Modified: head/usr.sbin/pmc/cmd_pmc_stat.c ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_stat.c Sat Jun 9 04:40:17 2018 (r334873) +++ head/usr.sbin/pmc/cmd_pmc_stat.c Sat Jun 9 04:54:36 2018 (r334874) @@ -106,7 +106,7 @@ static const char *pmc_stat_mode_names[] = { static int pmcstat_sockpair[NSOCKPAIRFD]; -static void +static void __dead2 usage(void) { errx(EX_USAGE, @@ -127,8 +127,10 @@ showtime(FILE *out, struct timespec *before, struct ti after->tv_sec -= before->tv_sec; after->tv_nsec -= before->tv_nsec; - if (after->tv_nsec < 0) - after->tv_sec--, after->tv_nsec += 1000000000; + if (after->tv_nsec < 0) { + after->tv_sec--; + after->tv_nsec += 1000000000; + } real = (after->tv_sec * 1000000000 + after->tv_nsec) / 1000; user = ru->ru_utime.tv_sec * 1000000 + ru->ru_utime.tv_usec; Modified: head/usr.sbin/pmc/cmd_pmc_summary.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_summary.cc Sat Jun 9 04:40:17 2018 (r334873) +++ head/usr.sbin/pmc/cmd_pmc_summary.cc Sat Jun 9 04:54:36 2018 (r334874) @@ -83,7 +83,7 @@ typedef unordered_map Delivered-To: svn-src-head@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 039C2FFB7E9; Sat, 9 Jun 2018 04:40:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A581E8418E; Sat, 9 Jun 2018 04:40:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86DAA19172; Sat, 9 Jun 2018 04:40:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w594eIv3028299; Sat, 9 Jun 2018 04:40:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w594eIW1028298; Sat, 9 Jun 2018 04:40:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090440.w594eIW1028298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 04:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334873 - head/usr.bin/ncal X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/ncal X-SVN-Commit-Revision: 334873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 04:40:19 -0000 Author: eadler Date: Sat Jun 9 04:40:17 2018 New Revision: 334873 URL: https://svnweb.freebsd.org/changeset/base/334873 Log: ncal: correct history section originally reported Todd C. Miller[0] Additional data see [1][2]. While here, pet igor. Closes #152 (github pr) Sbmitted by: Raf Czlonka [0] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cal/cal.1?rev=1.28&content-type=text/x-cvsweb-markup [1] https://www.bell-labs.com/usr/dmr/www/1stEdman.html [2] https://www.bell-labs.com/usr/dmr/www/man61.pdf Modified: head/usr.bin/ncal/ncal.1 Modified: head/usr.bin/ncal/ncal.1 ============================================================================== --- head/usr.bin/ncal/ncal.1 Sat Jun 9 04:05:18 2018 (r334872) +++ head/usr.bin/ncal/ncal.1 Sat Jun 9 04:40:17 2018 (r334873) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2009 +.Dd June 08, 2018 .Dt CAL 1 .Os .Sh NAME @@ -154,15 +154,18 @@ note the year must be fully specified: .Dq Li cal 89 will .Em not -display a calendar for 1989. Two parameters denote the month and +display a calendar for 1989. +Two parameters denote the month and year; the month is either a number between 1 and 12, or a full or -abbreviated name as specified by the current locale. Month and +abbreviated name as specified by the current locale. +Month and year default to those of the current system clock and time zone (so .Dq Li cal -m 8 will display a calendar for the month of August in the current year). .Pp -Not all options can be used together. For example +Not all options can be used together. +For example .Dq Li -3 -A 2 -B 3 -y -m 7 would mean: show me the three months around the seventh month, three before @@ -180,7 +183,7 @@ Highlighting of dates is disabled if stdout is not a t A .Nm command appeared in -.At v5 . +.At v1 . The .Nm ncal command appeared in From owner-svn-src-head@freebsd.org Sat Jun 9 06:13:18 2018 Return-Path: Delivered-To: svn-src-head@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 1DAE91006EF4; Sat, 9 Jun 2018 06:13:18 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [5.9.17.157]) (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 564F7680D5; Sat, 9 Jun 2018 06:13:17 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail6 [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id D7BDF1960F7; Sat, 9 Jun 2018 08:13:09 +0200 (CEST) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 963639CC6C; Sat, 9 Jun 2018 08:13:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id wHcfkbffSOaI; Sat, 9 Jun 2018 08:13:09 +0200 (CEST) Received: from nibbler-osx.fritz.box (p5DF5CD2D.dip0.t-ipconnect.de [93.245.205.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id A95789CC0A; Sat, 9 Jun 2018 08:13:08 +0200 (CEST) Subject: Re: svn commit: r334864 - head/usr.bin/top To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806090214.w592EYsJ056425@repo.freebsd.org> From: Florian Smeets Autocrypt: addr=flo@smeets.xyz; keydata= xsFNBFpyBwsBEADLq0c46orEtbMn4SptX+VJxR1wB4YwaErZme1bqF4nZHIhlRNET22HsHdQ doagaB4uACq0Rj5kHcu614ZnnNkLPyCxWQATx+cbdiFO4/hfT8tAvKnBtiy3awKJ5uGCNO2E zJwXW6KwdDA8XPRySqN8m1yPl+dW0Cls+/vO/QL/6+YLMupmEpSvFxRzAZTQuKyX4+xl+dYI d24JiPd1yfCuDNOY3+OZ3QBMT00u/699N8lUWRtiTwaQMwAOww8r/26YM6/SgcgFuLH2E/CV plY0sDvfoISlAj8agxdomNXfPjCMQ6w5yGZmA+huFpPCVBTi3on/SWgbQO7dLVpN4BNPuScP osCb/dsOg0S74zCClsIU3gdUGh9rwJY00/Ebid6V0R3c1Czwbg8LQedzlGDuXYXmzp6W2ujg r1cqbUD6lUWikUv2IMdCbb8MxYhHLi3GYUs5Xpi+W7vM6T45KbuMr7O/1SjtcGOlNeDvGNgj cDk20fOgPPZ+M6i9vX5Q2oI9HoYaeTiYNwILkBLVP/L40kTo5EkiQOt4OW6BMbylqXPOaQMW uGVbmhCJQpbx8Vo80s2yiBBVWkLkWQIcIm3KZlLldJqKEFpQBWLBE1eFFqboYgAWzFn73CaV 5tihobijMmmOV3a8cI1fI4kREyl3g+8bW+O0u3m3tuzVOpDpjwARAQABzR9GbG9yaWFuIFNt ZWV0cyA8ZmxvQHNtZWV0cy54eXo+wsGXBBMBCgBBAhsDBQkHhh+ABQsJCAcDBRUKCQgLBRYD AgEAAh4BAheAFiEE7LNouHkIv7aRTXJp71uk3NWp88AFAlpyB1gCGQEACgkQ71uk3NWp88DB 8RAAuwXf65kTtVwDAJEFnXQmRx8q/bfV5WWMVVZMM9zMOmLM006PlJlns9vDEwfXkUsTOKpC 9GEREdCVxsqQ/WqYrO0O8yLYRMY0IQ6w2B5cVzvf1DwY6Foc7zOpEgvAt5mCR9BoJ1eHf90K rHYUxf8AaWjJ/CE4EdN4wDvEY23tQ1ov0ReiNZokKfKKRF8rRbBhpwRcRyzV4eah3WvKKyOy PIGKquXG0GWhgty3rfNtion8AomFoQlK0lCq57okQj0HLS3vLTzXexvfWsLc+nLXT8eo87cl MQaYz7h5EjqM0r4FPRmGJ18nQ5wArt5vOf5oRv90RSH3QJLaxVdvt0BCDr2s1J5tTG7gZP/r Kyz9BrPtVvBwiHEW8jhw4lDbV3xIUEVkj4UEsM9XkHrHqd8JiFNZZOPE25VkuAeoeyB3j9km fZczF/f41cHp5v5RyTavta9QWA6Q07ARPu2JCBMMN+lJ9G/Ok8JlUgSGOwHZ+3R7jjvDMEFh 4DJhF2B77DdLxpLVJS0h5cS8WM6a/jm1Sk6DAi4bgksetvdyE/N/yxQmHokdKYW2LGDgd7cw dM2X660avFRe4ogZ0PeLRimPbyJuSN2+hZC/fy5jEv5PvZ+6spuwYMYDClefRpvBDqmCCxtf M1LNFRiXjdYvUdHvQ3facDzNpOkPLp0VexjJJ2HOwU0EWnIHCwEQANHrOm5vydK/ij1zkDyL Zzbogk5zjMh6oAr3cH4oGbJHPLlyFZTCVBYUwD4kh6NV1sKuZOeX/aygyVg1RyLulnzsc6Yj XOIxlqhqQwGI8k8ssAIpMSf029781CNF2HC42CrJeHtXNONDNOjsMuoxzga9zLQCh4jLTlE/ TUJo6KVABWBVRtTVh2Z77pKtN7j2NPFBHvp7K0WHfV+TYnlsgjhUA0ACZnUdHS2YRzBhCzzQ eludxBz54S9xbUq1mfZfVx8AbAGXF2zxo68nvvAAJn48HiBS3dMhCGYJDdZdja6QdUFPiemi nOxwkUzCqmKxm+Aj7USue1SbZZqJxmMI1eF4Ork/BJJI74Z/FnJgYR4UkEiD3J/KUocQCIH3 daB1+/CXlh99Ib7AP+QGuKk3vnNHh7VBq3E+VAiM5LU0BmgW+cdRPHkiwM7sDa2VnV3VqvV7 QmoMKnHFzUB6Nn8uE+iakp5J81Pr68kDOq7kLW3UnGmg1PUqbsnCaTimJb3JAYWzOW/9CYcP lbAdIqi+wH7MOoeL+PA99A3kW/881rGmeOYFzzrsNVLtea+AJfXtp4LN5gOVIPIpovCNSVXX EKgl7a4vjUGzVBzrH7PzT+k4XUEQwNCACfGZxEExtny19bjvumZ0rv+AEAHvsWSKXHUVJzIN jqd9UioaEbKGAPlPABEBAAHCwXwEGAEKACYWIQTss2i4eQi/tpFNcmnvW6Tc1anzwAUCWnIH CwIbDAUJB4YfgAAKCRDvW6Tc1anzwM/8D/9IbDzMvsz4O+Gcz1oUx4IMxbQDw99qgJexR5cj W207GkRnKVJ0zqx7Xc+U3AytniuwqHEXeV4qIqP6h14pEuCqdRJ+fSm65rB4+ZdeM2Y5YYvU BByOM78Mbs6SZy2k5X0EL5FXjNVIMOv2ImblyeRWhWK6gCfc/l7kV1EYVx9LV3umsc7K+ceZ lfE1U8hWbie8r7tl3V9ggF2g1cyc9ru0qW3sg8D4vNTS1uwdqeccKRc3osrVw4WrW1nGxTmT TCqVYGHjF2sANF9o1JB93hoXz8lydmDdhJ/62/XHapeT1FB8m7gulinM33VeOCCjN+dUgLQk 5tAGg+iHQWhC4Q/o4m0OqfdcSYdhCJ7h2I4GwOoGaxzoXqEL47Guxz+zE4osAFP5JLxCTbi2 x5sduCvxx3WbO95kZJKp7D0BIKpbKcfkyWse53YBI9wSrkIil+InnqvSDzU9nMvIyKSjv4ui wvZi1HY7tPiir/P2naZaiQ1SAM0KLP3g123WcnhRKo++ZRHhay5/70SKGdxEmKf3nld8xNCs 9EIWOTpRaqc9+zOcD1zVTZwnwgBrnPqzfPW9+d7FwAP1MdJbrROuC2bfzNZyoR4uHAnDOyNW wGSmShv7hhdettO8dJblneTY8vhzxo36pWmojEdgghXNw9Ji7kyInAmWq9kwV5Vou3ZNFw== Message-ID: <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> Date: Sat, 9 Jun 2018 08:13:03 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201806090214.w592EYsJ056425@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="P2tJ8mDTgA5xVypzdYBxCtdX7ETaLFQ1I" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 06:13:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P2tJ8mDTgA5xVypzdYBxCtdX7ETaLFQ1I Content-Type: multipart/mixed; boundary="Jf3QjLQwSiRLz32Dht9VZgi0AvsbV6ibs"; protected-headers="v1" From: Florian Smeets To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> Subject: Re: svn commit: r334864 - head/usr.bin/top References: <201806090214.w592EYsJ056425@repo.freebsd.org> In-Reply-To: <201806090214.w592EYsJ056425@repo.freebsd.org> --Jf3QjLQwSiRLz32Dht9VZgi0AvsbV6ibs Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.06.18 04:14, Eitan Adler wrote: > Author: eadler > Date: Sat Jun 9 02:14:33 2018 > New Revision: 334864 > URL: https://svnweb.freebsd.org/changeset/base/334864 >=20 > Log: > top(1): use a different command to toggle tid vs pid Thank you. You cannot start top with -T unless you add something like the following:= Index: top.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- top.c (revision 334874) +++ top.c (working copy) @@ -328,7 +328,7 @@ optind =3D 1; } - while ((i =3D getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:tw")) !=3D EO= F) + while ((i =3D getopt(ac, av, "CSIHPTabijJ:nquvzs:d:U:m:o:p:tw")) !=3D E= OF) { switch(i) { Another issue I just found is that if you start top with -P some columns don't show any values: CPU 0: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 1: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 2: % user, % nice, 1.2% system, % interrupt, 98.8% idle CPU 3: 0.4% user, % nice, 0.4% system, % interrupt, 99.2% idle CPU 4: % user, % nice, 0.4% system, % interrupt, 99.6% idle CPU 5: % user, % nice, 2.4% system, % interrupt, 97.6% idle CPU 6: % user, % nice, 0.4% system, % interrupt, 99.6% idle CPU 7: % user, % nice, 2.4% system, % interrupt, 97.6% idle It is correct if you start top with -TP or -HP, or if you start top -P and then use H or T to switch back and forth. I'm not sure in which revision this was broken, it works with r333899. Florian --Jf3QjLQwSiRLz32Dht9VZgi0AvsbV6ibs-- --P2tJ8mDTgA5xVypzdYBxCtdX7ETaLFQ1I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7LNouHkIv7aRTXJp71uk3NWp88AFAlsbb/NfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVD QjM2OEI4NzkwOEJGQjY5MTRENzI2OUVGNUJBNERDRDVBOUYzQzAACgkQ71uk3NWp 88BxBA/9Gq+HVWQaCiRHQBbKslyTZ9jPVw/XhQ6c5SZYvqTApb9PGxDnfJibpals eFq1Ks8rLEQF+Y+oBHHKrTO+VWUpFUM85HGSxrjHd4HLEhZCu8fu7Yn8vXkqvgL3 1jF2bTllYpaGR8U0z46Jvz54N+Kk1QVawExQGQsGknErGJom2CnstL/Qo+dsExjl ZuHY6seurORAsToijSa4nky8MvDcFQZMid5w7RVkcebbNZQiZ0jMxJQSx2qpQWwX RFBhsUekZ/ooxHtyabujjJLh8Fg3wP3B4bXRjQwmFo2j1CX6dWRNaZaD4ULzOqaX MLzHdpm9Nmvh4fzMScT02nbPG9x0YFZoHcyvmW80w08Y31Xn/rOLbEXUZbT2cXdu hddqk6rs8Lb/0udw0zu0tkHtIX7/s+IT0R08fzafumSVtZcoB3Mhh7EoUzKFyubO wtVVlPae4Gho32vPDZOejQSTXjW4k8QqmCrCfmLWXuVnS4R4Aa3098p4Xj2pKeWk Kvjl8dKOU8SloGDjCPuvc0FNXLMrmVxAISXdo6Y8y1FF8PZLH1ECw2pGu9JJYqcp pwdPiVvVQxCj5qb+62l07UViAuK0tX+uG9a2DNd+rd0S/7hLfox/D64PjuZzzrId 3FfjpcsI76jxzadj2wCMMyHZKUzYoE+R7KZVdvvnJJ5MYitpbSY= =m++y -----END PGP SIGNATURE----- --P2tJ8mDTgA5xVypzdYBxCtdX7ETaLFQ1I-- From owner-svn-src-head@freebsd.org Sat Jun 9 05:57:44 2018 Return-Path: Delivered-To: svn-src-head@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 729BB1005F63; Sat, 9 Jun 2018 05:57:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F32875F9; Sat, 9 Jun 2018 05:57:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w595vfZ2017538; Fri, 8 Jun 2018 22:57:41 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w595vegc017537; Fri, 8 Jun 2018 22:57:40 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806090557.w595vegc017537@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334856 - head/sys/amd64/amd64 In-Reply-To: <201806082035.w58KZxmA085837@repo.freebsd.org> To: Tycho Nightingale Date: Fri, 8 Jun 2018 22:57:40 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 05:57:44 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: tychon > Date: Fri Jun 8 20:35:58 2018 > New Revision: 334856 > URL: https://svnweb.freebsd.org/changeset/base/334856 > > Log: > Don't bother looking for non-executable pages when a process is > excluded from PTI. > > Reviewed by: kib > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D15708 MFC? > Modified: > head/sys/amd64/amd64/trap.c > > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Fri Jun 8 20:31:59 2018 (r334855) > +++ head/sys/amd64/amd64/trap.c Fri Jun 8 20:35:58 2018 (r334856) > @@ -770,7 +770,8 @@ trap_pfault(struct trapframe *frame, int usermode) > * If nx protection of the usermode portion of kernel page > * tables caused trap, panic. > */ > - if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | > + if (PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && usermode && > + pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W | > PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) && > (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)== > (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK)) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jun 9 09:57:15 2018 Return-Path: Delivered-To: svn-src-head@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 37291100CBE2; Sat, 9 Jun 2018 09:57:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D883972459; Sat, 9 Jun 2018 09:57:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B90071C4E0; Sat, 9 Jun 2018 09:57:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w599vExQ085654; Sat, 9 Jun 2018 09:57:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w599vEK5085653; Sat, 9 Jun 2018 09:57:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806090957.w599vEK5085653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 9 Jun 2018 09:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334875 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 334875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 09:57:15 -0000 Author: ae Date: Sat Jun 9 09:57:14 2018 New Revision: 334875 URL: https://svnweb.freebsd.org/changeset/base/334875 Log: Explicitly change the link state when we assingn an address. Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that after this link state information still not initialized properly. This leads to problems with routing, since now interface has IFCAP_LINKSTATE capability and a route is considered as working only when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP() macro). Reported by: Marek Zarychta MFC after: 3 days Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sat Jun 9 04:54:36 2018 (r334874) +++ head/sys/net/if_loop.c Sat Jun 9 09:57:14 2018 (r334875) @@ -380,6 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFADDR: ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_link_state_change(ifp, LINK_STATE_UP); /* * Everything else is done at a higher level. */ From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:10 2018 Return-Path: Delivered-To: svn-src-head@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 92AD910105F3; Sat, 9 Jun 2018 17:15:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1EA6A11B; Sat, 9 Jun 2018 14:50:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 262361F3F1; Sat, 9 Jun 2018 14:50:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59EocYA027198; Sat, 9 Jun 2018 14:50:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59Eoca2027196; Sat, 9 Jun 2018 14:50:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806091450.w59Eoca2027196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 Jun 2018 14:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334881 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 334881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:10 -0000 Author: markj Date: Sat Jun 9 14:50:38 2018 New Revision: 334881 URL: https://svnweb.freebsd.org/changeset/base/334881 Log: Add DW_LANG_* definitions from DWARF 4 and 5. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15712 Modified: head/contrib/elftoolchain/libdwarf/dwarf.h head/contrib/elftoolchain/libdwarf/dwarf_dump.c Modified: head/contrib/elftoolchain/libdwarf/dwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf.h Sat Jun 9 14:47:49 2018 (r334880) +++ head/contrib/elftoolchain/libdwarf/dwarf.h Sat Jun 9 14:50:38 2018 (r334881) @@ -523,6 +523,24 @@ #define DW_LANG_ObjC_plus_plus 0x0011 #define DW_LANG_UPC 0x0012 #define DW_LANG_D 0x0013 +#define DW_LANG_Python 0x0014 +#define DW_LANG_OpenCL 0x0015 +#define DW_LANG_Go 0x0016 +#define DW_LANG_Modula3 0x0017 +#define DW_LANG_Haskell 0x0018 +#define DW_LANG_C_plus_plus_03 0x0019 +#define DW_LANG_C_plus_plus_11 0x001a +#define DW_LANG_OCaml 0x001b +#define DW_LANG_Rust 0x001c +#define DW_LANG_C11 0x001d +#define DW_LANG_Swift 0x001e +#define DW_LANG_Julia 0x001f +#define DW_LANG_Dylan 0x0020 +#define DW_LANG_C_plus_plus_14 0x0021 +#define DW_LANG_Fortran03 0x0022 +#define DW_LANG_Fortran08 0x0023 +#define DW_LANG_RenderScript 0x0024 +#define DW_LANG_BLISS 0x0025 #define DW_LANG_lo_user 0x8000 #define DW_LANG_Mips_Assembler 0x8001 #define DW_LANG_hi_user 0xffff Modified: head/contrib/elftoolchain/libdwarf/dwarf_dump.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_dump.c Sat Jun 9 14:47:49 2018 (r334880) +++ head/contrib/elftoolchain/libdwarf/dwarf_dump.c Sat Jun 9 14:50:38 2018 (r334881) @@ -788,6 +788,42 @@ dwarf_get_LANG_name(unsigned lang, const char **s) *s = "DW_LANG_UPC"; break; case DW_LANG_D: *s = "DW_LANG_D"; break; + case DW_LANG_Python: + *s = "DW_LANG_Python"; break; + case DW_LANG_OpenCL: + *s = "DW_LANG_OpenCL"; break; + case DW_LANG_Go: + *s = "DW_LANG_Go"; break; + case DW_LANG_Modula3: + *s = "DW_LANG_Modula3"; break; + case DW_LANG_Haskell: + *s = "DW_LANG_Haskell"; break; + case DW_LANG_C_plus_plus_03: + *s = "DW_LANG_C_plus_plus_03"; break; + case DW_LANG_C_plus_plus_11: + *s = "DW_LANG_C_plus_plus_11"; break; + case DW_LANG_OCaml: + *s = "DW_LANG_OCaml"; break; + case DW_LANG_Rust: + *s = "DW_LANG_Rust"; break; + case DW_LANG_C11: + *s = "DW_LANG_C11"; break; + case DW_LANG_Swift: + *s = "DW_LANG_Swift"; break; + case DW_LANG_Julia: + *s = "DW_LANG_Julia"; break; + case DW_LANG_Dylan: + *s = "DW_LANG_Dylan"; break; + case DW_LANG_C_plus_plus_14: + *s = "DW_LANG_C_plus_plus_14"; break; + case DW_LANG_Fortran03: + *s = "DW_LANG_Fortran03"; break; + case DW_LANG_Fortran08: + *s = "DW_LANG_Fortran08"; break; + case DW_LANG_RenderScript: + *s = "DW_LANG_RenderScript"; break; + case DW_LANG_BLISS: + *s = "DW_LANG_BLISS"; break; case DW_LANG_lo_user: *s = "DW_LANG_lo_user"; break; case DW_LANG_Mips_Assembler: From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:20 2018 Return-Path: Delivered-To: svn-src-head@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 E4AE91010B0A; Sat, 9 Jun 2018 17:15:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F98E7B986; Sat, 9 Jun 2018 15:10:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00BD71F740; Sat, 9 Jun 2018 15:10:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59FAnZR036816; Sat, 9 Jun 2018 15:10:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59FAnIW036815; Sat, 9 Jun 2018 15:10:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806091510.w59FAnIW036815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 Jun 2018 15:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 334883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:20 -0000 Author: markj Date: Sat Jun 9 15:10:49 2018 New Revision: 334883 URL: https://svnweb.freebsd.org/changeset/base/334883 Log: Don't process DWARF generated from non-C/C++ code. ctfconvert(1) is not designed to handle DWARF generated from such code, and will generally fail in non-obvious ways. Use an explicit check to help catch such potential failures. Reported by: Johannes Lundberg MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15:10:39 2018 (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15:10:49 2018 (r334883) @@ -1901,7 +1901,7 @@ should_have_dwarf(Elf *elf) int dw_read(tdata_t *td, Elf *elf, char *filename __unused) { - Dwarf_Unsigned abboff, hdrlen, nxthdr; + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr; Dwarf_Half vers, addrsz, offsz; Dwarf_Die cu = 0; Dwarf_Die child = 0; @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused } if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { - if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) exit(0); else terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused debug(1, "DWARF emitter: %s\n", prod); free(prod); } + + if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) == 0) + switch (lang) { + case DW_LANG_C: + case DW_LANG_C89: + case DW_LANG_C99: + case DW_LANG_C11: + case DW_LANG_C_plus_plus: + case DW_LANG_C_plus_plus_03: + case DW_LANG_C_plus_plus_11: + case DW_LANG_C_plus_plus_14: + break; + default: + terminate("file contains DWARF for unsupported " + "language %d", lang); + } + else + warning("die %llu: failed to get language attribute: %s\n", + die_off(&dw, cu), dwarf_errmsg(dw.dw_err)); if ((dw.dw_cuname = die_name(&dw, cu)) != NULL) { char *base = xstrdup(basename(dw.dw_cuname)); From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:33 2018 Return-Path: Delivered-To: svn-src-head@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 1295E101128D for ; Sat, 9 Jun 2018 17:15:33 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2CA485431 for ; Sat, 9 Jun 2018 15:56:03 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 92984223B7 for ; Sat, 9 Jun 2018 15:56:03 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f174.google.com with SMTP id b125-v6so5074003ywe.1 for ; Sat, 09 Jun 2018 08:56:03 -0700 (PDT) X-Gm-Message-State: APt69E24aHzDQH7DTwthPJeYr9jRecz5yYxBq7qaSi9nWzlMOCFuWXj3 BVX/IIaFr2GOzokjhtTCZlL747+504SB100z+/k5zw== X-Google-Smtp-Source: ADUXVKLa9zIFWJk7/Ih9G4BpJor4fwrTaR+wynL+J1CDm1BNNvm1A5NVsl67+HTw85gHA3Y9k6grZRtWQ3ZNMRUzddo= X-Received: by 2002:a0d:cf01:: with SMTP id r1-v6mr6009547ywd.162.1528559763216; Sat, 09 Jun 2018 08:56:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 08:55:32 -0700 (PDT) In-Reply-To: References: <201806090214.w592EYsJ056425@repo.freebsd.org> <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> From: Eitan Adler Date: Sat, 9 Jun 2018 08:55:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334864 - head/usr.bin/top To: Florian Smeets Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:33 -0000 On 9 June 2018 at 08:54, Eitan Adler wrote: > On 8 June 2018 at 23:13, Florian Smeets wrote: >> On 09.06.18 04:14, Eitan Adler wrote: >>> Author: eadler >>> Date: Sat Jun 9 02:14:33 2018 >>> New Revision: 334864 >>> URL: https://svnweb.freebsd.org/changeset/base/334864 >>> >>> Log: >>> top(1): use a different command to toggle tid vs pid >> >> Thank you. >> >> You cannot start top with -T unless you add something like the following: > > I have a patch out for this, but svn is having issues right now (or at > least I am). > >> Another issue I just found is that if you start top with -P some columns >> don't show any values: > >> >> It is correct if you start top with -TP or -HP, or if you start top -P >> and then use H or T to switch back and forth. I'm not sure in which >> revision this was broken, it works with r333899. > > I'm guessing this is because I forgot to initalize "prehead" > somewhere. I'd like to rewrite the entire header creation, but will > try and fix this. Thanks for the report! By header, I meant header and data format string :) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:33 2018 Return-Path: Delivered-To: svn-src-head@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 2DE271011293; Sat, 9 Jun 2018 17:15:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9B6876436; Sat, 9 Jun 2018 14:24:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A54D41F075; Sat, 9 Jun 2018 14:24:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59EOGAj016697; Sat, 9 Jun 2018 14:24:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59EOGnp016696; Sat, 9 Jun 2018 14:24:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091424.w59EOGnp016696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 14:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334878 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 334878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:33 -0000 Author: kevans Date: Sat Jun 9 14:24:16 2018 New Revision: 334878 URL: https://svnweb.freebsd.org/changeset/base/334878 Log: libsa(3): Correct statement about FS Write-support, name change - jhb implemented UFS write support a little over 16 years ago. - Update the library name while we're here. Reviewed by: jhb, rpokala Differential Revision: https://reviews.freebsd.org/D14476 Modified: head/stand/libsa/libsa.3 Modified: head/stand/libsa/libsa.3 ============================================================================== --- head/stand/libsa/libsa.3 Sat Jun 9 14:21:07 2018 (r334877) +++ head/stand/libsa/libsa.3 Sat Jun 9 14:24:16 2018 (r334878) @@ -24,11 +24,11 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2018 -.Dt LIBSTAND 3 +.Dd February 22, 2018 +.Dt LIBSA 3 .Os .Sh NAME -.Nm libstand +.Nm libsa .Nd support library for standalone executables .Sh SYNOPSIS .In stand.h @@ -402,8 +402,8 @@ except that file creation is not supported, so the mod required. The .Fa flags -argument may be one of O_RDONLY, O_WRONLY and O_RDWR (although no file systems -currently support writing). +argument may be one of O_RDONLY, O_WRONLY and O_RDWR. +Only UFS currently supports writing. .It Xo .Ft int .Fn close "int fd" From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:30 2018 Return-Path: Delivered-To: svn-src-head@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 4D1AC1011151; Sat, 9 Jun 2018 17:15:30 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC531866E3; Sat, 9 Jun 2018 12:53:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C522C87A4; Sat, 9 Jun 2018 12:53:00 +0000 (UTC) Date: Sat, 9 Jun 2018 12:53:00 +0000 From: Alexey Dokuchaev To: Sean Eric Fagan Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334844 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensol... Message-ID: <20180609125300.GA97439@FreeBSD.org> References: <201806081738.w58HcSsM094656@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806081738.w58HcSsM094656@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:30 -0000 On Fri, Jun 08, 2018 at 05:38:28PM +0000, Sean Eric Fagan wrote: > New Revision: 334844 > URL: https://svnweb.freebsd.org/changeset/base/334844 > > Log: > This originated from ZFS On Linux [...] > > During scans (scrubs or resilvers), it sorts the blocks in each > transaction group by block offset; the result can be a significant > improvement. That's pretty cool, thanks for bringing this in! Couple of comments about the commit itself (not the code). > @@ -2281,14 +2281,14 @@ dump_dir(objset_t *os) > object_count++; > } > > - ASSERT3U(object_count, ==, usedobjs); > - > (void) printf("\n"); > > if (error != ESRCH) { > (void) fprintf(stderr, "dmu_object_next() = %d\n", error); > abort(); > } > + > + ASSERT3U(object_count, ==, usedobjs); This seems to be about something else, not the sorting of blocks, is it? > - if (ps && ps->pss_state == DSS_SCANNING && > + if (ps != NULL && ps->pss_state == DSS_SCANNING && ... > - /* > - * Scan is finished or canceled. > - */ > - if (ps->pss_state == DSS_FINISHED) { > - uint64_t minutes_taken = (end - start) / 60; > - char *fmt = NULL; > > + /* Scan is finished or canceled. */ > + if (ps->pss_state == DSS_FINISHED) { Ideally, style fixes should be committed separately from the functional changes. > - if (ps && ps->pss_func == POOL_SCAN_RESILVER && > + if (ps != NULL && ps->pss_func == POOL_SCAN_RESILVER && > ps->pss_state == DSS_SCANNING) > return (ZPOOL_STATUS_RESILVERING); There're not awfully many of them, but still. ./danfe From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:44 2018 Return-Path: Delivered-To: svn-src-head@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 564F31011422; Sat, 9 Jun 2018 17:15:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6130A7980F; Sat, 9 Jun 2018 12:08:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [72.142.116.18]) by mail.baldwin.cx (Postfix) with ESMTPSA id C8E3810AFCD; Sat, 9 Jun 2018 08:08:13 -0400 (EDT) Subject: Re: svn commit: r334814 - head/sbin/dump To: Justin Hibbits , Ed Maste References: <201806072049.w57Kn1Mk057119@repo.freebsd.org> Cc: Kirk McKusick , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <76ac237e-c62c-8439-e3ba-3164a8aa36eb@FreeBSD.org> Date: Sat, 9 Jun 2018 08:08:12 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; 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-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 09 Jun 2018 08:08:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:44 -0000 On 6/8/18 10:27 AM, Justin Hibbits wrote: > On Fri, Jun 8, 2018 at 10:08 AM, Ed Maste wrote: >> On 7 June 2018 at 16:49, Kirk McKusick wrote: >>> Author: mckusick >>> Date: Thu Jun 7 20:49:01 2018 >>> New Revision: 334814 >>> URL: https://svnweb.freebsd.org/changeset/base/334814 >>> >>> Log: >>> Ensure proper initialization of superblock. >>> >> ... >>> --- head/sbin/dump/main.c Thu Jun 7 19:57:55 2018 (r334813) >>> +++ head/sbin/dump/main.c Thu Jun 7 20:49:01 2018 (r334814) >>> @@ -433,6 +433,7 @@ main(int argc, char *argv[]) >>> msgtail("to %s\n", tape); >>> >>> sync(); >>> + sblock = NULL; >>> if ((ret = sbget(diskfd, &sblock, -1)) != 0) { >> >> sblock is initialized to NULL at the beginning of ffs_sbget, so I'm >> not really sure what's happening here. >> > > Diane just found possibly the real cause of the problem. dump.h is > included by almost every .c file, but defines variables, doesn't just > declare them. I think the real solution would be to define them in > main.c, or somewhere else, and just declare them in dump.h. Or if > they're truly only needed on a per-file basis, not as globals, they > could be marked static so there is no chance of conflict, and they're > pre-initialized to 0. The linker "might" merge them into the common > section, or might not, resulting in bizarre conflicts like what she's > seeing. Though, I'm surprised we're not seeing a linker error or > warning anyway. Is this in fact fallout from lld vs ld.bfd then? -- John Baldwin From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:20 2018 Return-Path: Delivered-To: svn-src-head@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 0FAA21010B26; Sat, 9 Jun 2018 17:15:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 189518D252; Sat, 9 Jun 2018 15:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E93DC1FA50; Sat, 9 Jun 2018 15:28:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59FSbmO045888; Sat, 9 Jun 2018 15:28:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59FSb8O045887; Sat, 9 Jun 2018 15:28:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091528.w59FSb8O045887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 15:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334884 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 334884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:20 -0000 Author: kevans Date: Sat Jun 9 15:28:37 2018 New Revision: 334884 URL: https://svnweb.freebsd.org/changeset/base/334884 Log: stand: Fix build after r334882 Not sure how this was not caught in Universe. Modified: head/stand/common/metadata.c Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Sat Jun 9 15:10:49 2018 (r334883) +++ head/stand/common/metadata.c Sat Jun 9 15:28:37 2018 (r334884) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(LOADER_FDT_SUPPORT) #include #endif From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:52 2018 Return-Path: Delivered-To: svn-src-head@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 D0CA010114A5; Sat, 9 Jun 2018 17:15:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4848A719F3; Sat, 9 Jun 2018 14:17:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DEEC1EEE3; Sat, 9 Jun 2018 14:17:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59EH6i7012118; Sat, 9 Jun 2018 14:17:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59EH6rV012117; Sat, 9 Jun 2018 14:17:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806091417.w59EH6rV012117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 9 Jun 2018 14:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334876 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 334876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:53 -0000 Author: kp Date: Sat Jun 9 14:17:06 2018 New Revision: 334876 URL: https://svnweb.freebsd.org/changeset/base/334876 Log: pf: Fix deadlock with route-to If a locally generated packet is routed (with route-to/reply-to/dup-to) out of a different interface it's passed through the firewall again. This meant we lost the inp pointer and if we required the pointer (e.g. for user ID matching) we'd deadlock trying to acquire an inp lock we've already got. Pass the inp pointer along with pf_route()/pf_route6(). PR: 228782 MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Jun 9 09:57:14 2018 (r334875) +++ head/sys/netpfil/pf/pf.c Sat Jun 9 14:17:06 2018 (r334876) @@ -295,14 +295,14 @@ static void pf_mtag_free(struct m_tag *); #ifdef INET static void pf_route(struct mbuf **, struct pf_rule *, int, struct ifnet *, struct pf_state *, - struct pf_pdesc *); + struct pf_pdesc *, struct inpcb *); #endif /* INET */ #ifdef INET6 static void pf_change_a6(struct pf_addr *, u_int16_t *, struct pf_addr *, u_int8_t); static void pf_route6(struct mbuf **, struct pf_rule *, int, struct ifnet *, struct pf_state *, - struct pf_pdesc *); + struct pf_pdesc *, struct inpcb *); #endif /* INET6 */ int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len); @@ -5442,7 +5442,7 @@ pf_routable(struct pf_addr *addr, sa_family_t af, stru #ifdef INET static void pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, - struct pf_state *s, struct pf_pdesc *pd) + struct pf_state *s, struct pf_pdesc *pd, struct inpcb *inp) { struct mbuf *m0, *m1; struct sockaddr_in dst; @@ -5510,7 +5510,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, goto bad; if (oifp != ifp) { - if (pf_test(PF_OUT, 0, ifp, &m0, NULL) != PF_PASS) + if (pf_test(PF_OUT, 0, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) goto done; @@ -5603,7 +5603,7 @@ bad: #ifdef INET6 static void pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, - struct pf_state *s, struct pf_pdesc *pd) + struct pf_state *s, struct pf_pdesc *pd, struct inpcb *inp) { struct mbuf *m0; struct sockaddr_in6 dst; @@ -5672,7 +5672,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, goto bad; if (oifp != ifp) { - if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, NULL) != PF_PASS) + if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) goto done; @@ -6236,7 +6236,7 @@ done: default: /* pf_route() returns unlocked. */ if (r->rt) { - pf_route(m0, r, dir, kif->pfik_ifp, s, &pd); + pf_route(m0, r, dir, kif->pfik_ifp, s, &pd, inp); return (action); } break; @@ -6633,7 +6633,7 @@ done: default: /* pf_route6() returns unlocked. */ if (r->rt) { - pf_route6(m0, r, dir, kif->pfik_ifp, s, &pd); + pf_route6(m0, r, dir, kif->pfik_ifp, s, &pd, inp); return (action); } break; From owner-svn-src-head@freebsd.org Sat Jun 9 17:15:54 2018 Return-Path: Delivered-To: svn-src-head@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 926881011500; Sat, 9 Jun 2018 17:15:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43D357BC1B; Sat, 9 Jun 2018 12:17:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [72.142.116.18]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5395010AFD2; Sat, 9 Jun 2018 08:17:28 -0400 (EDT) Subject: Re: svn commit: r334867 - in head: lib usr.sbin To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806090225.w592PIMH061577@repo.freebsd.org> From: John Baldwin Message-ID: Date: Sat, 9 Jun 2018 08:17:27 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806090225.w592PIMH061577@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 09 Jun 2018 08:17:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:15:54 -0000 On 6/8/18 10:25 PM, Matt Macy wrote: > Author: mmacy > Date: Sat Jun 9 02:25:18 2018 > New Revision: 334867 > URL: https://svnweb.freebsd.org/changeset/base/334867 > > Log: > pmc: fix logic in skipping riscv This would still appear to not be right as eventually riscv will use llvm. Also, I wonder if the more normal way of handling this would be to make MK_PMC a BROKEN_OPTION for riscv in src.opts.mk as then it is centralized in one place. Similarly, what is the actual compiler requirement? If you need C++11 support for example then it would be better to express this in terms of COMPILER_FEATURES (and that might also be doable in src.opts.mk so that it is centralized). > Modified: > head/lib/Makefile > head/usr.sbin/Makefile > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sat Jun 9 02:18:15 2018 (r334866) > +++ head/lib/Makefile Sat Jun 9 02:25:18 2018 (r334867) > @@ -202,7 +202,7 @@ _libdl= libdl > .endif > > SUBDIR.${MK_OPENSSL}+= libmp > -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") > +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv")) > SUBDIR.${MK_PMC}+= libpmc libpmcstat > .endif > SUBDIR.${MK_RADIUS_SUPPORT}+= libradius > > Modified: head/usr.sbin/Makefile > ============================================================================== > --- head/usr.sbin/Makefile Sat Jun 9 02:18:15 2018 (r334866) > +++ head/usr.sbin/Makefile Sat Jun 9 02:25:18 2018 (r334867) > @@ -179,7 +179,7 @@ SUBDIR.${MK_OPENSSL}+= keyserv > SUBDIR.${MK_PC_SYSINSTALL}+= pc-sysinstall > SUBDIR.${MK_PF}+= ftp-proxy > SUBDIR.${MK_PKGBOOTSTRAP}+= pkg > -.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100) && ${MACHINE_CPUARCH} != "riscv") > +.if (${COMPILER_TYPE} == "clang" || (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 && ${MACHINE_CPUARCH} != "riscv")) > SUBDIR.${MK_PMC}+= pmc > SUBDIR.${MK_PMC}+= pmcannotate > SUBDIR.${MK_PMC}+= pmccontrol > -- John Baldwin From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:11 2018 Return-Path: Delivered-To: svn-src-head@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 5B21310117BF; Sat, 9 Jun 2018 17:16:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADB2379FBC; Sat, 9 Jun 2018 12:11:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [72.142.116.18]) by mail.baldwin.cx (Postfix) with ESMTPSA id E4B3110AFD4; Sat, 9 Jun 2018 08:11:16 -0400 (EDT) Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys To: Matthew Macy , Mark Johnston References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: Date: Sat, 9 Jun 2018 08:11:15 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; 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-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 09 Jun 2018 08:11:17 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:11 -0000 On 6/8/18 12:34 PM, Matthew Macy wrote: >> The fact that our NMI handler isn't re-entrant can lead to subtle >> problems. If while executing the NMI handler we hit a dtrace >> probe or DDB breakpoint, the iret executed upon return to the handler >> will re-enable NMIs. Then, if a second NMI arrives before the handler >> for the first has returned, the trapframe will be clobbered. Did you >> rule out an issue like this? > > No, but it happened instantly on all CPUs an a non-debug kernel 100% > of the time after I changed pmc_process_interrupt earlier this week. > My voodoo fix now avoids it. What you're describing sounds episodic > and doesn't sound like it would be fixed / worked around by my change. OTOH, a compiler bug will crop up in other places. It is best to run it to ground. Can you describe what the bug was in more detail? It would probably not be hard to come up with something you can run creduce against to get down to a test case. If you do that, the LLVM folks are quite helpful and able at fixing the issue which fixes it in more places than just here. -- John Baldwin From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:25 2018 Return-Path: Delivered-To: svn-src-head@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 AC7201011A72; Sat, 9 Jun 2018 17:16:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 325AA684FA; Sat, 9 Jun 2018 14:47:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E82BA1F3E7; Sat, 9 Jun 2018 14:47:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59ElnfH026397; Sat, 9 Jun 2018 14:47:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59ElnpU026396; Sat, 9 Jun 2018 14:47:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806091447.w59ElnpU026396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 9 Jun 2018 14:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334880 - head/sys/dev/vnic X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/vnic X-SVN-Commit-Revision: 334880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:25 -0000 Author: andrew Date: Sat Jun 9 14:47:49 2018 New Revision: 334880 URL: https://svnweb.freebsd.org/changeset/base/334880 Log: In the ThunderX BGX network driver we were skipping the NULL terminator when parsing the phy type, however this is included in the length returned by OF_getprop. To fix this stop ignoring the terminator. PR: 228828 Reported by: sbruno Sponsored by: DARPA, AFRL Modified: head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Sat Jun 9 14:26:30 2018 (r334879) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Sat Jun 9 14:47:49 2018 (r334880) @@ -93,44 +93,44 @@ bgx_fdt_phy_mode_match(struct bgx *bgx, char *qlm_mode switch (bgx->qlm_mode) { case QLM_MODE_SGMII: type = "sgmii"; - sz = sizeof("sgmii") - 1; + sz = sizeof("sgmii"); offset = size - sz; break; case QLM_MODE_XAUI_1X4: type = "xaui"; - sz = sizeof("xaui") - 1; + sz = sizeof("xaui"); offset = size - sz; if (offset < 0) return (FALSE); if (strncmp(&qlm_mode[offset], type, sz) == 0) return (TRUE); type = "dxaui"; - sz = sizeof("dxaui") - 1; + sz = sizeof("dxaui"); offset = size - sz; break; case QLM_MODE_RXAUI_2X2: type = "raui"; - sz = sizeof("raui") - 1; + sz = sizeof("raui"); offset = size - sz; break; case QLM_MODE_XFI_4X1: type = "xfi"; - sz = sizeof("xfi") - 1; + sz = sizeof("xfi"); offset = size - sz; break; case QLM_MODE_XLAUI_1X4: type = "xlaui"; - sz = sizeof("xlaui") - 1; + sz = sizeof("xlaui"); offset = size - sz; break; case QLM_MODE_10G_KR_4X1: type = "xfi-10g-kr"; - sz = sizeof("xfi-10g-kr") - 1; + sz = sizeof("xfi-10g-kr"); offset = size - sz; break; case QLM_MODE_40G_KR4_1X4: type = "xlaui-40g-kr"; - sz = sizeof("xlaui-40g-kr") - 1; + sz = sizeof("xlaui-40g-kr"); offset = size - sz; break; default: @@ -155,37 +155,37 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name switch (bgx->qlm_mode) { case QLM_MODE_SGMII: type = "sgmii"; - sz = sizeof("sgmii") - 1; + sz = sizeof("sgmii"); break; case QLM_MODE_XAUI_1X4: type = "xaui"; - sz = sizeof("xaui") - 1; + sz = sizeof("xaui"); if (sz < size) return (FALSE); if (strncmp(phy_name, type, sz) == 0) return (TRUE); type = "dxaui"; - sz = sizeof("dxaui") - 1; + sz = sizeof("dxaui"); break; case QLM_MODE_RXAUI_2X2: type = "raui"; - sz = sizeof("raui") - 1; + sz = sizeof("raui"); break; case QLM_MODE_XFI_4X1: type = "xfi"; - sz = sizeof("xfi") - 1; + sz = sizeof("xfi"); break; case QLM_MODE_XLAUI_1X4: type = "xlaui"; - sz = sizeof("xlaui") - 1; + sz = sizeof("xlaui"); break; case QLM_MODE_10G_KR_4X1: type = "xfi-10g-kr"; - sz = sizeof("xfi-10g-kr") - 1; + sz = sizeof("xfi-10g-kr"); break; case QLM_MODE_40G_KR4_1X4: type = "xlaui-40g-kr"; - sz = sizeof("xlaui-40g-kr") - 1; + sz = sizeof("xlaui-40g-kr"); break; default: return (FALSE); From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:14 2018 Return-Path: Delivered-To: svn-src-head@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 27648101184F; Sat, 9 Jun 2018 17:16:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9F57B881; Sat, 9 Jun 2018 15:10:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80CF21F72D; Sat, 9 Jun 2018 15:10:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59FAe2b036769; Sat, 9 Jun 2018 15:10:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59FAdOT036763; Sat, 9 Jun 2018 15:10:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091510.w59FAdOT036763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 15:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334882 - in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Commit-Revision: 334882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:14 -0000 Author: kevans Date: Sat Jun 9 15:10:39 2018 New Revision: 334882 URL: https://svnweb.freebsd.org/changeset/base/334882 Log: stand: Consolidate checking for boot flags driven by environment vars e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these in multiple places, consolidate into common/ and allow a setting of "NO" for any of these to turn them off. This allows systems with multiple loader.conf(5) or loader.conf(5) overlay systems to easily turn off variables in later processed files by setting it to NO. Reported by: Nick Wolff @ iXsystems Reviewed by: imp Modified: head/stand/common/boot.c head/stand/common/bootstrap.h head/stand/common/metadata.c head/stand/efi/loader/bootinfo.c head/stand/i386/libi386/bootinfo.c head/stand/userboot/userboot/bootinfo.c Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/common/boot.c Sat Jun 9 15:10:39 2018 (r334882) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); */ #include +#include +#include #include #include "bootstrap.h" @@ -156,6 +158,20 @@ autoboot_maybe() cp = getenv("autoboot_delay"); if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) autoboot(-1, NULL); /* try to boot automatically */ +} + +int +bootenv_flags() +{ + int i, howto; + char *val; + + for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { + val = getenv(howto_names[i].ev); + if (val != NULL && strcasecmp(val, "no") != 0) + howto |= howto_names[i].mask; + } + return (howto); } static int Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/common/bootstrap.h Sat Jun 9 15:10:39 2018 (r334882) @@ -63,6 +63,7 @@ int parse(int *argc, char ***argv, const char *str); /* boot.c */ void autoboot_maybe(void); int getrootmount(char *rootdev); +int bootenv_flags(void); /* misc.c */ char *unargv(int argc, char *argv[]); Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/common/metadata.c Sat Jun 9 15:10:39 2018 (r334882) @@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #if defined(LOADER_FDT_SUPPORT) #include #endif @@ -100,7 +98,6 @@ md_getboothowto(char *kargs) char *cp; int howto; int active; - int i; /* Parse kargs */ howto = 0; @@ -153,10 +150,7 @@ md_getboothowto(char *kargs) } } - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; + howto |= bootenv_flags(); #if defined(__sparc64__) if (md_bootserial() != -1) howto |= RB_SERIAL; Modified: head/stand/efi/loader/bootinfo.c ============================================================================== --- head/stand/efi/loader/bootinfo.c Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/efi/loader/bootinfo.c Sat Jun 9 15:10:39 2018 (r334882) @@ -32,9 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include +#include #include #include #include @@ -72,15 +71,9 @@ bi_getboothowto(char *kargs) const char *sw; char *opts; char *console; - int howto, i; + int howto; - howto = 0; - - /* Get the boot options from the environment first. */ - for (i = 0; howto_names[i].ev != NULL; i++) { - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; - } + howto = bootenv_flags(); console = getenv("console"); if (console != NULL) { Modified: head/stand/i386/libi386/bootinfo.c ============================================================================== --- head/stand/i386/libi386/bootinfo.c Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/i386/libi386/bootinfo.c Sat Jun 9 15:10:39 2018 (r334882) @@ -43,7 +43,6 @@ bi_getboothowto(char *kargs) char *curpos, *next, *string; int howto; int active; - int i; int vidconsole; /* Parse kargs */ @@ -96,10 +95,7 @@ bi_getboothowto(char *kargs) cp++; } } - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; + howto |= bootenv_flags(); /* Enable selected consoles */ string = next = strdup(getenv("console")); Modified: head/stand/userboot/userboot/bootinfo.c ============================================================================== --- head/stand/userboot/userboot/bootinfo.c Sat Jun 9 14:50:38 2018 (r334881) +++ head/stand/userboot/userboot/bootinfo.c Sat Jun 9 15:10:39 2018 (r334882) @@ -43,7 +43,6 @@ bi_getboothowto(char *kargs) char *curpos, *next, *string; int howto; int active; - int i; int vidconsole; /* Parse kargs */ @@ -96,10 +95,8 @@ bi_getboothowto(char *kargs) cp++; } } - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; + + howto |= bootenv_flags(); /* Enable selected consoles */ string = next = strdup(getenv("console")); From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:32 2018 Return-Path: Delivered-To: svn-src-head@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 DB46B1011B53; Sat, 9 Jun 2018 17:16:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7214B77C7D; Sat, 9 Jun 2018 14:26:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34D6F1F085; Sat, 9 Jun 2018 14:26:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59EQVqF016790; Sat, 9 Jun 2018 14:26:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59EQVXX016789; Sat, 9 Jun 2018 14:26:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091426.w59EQVXX016789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 14:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334879 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:32 -0000 Author: kevans Date: Sat Jun 9 14:26:30 2018 New Revision: 334879 URL: https://svnweb.freebsd.org/changeset/base/334879 Log: lualoader: Add hook.lua(8) to tree Reviewed by: rpokala (w/ "All Rights Reserved" previously added) Differential Revision: https://reviews.freebsd.org/D14815 Added: head/stand/lua/hook.lua.8 (contents, props changed) Added: head/stand/lua/hook.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/hook.lua.8 Sat Jun 9 14:26:30 2018 (r334879) @@ -0,0 +1,94 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 9, 2018 +.Dt HOOK.LUA 8 +.Os +.Sh NAME +.Nm hook.lua +.Nd FreeBSD hook module +.Sh DESCRIPTION +.Nm +contains functionality for defining hook types and attaching hooks. +Hooks are functions used to attach custom behaviors at pre-defined points in +loader execution. +These pre-defined points are what we refer to as +.Dq hook types . +.Pp +Before using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local hook = require("hook") +.Ss Exported functions +The following functions are exported from +.Nm : +.Bl -tag -width hook.registerType -offset indent +.It Fn hook.registerType hooktype +Adds +.Ev hooktype +as a recognized hook type. +This allows functions to be added to run when hooks of this type are invoked +using +.Fn hook.runAll hooktype . +.It Fn hook.register hooktype hookfunc +Register +.Ev hookfunc +to be run when hooks of type +.Ev hooktype +are invoked. +.It Fn hook.runAll hooktype +Invoke all hooks registered for type +.Ev hooktype . +Hooks are invoked in the order in which they are registered. +.El +.Ss Hook Naming Guidelines +Hook names should consist of the name of the module they are defined in, as well +as a verb describing when the hook is executed, separated by a period. +For example, +.Dq config.reloaded +is defined in the +.Xr config.lua 8 +module and run when the configuration is reloaded. +.Sh EXAMPLES +To register a hook to be run when configuration is reloaded: +.Pp +.Bd -literal -offset indent -compact +local hook = require("hook") + +local function configuration_was_reloaded() + print("Configuration was reloaded!") +end + +hook.register("config.reloaded", configuration_was_reloaded) +.Ed +.Sh AUTHORS +The +.Nm +file was originally written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:40 2018 Return-Path: Delivered-To: svn-src-head@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 D9C4B1011CA6 for ; Sat, 9 Jun 2018 17:16:40 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA70E84D19 for ; Sat, 9 Jun 2018 15:54:42 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id B5039223B1 for ; Sat, 9 Jun 2018 15:54:42 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f176.google.com with SMTP id q7-v6so5060767ywd.9 for ; Sat, 09 Jun 2018 08:54:42 -0700 (PDT) X-Gm-Message-State: APt69E1wEt7Szorwn+O4ANPrTmY61A5modj2f4sGE1fECuiNb4yMLa6p zS4HtNQHlu7lL4CQ/88Jpn43zGmnNeUPbYe1cvPpqA== X-Google-Smtp-Source: ADUXVKK4Zz/CD5/07yLNJ36nT4h70Os3cvCLjtFiuob/SVNmeWMta2asEbDf5zVnzB7QCm3eJw+K1cPCugB1kj3AHIs= X-Received: by 2002:a0d:e812:: with SMTP id r18-v6mr6360017ywe.19.1528559682143; Sat, 09 Jun 2018 08:54:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 08:54:11 -0700 (PDT) In-Reply-To: <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> References: <201806090214.w592EYsJ056425@repo.freebsd.org> <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> From: Eitan Adler Date: Sat, 9 Jun 2018 08:54:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334864 - head/usr.bin/top To: Florian Smeets Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:41 -0000 On 8 June 2018 at 23:13, Florian Smeets wrote: > On 09.06.18 04:14, Eitan Adler wrote: >> Author: eadler >> Date: Sat Jun 9 02:14:33 2018 >> New Revision: 334864 >> URL: https://svnweb.freebsd.org/changeset/base/334864 >> >> Log: >> top(1): use a different command to toggle tid vs pid > > Thank you. > > You cannot start top with -T unless you add something like the following: I have a patch out for this, but svn is having issues right now (or at least I am). > Another issue I just found is that if you start top with -P some columns > don't show any values: > > It is correct if you start top with -TP or -HP, or if you start top -P > and then use H or T to switch back and forth. I'm not sure in which > revision this was broken, it works with r333899. I'm guessing this is because I forgot to initalize "prehead" somewhere. I'd like to rewrite the entire header creation, but will try and fix this. Thanks for the report! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:36 2018 Return-Path: Delivered-To: svn-src-head@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 A17DC1011C0F; Sat, 9 Jun 2018 17:16:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F91741A3; Sat, 9 Jun 2018 14:21:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59FB71F009; Sat, 9 Jun 2018 14:21:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59EL87R015121; Sat, 9 Jun 2018 14:21:08 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59EL8Vm015120; Sat, 9 Jun 2018 14:21:08 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806091421.w59EL8Vm015120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 9 Jun 2018 14:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334877 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 334877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:37 -0000 Author: kp Date: Sat Jun 9 14:21:07 2018 New Revision: 334877 URL: https://svnweb.freebsd.org/changeset/base/334877 Log: pf tests: Basic route-to tests Very basic route-to tests. These tests attempt to provoke PR 228782 for IPv4 and IPv6. A test failure will panic the machine. Added: head/tests/sys/netpfil/pf/route_to.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Sat Jun 9 14:17:06 2018 (r334876) +++ head/tests/sys/netpfil/pf/Makefile Sat Jun 9 14:21:07 2018 (r334877) @@ -8,7 +8,8 @@ TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= pass_block \ forward \ fragmentation \ - set_tos + set_tos \ + route_to ${PACKAGE}FILES+= utils.subr \ pft_ping.py Added: head/tests/sys/netpfil/pf/route_to.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/route_to.sh Sat Jun 9 14:21:07 2018 (r334877) @@ -0,0 +1,81 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Basic route-to test' + atf_set require.user root +} + +v4_body() +{ + pft_init + + epair_send=$(pft_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + epair_route=$(pft_mkepair) + ifconfig ${epair_route}a 203.0.113.1/24 up + + pft_mkjail alcatraz ${epair_send}b ${epair_route}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_route}b 203.0.113.2/24 up + jexec alcatraz route add -net 198.51.100.0/24 192.0.2.1 + jexec alcatraz pfctl -e + + # Attempt to provoke PR 228782 + pft_set_rules alcatraz "block all" "pass user 2" \ + "pass out route-to (${epair_route}b 203.0.113.1) from 192.0.2.2 to 198.51.100.1 no state" + jexec alcatraz nc -w 3 -s 192.0.2.2 198.51.100.1 22 + + # atf wants us to not return an error, but our netcat will fail + true +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Basic route-to test (IPv6)' + atf_set require.user root +} + +v6_body() +{ + pft_init + + epair_send=$(pft_mkepair) + ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + epair_route=$(pft_mkepair) + ifconfig ${epair_route}a inet6 2001:db8:43::1/64 up no_dad -ifdisabled + + pft_mkjail alcatraz ${epair_send}b ${epair_route}b + jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad + jexec alcatraz ifconfig ${epair_route}b inet6 2001:db8:43::2/64 up no_dad + jexec alcatraz route add -6 2001:db8:666::/64 2001:db8:42::2 + jexec alcatraz pfctl -e + + # Attempt to provoke PR 228782 + pft_set_rules alcatraz "block all" "pass user 2" \ + "pass out route-to (${epair_route}b 2001:db8:43::1) from 2001:db8:42::2 to 2001:db8:666::1 no state" + jexec alcatraz nc -6 -w 3 -s 2001:db8:42::2 2001:db8:666::1 22 + + # atf wants us to not return an error, but our netcat will fail + true +} + +v6_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "v6" +} From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:59 2018 Return-Path: Delivered-To: svn-src-head@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 31E361011F61; Sat, 9 Jun 2018 17:16:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 085D87DECE; Sat, 9 Jun 2018 12:26:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w59CQDGl018934; Sat, 9 Jun 2018 05:26:13 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w59CQDSb018933; Sat, 9 Jun 2018 05:26:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806091226.w59CQDSb018933@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334875 - head/sys/net In-Reply-To: <201806090957.w599vEK5085653@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Sat, 9 Jun 2018 05:26:13 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:59 -0000 > Author: ae > Date: Sat Jun 9 09:57:14 2018 > New Revision: 334875 > URL: https://svnweb.freebsd.org/changeset/base/334875 > > Log: > Explicitly change the link state when we assingn an address. > > Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that > after this link state information still not initialized properly. > This leads to problems with routing, since now interface has > IFCAP_LINKSTATE capability and a route is considered as working only > when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP() > macro). I was going to say something when the ability to up and down the loopback interfaces was added as it perturbed me but I could not put my finger on places it may cause problems so remained silent on the matter. Now that I see this issue, having lo0 go DOWN can kill a network that is using exported from lo0 into a routing protocol routes that are used for management purposes. How does Cisco, Juniper, etc at handle this? Do any of them or all of them allow you to "down" loopback? > > Reported by: Marek Zarychta > MFC after: 3 days > > Modified: > head/sys/net/if_loop.c > > Modified: head/sys/net/if_loop.c > ============================================================================== > --- head/sys/net/if_loop.c Sat Jun 9 04:54:36 2018 (r334874) > +++ head/sys/net/if_loop.c Sat Jun 9 09:57:14 2018 (r334875) > @@ -380,6 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > ifp->if_drv_flags |= IFF_DRV_RUNNING; > + if_link_state_change(ifp, LINK_STATE_UP); > /* > * Everything else is done at a higher level. > */ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jun 9 17:16:40 2018 Return-Path: Delivered-To: svn-src-head@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 830AB1011C90; Sat, 9 Jun 2018 17:16:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E799B806B5; Sat, 9 Jun 2018 15:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C97B41FF17; Sat, 9 Jun 2018 15:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59FqUMl060404; Sat, 9 Jun 2018 15:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59FqTDB060399; Sat, 9 Jun 2018 15:52:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091552.w59FqTDB060399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 15:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334885 - in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Commit-Revision: 334885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:16:40 -0000 Author: kevans Date: Sat Jun 9 15:52:29 2018 New Revision: 334885 URL: https://svnweb.freebsd.org/changeset/base/334885 Log: stand: One more trivial consolidation (setting environment from howto) Modified: head/stand/common/boot.c head/stand/common/bootstrap.h head/stand/efi/loader/main.c head/stand/i386/libi386/bootinfo.c head/stand/userboot/userboot/bootinfo.c Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/common/boot.c Sat Jun 9 15:52:29 2018 (r334885) @@ -174,6 +174,16 @@ bootenv_flags() return (howto); } +void +bootenv_set(int howto) +{ + int i; + + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + setenv(howto_names[i].ev, "YES", 1); +} + static int autoboot(int timeout, char *prompt) { Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/common/bootstrap.h Sat Jun 9 15:52:29 2018 (r334885) @@ -64,6 +64,7 @@ int parse(int *argc, char ***argv, const char *str); void autoboot_maybe(void); int getrootmount(char *rootdev); int bootenv_flags(void); +void bootenv_set(int); /* misc.c */ char *unargv(int argc, char *argv[]); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/efi/loader/main.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -549,9 +548,8 @@ main(int argc, CHAR16 *argv[]) } } } - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + + bootenv_set(howto); /* * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables Modified: head/stand/i386/libi386/bootinfo.c ============================================================================== --- head/stand/i386/libi386/bootinfo.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/i386/libi386/bootinfo.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" @@ -130,11 +129,8 @@ bi_getboothowto(char *kargs) void bi_setboothowto(int howto) { - int i; - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + bootenv_set(howto); } /* Modified: head/stand/userboot/userboot/bootinfo.c ============================================================================== --- head/stand/userboot/userboot/bootinfo.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/userboot/userboot/bootinfo.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bootstrap.h" #include "libuserboot.h" @@ -131,11 +130,8 @@ bi_getboothowto(char *kargs) void bi_setboothowto(int howto) { - int i; - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + bootenv_set(howto); } /* From owner-svn-src-head@freebsd.org Sat Jun 9 17:35:38 2018 Return-Path: Delivered-To: svn-src-head@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 61F3B10155D3; Sat, 9 Jun 2018 17:35:38 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA26B8629A; Sat, 9 Jun 2018 17:35:37 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.173.237]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MWhRH-1fmR9J0Ax9-00XsXS; Sat, 09 Jun 2018 19:35:34 +0200 Date: Sat, 9 Jun 2018 19:35:00 +0200 From: "O. Hartmann" To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201806091510.w59FAnIW036815@repo.freebsd.org> References: <201806091510.w59FAnIW036815@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:1PCfqsaD7jT6ohHyVf4mjms+qifUjeTn/Epem90/Mrlu2obcL0K HE+UmTCras18nTa5CPNCLBhycexXPeIG5FHoWSp40QR0BDPmgzlH/9RyUTKeAPdNUmVQPhy BKnriq6FmL9SBVEvKPbU3bYcjTb7AcOgR1RAj6TDzGvYBCuFRLy4OCEcS2uGm4okUYR70ql MPkydU5aW0rj5RhwKSxQA== X-UI-Out-Filterresults: notjunk:1;V01:K0:kiGU8cZsNyA=:5u95ZVKqR51L90X4BOo5qE 94c8TMLIMhoKTF4ONAVTsdaIKblcuqL5RZV2eIY+htidDuB248OHi7WzhEk4TBLJYQKj9qn4e pAmLvy0/E3gjLlj6QACFqajVixqE9MGGjK81yKNzUMv9WwBGkrBGBW1O6MTMu0oOp/urlv4o1 +2YYWuX7d6Lffnt3gK4fTLu3jY7obwzZAAsgrKKq7Xy7ny0ydx1XEn4jkp6wUSRRtWAggRZRQ G7jVVPwvx6jzCm5rF/C2Yz85h3yoFc+MEPP7uiXnily+ZRFk+ianigRPKOWY5j7xH1gfizayH 0XUiNX060W8+RsSsucB/Vg1beNLteVqh4aTo41t+cwhIgAaAul15jJsTf+HLhFOyoIQmEh42C mVNaUMGUacBp9VROyBXPTHHTVVJWDDM1Dx+FLzde5jQSsNHDFmwsMjXg9VP+1qkVfz55NzQbE D/g/+Ou0AXZCF2oX60ia1rv0pMYfUR/kok2WU3lnfYmoaXLgSXuhiLXsEGnacrylTCL10HVdE HwsVfbJUNOPTBqyN5cRVLtHUqqZMGHl0dxJRmlSJZdLGyeFAQDfwt5ydB3Jf54cDWod3jPZLZ wpNDHBwUD8GI8twEX2eXYCTgmzG++RBlYXlM+P8xSq0WtcHrHwKgLrnQyE0g7viK4ww6kMUiZ h+lVnqnKS7KV7abmbHZiupWAWukTIJY9dTTM50tak7XscpR/iOrE8W5oz67Sq3Udbw09ZdWFC 7vO0WFIEXq+3AV/Zo1vVeRNoN+ikKVOwzGWk6eaxc0LV91NVvVy8O86pJl/VD8rnl4TCn2RtD 6CUNco0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:35:38 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFNh dCwgOSBKdW4gMjAxOCAxNToxMDo0OSArMDAwMCAoVVRDKQ0KTWFyayBKb2huc3RvbiA8bWFya2pA RnJlZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBtYXJrag0KPiBEYXRlOiBTYXQgSnVu ICA5IDE1OjEwOjQ5IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzQ4ODMNCj4gVVJMOiBodHRwczov L3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzQ4ODMNCj4gDQo+IExvZzoNCj4g ICBEb24ndCBwcm9jZXNzIERXQVJGIGdlbmVyYXRlZCBmcm9tIG5vbi1DL0MrKyBjb2RlLg0KPiAg IA0KPiAgIGN0ZmNvbnZlcnQoMSkgaXMgbm90IGRlc2lnbmVkIHRvIGhhbmRsZSBEV0FSRiBnZW5l cmF0ZWQgZnJvbSBzdWNoIGNvZGUsDQo+ICAgYW5kIHdpbGwgZ2VuZXJhbGx5IGZhaWwgaW4gbm9u LW9idmlvdXMgd2F5cy4gIFVzZSBhbiBleHBsaWNpdCBjaGVjayB0bw0KPiAgIGhlbHAgY2F0Y2gg c3VjaCBwb3RlbnRpYWwgZmFpbHVyZXMuDQo+ICAgDQo+ICAgUmVwb3J0ZWQgYnk6CUpvaGFubmVz IEx1bmRiZXJnIDxqb2hhbHVuMEBnbWFpbC5jb20+DQo+ICAgTUZDIGFmdGVyOgkyIHdlZWtzDQo+ IA0KPiBNb2RpZmllZDoNCj4gICBoZWFkL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy90b29scy9j dGYvY3Z0L2R3YXJmLmMNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL2NkZGwvY29udHJpYi9vcGVuc29s YXJpcy90b29scy9jdGYvY3Z0L2R3YXJmLmMNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0t LSBoZWFkL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy90b29scy9jdGYvY3Z0L2R3YXJmLmMJU2F0 IEp1biAgOSAxNToxMDozOQ0KPiAyMDE4CShyMzM0ODgyKSArKysgaGVhZC9jZGRsL2NvbnRyaWIv b3BlbnNvbGFyaXMvdG9vbHMvY3RmL2N2dC9kd2FyZi5jDQo+IFNhdCBKdW4gIDkgMTU6MTA6NDkg MjAxOAkocjMzNDg4MykgQEAgLTE5MDEsNyArMTkwMSw3IEBAIHNob3VsZF9oYXZlX2R3YXJmKEVs Zg0KPiAqZWxmKSBpbnQNCj4gIGR3X3JlYWQodGRhdGFfdCAqdGQsIEVsZiAqZWxmLCBjaGFyICpm aWxlbmFtZSBfX3VudXNlZCkNCj4gIHsNCj4gLQlEd2FyZl9VbnNpZ25lZCBhYmJvZmYsIGhkcmxl biwgbnh0aGRyOw0KPiArCUR3YXJmX1Vuc2lnbmVkIGFiYm9mZiwgaGRybGVuLCBsYW5nLCBueHRo ZHI7DQo+ICAJRHdhcmZfSGFsZiB2ZXJzLCBhZGRyc3osIG9mZnN6Ow0KPiAgCUR3YXJmX0RpZSBj dSA9IDA7DQo+ICAJRHdhcmZfRGllIGNoaWxkID0gMDsNCj4gQEAgLTE5NDEsOCArMTk0MSw4IEBA IGR3X3JlYWQodGRhdGFfdCAqdGQsIEVsZiAqZWxmLCBjaGFyICpmaWxlbmFtZSBfX3VudXNlZA0K PiAgCX0NCj4gIA0KPiAgCWlmICgocmMgPSBkd2FyZl9uZXh0X2N1X2hlYWRlcl9iKGR3LmR3X2R3 LCAmaGRybGVuLCAmdmVycywgJmFiYm9mZiwNCj4gLQkJJmFkZHJzeiwgJm9mZnN6LCBOVUxMLCAm bnh0aGRyLCAmZHcuZHdfZXJyKSkgIT0gRFdfRExWX09LKSB7DQo+IC0JCWlmIChkdy5kd19lcnIu ZXJyX2Vycm9yID09IAlEV19ETEVfTk9fRU5UUlkpDQo+ICsJICAgICZhZGRyc3osICZvZmZzeiwg TlVMTCwgJm54dGhkciwgJmR3LmR3X2VycikpICE9IERXX0RMVl9PSykgew0KPiArCQlpZiAoZHcu ZHdfZXJyLmVycl9lcnJvciA9PSBEV19ETEVfTk9fRU5UUlkpDQo+ICAJCQlleGl0KDApOw0KPiAg CQllbHNlDQo+ICAJCQl0ZXJtaW5hdGUoInJjID0gJWQgJXNcbiIsIHJjLCBkd2FyZl9lcnJtc2co ZHcuZHdfZXJyKSk7DQo+IEBAIC0xOTcxLDYgKzE5NzEsMjUgQEAgZHdfcmVhZCh0ZGF0YV90ICp0 ZCwgRWxmICplbGYsIGNoYXIgKmZpbGVuYW1lIF9fdW51c2VkDQo+ICAJCWRlYnVnKDEsICJEV0FS RiBlbWl0dGVyOiAlc1xuIiwgcHJvZCk7DQo+ICAJCWZyZWUocHJvZCk7DQo+ICAJfQ0KPiArDQo+ ICsJaWYgKGR3YXJmX2F0dHJ2YWxfdW5zaWduZWQoY3UsIERXX0FUX2xhbmd1YWdlLCAmbGFuZywg JmR3LmR3X2VycikgPT0gMCkNCj4gKwkJc3dpdGNoIChsYW5nKSB7DQo+ICsJCWNhc2UgRFdfTEFO R19DOg0KPiArCQljYXNlIERXX0xBTkdfQzg5Og0KPiArCQljYXNlIERXX0xBTkdfQzk5Og0KPiAr CQljYXNlIERXX0xBTkdfQzExOg0KPiArCQljYXNlIERXX0xBTkdfQ19wbHVzX3BsdXM6DQo+ICsJ CWNhc2UgRFdfTEFOR19DX3BsdXNfcGx1c18wMzoNCj4gKwkJY2FzZSBEV19MQU5HX0NfcGx1c19w bHVzXzExOg0KPiArCQljYXNlIERXX0xBTkdfQ19wbHVzX3BsdXNfMTQ6DQo+ICsJCQlicmVhazsN Cj4gKwkJZGVmYXVsdDoNCj4gKwkJCXRlcm1pbmF0ZSgiZmlsZSBjb250YWlucyBEV0FSRiBmb3Ig dW5zdXBwb3J0ZWQgIg0KPiArCQkJICAgICJsYW5ndWFnZSAlZCIsIGxhbmcpOw0KPiArCQl9DQo+ ICsJZWxzZQ0KPiArCQl3YXJuaW5nKCJkaWUgJWxsdTogZmFpbGVkIHRvIGdldCBsYW5ndWFnZSBh dHRyaWJ1dGU6ICVzXG4iLA0KPiArCQkgICAgZGllX29mZigmZHcsIGN1KSwgZHdhcmZfZXJybXNn KGR3LmR3X2VycikpOw0KPiAgDQo+ICAJaWYgKChkdy5kd19jdW5hbWUgPSBkaWVfbmFtZSgmZHcs IGN1KSkgIT0gTlVMTCkgew0KPiAgCQljaGFyICpiYXNlID0geHN0cmR1cChiYXNlbmFtZShkdy5k d19jdW5hbWUpKTsNCj4gX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnIG1haWxpbmcgbGlzdA0KPiBodHRwczov L2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVu c3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4tc3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJl ZWJzZC5vcmciDQpUaGlzIGNvbW1pdCBtYWtlcyBidWlsZHdvcmxkIChXSVRIX01FVEFfTU9ERSkg ZmFpbGluZzoNCg0KWy4uLl0NCj09PT4gY2RkbC91c3IuYmluL2N0ZmNvbnZlcnQgKG9iaixhbGws aW5zdGFsbCkNCkJ1aWxkaW5nIC91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL29iai10 b29scy9jZGRsL3Vzci5iaW4vY3RmY29udmVydC9kd2FyZi5vDQotIC0tLSBkd2FyZi5vIC0tLQ0K L3Vzci9zcmMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3Rvb2xzL2N0Zi9jdnQvZHdhcmYuYzox OTgwOjg6IGVycm9yOiB1c2Ugb2YgdW5kZWNsYXJlZA0KaWRlbnRpZmllciAnRFdfTEFOR19DMTEn IGNhc2UgRFdfTEFOR19DMTE6DQogICAgICAgICAgICAgICAgICAgICBeDQovdXNyL3NyYy9jZGRs L2NvbnRyaWIvb3BlbnNvbGFyaXMvdG9vbHMvY3RmL2N2dC9kd2FyZi5jOjE5ODI6ODogZXJyb3I6 IHVzZSBvZiB1bmRlY2xhcmVkDQppZGVudGlmaWVyICdEV19MQU5HX0NfcGx1c19wbHVzXzAzJyBj YXNlIERXX0xBTkdfQ19wbHVzX3BsdXNfMDM6DQogICAgICAgICAgICAgICAgICAgICBeDQovdXNy L3NyYy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdG9vbHMvY3RmL2N2dC9kd2FyZi5jOjE5ODM6 ODogZXJyb3I6IHVzZSBvZiB1bmRlY2xhcmVkDQppZGVudGlmaWVyICdEV19MQU5HX0NfcGx1c19w bHVzXzExJyBjYXNlIERXX0xBTkdfQ19wbHVzX3BsdXNfMTE6DQogICAgICAgICAgICAgICAgICAg ICBeDQovdXNyL3NyYy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdG9vbHMvY3RmL2N2dC9kd2Fy Zi5jOjE5ODQ6ODogZXJyb3I6IHVzZSBvZiB1bmRlY2xhcmVkDQppZGVudGlmaWVyICdEV19MQU5H X0NfcGx1c19wbHVzXzE0JyBjYXNlIERXX0xBTkdfQ19wbHVzX3BsdXNfMTQ6DQogICAgICAgICAg ICAgICAgICAgICBeDQo0IGVycm9ycyBnZW5lcmF0ZWQuDQoqKiogW2R3YXJmLm9dIEVycm9yIGNv ZGUgMQ0KDQoNCmtpbmQgcmVnYXJkcywNCg0Kb2gNCg0KDQotIC0tIA0KTy4gSGFydG1hbm4NCg0K SWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVpbmVyIERh dGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVpbnVuZ3Nm b3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJR05BVFVSRS0t LS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVDV3h3UDN3 QUtDUkRTNTI4ZnlGaFkNCmxKT2ZBZ0NXOWlKbC8wcXhQU240Q1dpZHIrWmlaU1VYYy9BRXZ0RlZN RlBCOUpGZWRaQnNKUkJRR3Ywa3RXczANCnN1QWE5cElQMDNTZ1d2Y28wdkVTaTZBeGZGWWlBZjlZ QjJ1RDI1WGlWT09sK2xjRUlaM2gvb0dyUnZlak5SMDINCnBwcStXUGFpVFVJTldEYjI2bDVRMXVn bDFVVTlsd2hyelhnSkdoZGo5U3RTdnhpWjZPdUoNCj16eUlNDQotLS0tLUVORCBQR1AgU0lHTkFU VVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Sat Jun 9 17:51:08 2018 Return-Path: Delivered-To: svn-src-head@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 9F9631017723; Sat, 9 Jun 2018 17:51:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (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 304686867C; Sat, 9 Jun 2018 17:51:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x241.google.com with SMTP id 16-v6so1304608itl.5; Sat, 09 Jun 2018 10:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/pXQ/uw67nQAi7tmUCNfw2qGydHkGc4hmrsmfE+UahQ=; b=PmR35CWMFHGzzcDShT9jHR1P07EHhG6k53dOGsudrTC+ulZncrMnV9qUaccvyPzdEX 3HQrEIWG6hfRGGqDaY33AnSqcKdGhtWTubNzbcdYp/ZOVJxMiiqdAtmNDenFMETAOJoK FhwyKsz0Al0PgRIBjZ1otV3aMheULGbB+s0IYERzVS1n7zYDsLXXEiFntotq5uo0fyZC +WqA6AIz6faiskjp+EBt3C8XztHOiVl+gm71a9cRGlz07hwoFvkzJudIUZo0Em1amWl3 FwDF9cefo2BT+QAhjkTrXUjTW4gEfgBj91advF4P0Vqy5ebZ9FIXOrhmYCIgkBs7np3/ 1sYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/pXQ/uw67nQAi7tmUCNfw2qGydHkGc4hmrsmfE+UahQ=; b=cDmxpKlNNGDS5kETiA3kaHEBbunuI6xrCJyQDtkCIzrLETTh8CP00rPmIFmoKCdYoJ PjDyQ+mp70PAySS6nSqvL6DcTktLsH3FqS3WXI3iXzRV1KV2Aa5cbsHhp5LzY9/p1Roz bvSqNSWdQonsI0cu9Fk8fKD15nAo2EiNcUyZEk/vS95hv95QRkBPW0W6hFLpXUpE4PT+ dGHbOm0c5qrAcenpxPA7xqE8vb6G2glSZcUh97aYgkQdrYN5ZJwzdEE+SqT8sDko2pfC mB/+LhQb00uETuv5VjyO8o7EM1fzJ5aKxPdT38/3JpRjCkG2XlScqKvfpt16SN4TVtfp rZ4A== X-Gm-Message-State: APt69E3HJesfZ0yPOA0zhXPOcqZMxl/jt2NRZdkxg0/Al3+y/t7PaZCI oXTloExy48ZlyfSc9vHszZvisr/U X-Google-Smtp-Source: ADUXVKJHvs45UD1tBA3enlqEjY3opvEnvA3PfBNq+itWiPrE+rcQRCgGNqXOW6upcE3hG0UnzcMkRg== X-Received: by 2002:a24:42d2:: with SMTP id i201-v6mr1866222itb.125.1528566667280; Sat, 09 Jun 2018 10:51:07 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id z11-v6sm8165947ioc.8.2018.06.09.10.51.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 10:51:06 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 13:51:04 -0400 From: Mark Johnston To: John Baldwin Cc: Matthew Macy , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys Message-ID: <20180609175104.GC1394@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:51:08 -0000 On Sat, Jun 09, 2018 at 08:11:15AM -0400, John Baldwin wrote: > On 6/8/18 12:34 PM, Matthew Macy wrote: > >> The fact that our NMI handler isn't re-entrant can lead to subtle > >> problems. If while executing the NMI handler we hit a dtrace > >> probe or DDB breakpoint, the iret executed upon return to the handler > >> will re-enable NMIs. Then, if a second NMI arrives before the handler > >> for the first has returned, the trapframe will be clobbered. Did you > >> rule out an issue like this? > > > > No, but it happened instantly on all CPUs an a non-debug kernel 100% > > of the time after I changed pmc_process_interrupt earlier this week. > > My voodoo fix now avoids it. What you're describing sounds episodic > > and doesn't sound like it would be fixed / worked around by my change. > > OTOH, a compiler bug will crop up in other places. It is best to run > it to ground. Can you describe what the bug was in more detail? > It would probably not be hard to come up with something you can run > creduce against to get down to a test case. If you do that, the > LLVM folks are quite helpful and able at fixing the issue which fixes > it in more places than just here. The bug is the rdtscp() intrinsic added in r334746 is wrong. It was just copied from rdtsc(), but unlike rdtsc, rdtscp clobbers rcx, which is the register containing the tf pointer. From owner-svn-src-head@freebsd.org Sat Jun 9 17:40:32 2018 Return-Path: Delivered-To: svn-src-head@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 4CDF31016342; Sat, 9 Jun 2018 17:40:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E455B872AA; Sat, 9 Jun 2018 17:40:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C582C20F42; Sat, 9 Jun 2018 17:40:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59HeVSF010667; Sat, 9 Jun 2018 17:40:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59HeVx1010665; Sat, 9 Jun 2018 17:40:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806091740.w59HeVx1010665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 9 Jun 2018 17:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334886 - in head: . tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . tools/build/mk X-SVN-Commit-Revision: 334886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:40:32 -0000 Author: dim Date: Sat Jun 9 17:40:31 2018 New Revision: 334886 URL: https://svnweb.freebsd.org/changeset/base/334886 Log: Add missed libc++ entries to (Optional)ObsoleteFiles.inc Some of these were removed during the libc++ 5.0.0 import, others were added in the libc++ 6.0.0 import. MFC after: 3 days Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jun 9 15:52:29 2018 (r334885) +++ head/ObsoleteFiles.inc Sat Jun 9 17:40:31 2018 (r334886) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180609: obsolete libc++ files missed from the 5.0.0 import +OLD_FILES+=usr/include/c++/v1/__refstring +OLD_FILES+=usr/include/c++/v1/__undef_min_max +OLD_FILES+=usr/include/c++/v1/tr1/__refstring +OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max # 20180607: remove nls support from grep OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jun 9 15:52:29 2018 (r334885) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jun 9 17:40:31 2018 (r334886) @@ -4009,7 +4009,6 @@ OLD_FILES+=usr/include/c++/v1/__libcpp_version OLD_FILES+=usr/include/c++/v1/__locale OLD_FILES+=usr/include/c++/v1/__mutex_base OLD_FILES+=usr/include/c++/v1/__nullptr -OLD_FILES+=usr/include/c++/v1/__refstring OLD_FILES+=usr/include/c++/v1/__split_buffer OLD_FILES+=usr/include/c++/v1/__sso_allocator OLD_FILES+=usr/include/c++/v1/__std_stream @@ -4062,6 +4061,7 @@ OLD_FILES+=usr/include/c++/v1/experimental/__memory OLD_FILES+=usr/include/c++/v1/experimental/algorithm OLD_FILES+=usr/include/c++/v1/experimental/any OLD_FILES+=usr/include/c++/v1/experimental/chrono +OLD_FILES+=usr/include/c++/v1/experimental/coroutine OLD_FILES+=usr/include/c++/v1/experimental/deque OLD_FILES+=usr/include/c++/v1/experimental/dynarray OLD_FILES+=usr/include/c++/v1/experimental/filesystem @@ -4071,6 +4071,7 @@ OLD_FILES+=usr/include/c++/v1/experimental/iterator OLD_FILES+=usr/include/c++/v1/experimental/list OLD_FILES+=usr/include/c++/v1/experimental/map OLD_FILES+=usr/include/c++/v1/experimental/memory_resource +OLD_FILES+=usr/include/c++/v1/experimental/numeric OLD_FILES+=usr/include/c++/v1/experimental/optional OLD_FILES+=usr/include/c++/v1/experimental/propagate_const OLD_FILES+=usr/include/c++/v1/experimental/ratio @@ -4152,7 +4153,6 @@ OLD_FILES+=usr/include/c++/v1/tr1/__libcpp_version OLD_FILES+=usr/include/c++/v1/tr1/__locale OLD_FILES+=usr/include/c++/v1/tr1/__mutex_base OLD_FILES+=usr/include/c++/v1/tr1/__nullptr -OLD_FILES+=usr/include/c++/v1/tr1/__refstring OLD_FILES+=usr/include/c++/v1/tr1/__split_buffer OLD_FILES+=usr/include/c++/v1/tr1/__sso_allocator OLD_FILES+=usr/include/c++/v1/tr1/__std_stream @@ -4160,7 +4160,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/__string OLD_FILES+=usr/include/c++/v1/tr1/__threading_support OLD_FILES+=usr/include/c++/v1/tr1/__tree OLD_FILES+=usr/include/c++/v1/tr1/__tuple -OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max +OLD_FILES+=usr/include/c++/v1/tr1/__undef_macros OLD_FILES+=usr/include/c++/v1/tr1/algorithm OLD_FILES+=usr/include/c++/v1/tr1/any OLD_FILES+=usr/include/c++/v1/tr1/array From owner-svn-src-head@freebsd.org Sat Jun 9 17:47:57 2018 Return-Path: Delivered-To: svn-src-head@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 8B11E10172B1; Sat, 9 Jun 2018 17:47:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF506804D; Sat, 9 Jun 2018 17:47:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F428210F4; Sat, 9 Jun 2018 17:47:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59Hluiw015701; Sat, 9 Jun 2018 17:47:56 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59Hluda015700; Sat, 9 Jun 2018 17:47:56 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806091747.w59Hluda015700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 9 Jun 2018 17:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334887 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 334887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:47:57 -0000 Author: allanjude Date: Sat Jun 9 17:47:56 2018 New Revision: 334887 URL: https://svnweb.freebsd.org/changeset/base/334887 Log: Change rootgen.sh to use the default ZFS boot environment name Reviewed by: imp (maintainer) Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15699 Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sat Jun 9 17:40:31 2018 (r334886) +++ head/tools/boot/rootgen.sh Sat Jun 9 17:47:56 2018 (r334887) @@ -96,7 +96,7 @@ mk_nogeli_gpt_zfs_legacy() { # install-boot will make this bootable zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2 zpool set bootfs=${pool} ${pool} - zfs create -o mountpoint=/ ${pool}/ROOT + zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need cpsys ${src} ${mntpt} df @@ -109,9 +109,9 @@ EOF cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko ls -las ${mntpt}/boot # end tweaks - zfs umount -f ${pool}/ROOT - zfs set mountpoint=none ${pool}/ROOT - zpool set bootfs=${pool}/ROOT ${pool} + zfs umount -f ${pool}/ROOT/default + zfs set mountpoint=none ${pool}/ROOT/default + zpool set bootfs=${pool}/ROOT/default ${pool} zpool set autoexpand=on ${pool} zpool export ${pool} ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md} From owner-svn-src-head@freebsd.org Sat Jun 9 17:49:45 2018 Return-Path: Delivered-To: svn-src-head@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 EB68C10175C1; Sat, 9 Jun 2018 17:49:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1BDF68403; Sat, 9 Jun 2018 17:49:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84898210F9; Sat, 9 Jun 2018 17:49:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59Hnias015827; Sat, 9 Jun 2018 17:49:44 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59HniGp015825; Sat, 9 Jun 2018 17:49:44 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806091749.w59HniGp015825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 9 Jun 2018 17:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334888 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 334888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:49:45 -0000 Author: allanjude Date: Sat Jun 9 17:49:43 2018 New Revision: 334888 URL: https://svnweb.freebsd.org/changeset/base/334888 Log: Add ZFS+GPT EFI and LEGACY+EFI to rootgen.sh and installboot.sh Reviewed by: imp (maintainer) Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15700 Modified: head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Sat Jun 9 17:47:56 2018 (r334887) +++ head/tools/boot/install-boot.sh Sat Jun 9 17:49:43 2018 (r334888) @@ -51,6 +51,37 @@ boot_nogeli_gpt_ufs_legacy() { exit 0 } +boot_nogeli_gpt_zfs_uefi() { + dev=$1 + dst=$2 + + idx=$(find-part $dev "efi") + if [ -z "$idx" ] ; then + die "No efi ESP partition found" + fi + doit gpart bootcode -p ${efi2} -i $idx $dev + exit 0 +} + +boot_nogeli_gpt_zfs_both() { + dev=$1 + dst=$2 + + # XXX: Should this be copy/pasted, or should it call both _uefi and _legacy + idx=$(find-part $dev "efi") + if [ -z "$idx" ] ; then + die "No efi ESP partition found" + fi + doit gpart bootcode -p ${efi2} -i $idx $dev + + idx=$(find-part $dev "freebsd-boot") + if [ -z "$idx" ] ; then + die "No freebsd-boot partition found" + fi + doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev + exit 0 +} + boot_nogeli_mbr_zfs_legacy() { dev=$1 dst=$2 @@ -133,6 +164,10 @@ dev=$1 gpt0=${DESTDIR}/boot/pmbr gpt2=${DESTDIR}/boot/gptboot gptzfs2=${DESTDIR}/boot/gptzfsboot + +# For gpt + EFI we install the ESP +# XXX This should use newfs or makefs, but it deosn't yet +efi2=${DESTDIR}/boot/boot1.efifat # For MBR, we have lots of choices, but select boot0 mbr0=${DESTDIR}/boot/boot0 Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sat Jun 9 17:47:56 2018 (r334887) +++ head/tools/boot/rootgen.sh Sat Jun 9 17:49:43 2018 (r334888) @@ -119,9 +119,84 @@ EOF } mk_nogeli_gpt_zfs_uefi() { + src=$1 + img=$2 + mntpt=$3 + geli=$4 + scheme=$5 + fs=$6 + bios=$7 + pool=nogeli-gpt-zfs-uefi + + dd if=/dev/zero of=${img} count=1 seek=$((200 * 1024 * 1024 / 512)) + md=$(mdconfig -f ${img}) + gpart create -s gpt ${md} + gpart add -t efi -s 800k -a 4k ${md} + gpart add -t freebsd-zfs -l root $md + # install-boot will make this bootable + zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2 + zpool set bootfs=${pool} ${pool} + zfs create -po mountpoint=/ ${pool}/ROOT/default + # NB: The online guides go nuts customizing /var and other mountpoints here, no need + cpsys ${src} ${mntpt} + df + # need to make a couple of tweaks + cat > ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < $sh - echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" >> $sh } # arm @@ -288,7 +363,7 @@ qemu_i386_both() sh=$2 echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh - echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" >> $sh } # mips @@ -314,8 +389,15 @@ DESTDIR=${OBJDIR}/boot-tree rm -rf ${DESTDIR} mkdir -p ${DESTDIR}/boot/defaults mkdir -p ${DESTDIR}/boot/kernel +cp /boot/boot0 ${DESTDIR}/boot +cp /boot/boot0sio ${DESTDIR}/boot +cp /boot/pmbr ${DESTDIR}/boot +cp /boot/boot ${DESTDIR}/boot # XXX boot1 exists only on sparc64 cp /boot/boot1 ${DESTDIR}/boot +cp /boot/boot1.efifat ${DESTDIR}/boot +cp /boot/gptboot ${DESTDIR}/boot +cp /boot/gptzfsboot ${DESTDIR}/boot cp /boot/loader ${DESTDIR}/boot cp /boot/kernel/kernel ${DESTDIR}/boot/kernel echo -h -D -S115200 > ${DESTDIR}/boot.config From owner-svn-src-head@freebsd.org Sat Jun 9 17:56:23 2018 Return-Path: Delivered-To: svn-src-head@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 59DD210186DA; Sat, 9 Jun 2018 17:56:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAECD69129; Sat, 9 Jun 2018 17:56:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B858AF1F3; Sat, 9 Jun 2018 17:56:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 05DB89EC; Sat, 9 Jun 2018 17:56:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id o-Qjp_yXYcjC; Sat, 9 Jun 2018 17:56:18 +0000 (UTC) Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com D378B9E7 To: Mark Johnston , "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> Date: Sat, 9 Jun 2018 13:56:18 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180609173951.GB1394@pesky> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:56:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs Content-Type: multipart/mixed; boundary="N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB"; protected-headers="v1" From: Bryan Drewery To: Mark Johnston , "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> In-Reply-To: <20180609173951.GB1394@pesky> --N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/9/18 1:39 PM, Mark Johnston wrote: > On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA512 >> >> Am Sat, 9 Jun 2018 15:10:49 +0000 (UTC) >> Mark Johnston schrieb: >> >>> Author: markj >>> Date: Sat Jun 9 15:10:49 2018 >>> New Revision: 334883 >>> URL: https://svnweb.freebsd.org/changeset/base/334883 >>> >>> Log: >>> Don't process DWARF generated from non-C/C++ code. >>> =20 >>> ctfconvert(1) is not designed to handle DWARF generated from such c= ode, >>> and will generally fail in non-obvious ways. Use an explicit check= to >>> help catch such potential failures. >>> =20 >>> Reported by: Johannes Lundberg >>> MFC after: 2 weeks >>> >>> Modified: >>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c >>> >>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15= :10:39 >>> 2018 (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.= c >>> Sat Jun 9 15:10:49 2018 (r334883) @@ -1901,7 +1901,7 @@ should_have_= dwarf(Elf >>> *elf) int >>> dw_read(tdata_t *td, Elf *elf, char *filename __unused) >>> { >>> - Dwarf_Unsigned abboff, hdrlen, nxthdr; >>> + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr; >>> Dwarf_Half vers, addrsz, offsz; >>> Dwarf_Die cu =3D 0; >>> Dwarf_Die child =3D 0; >>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename _= _unused >>> } >>> =20 >>> if ((rc =3D dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abbof= f, >>> - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) !=3D DW_DLV_OK) { >>> - if (dw.dw_err.err_error =3D=3D DW_DLE_NO_ENTRY) >>> + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) !=3D DW_DLV_OK) { >>> + if (dw.dw_err.err_error =3D=3D DW_DLE_NO_ENTRY) >>> exit(0); >>> else >>> terminate("rc =3D %d %s\n", rc, dwarf_errmsg(dw.dw_err)); >>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename = __unused >>> debug(1, "DWARF emitter: %s\n", prod); >>> free(prod); >>> } >>> + >>> + if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) =3D= =3D 0) >>> + switch (lang) { >>> + case DW_LANG_C: >>> + case DW_LANG_C89: >>> + case DW_LANG_C99: >>> + case DW_LANG_C11: >>> + case DW_LANG_C_plus_plus: >>> + case DW_LANG_C_plus_plus_03: >>> + case DW_LANG_C_plus_plus_11: >>> + case DW_LANG_C_plus_plus_14: >>> + break; >>> + default: >>> + terminate("file contains DWARF for unsupported " >>> + "language %d", lang); >>> + } >>> + else >>> + warning("die %llu: failed to get language attribute: %s\n", >>> + die_off(&dw, cu), dwarf_errmsg(dw.dw_err)); >>> =20 >>> if ((dw.dw_cuname =3D die_name(&dw, cu)) !=3D NULL) { >>> char *base =3D xstrdup(basename(dw.dw_cuname)); >>> _______________________________________________ >>> svn-src-head@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= g" >> This commit makes buildworld (WITH_META_MODE) failing: >=20 > I added these identifiers in r334881, and the CI build is passing. Migh= t > this be a problem with META_MODE? >=20 >> [...] >> =3D=3D=3D> cddl/usr.bin/ctfconvert (obj,all,install) >> Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfco= nvert/dwarf.o obj-tools means it is trying to build a HOST NATIVE version of this. Where are these defined? In this case they need to be defined in /usr/include already unless the build has -I.CURDIR/somewhere/to/headers instead. >> - --- dwarf.o --- >> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error:= use of undeclared >> identifier 'DW_LANG_C11' case DW_LANG_C11: >> ^ >> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error:= use of undeclared >> identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03: >> ^ >> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error:= use of undeclared >> identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11: >> ^ >> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error:= use of undeclared >> identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14: >> ^ >> 4 errors generated. >> *** [dwarf.o] Error code 1 --=20 Regards, Bryan Drewery --N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB-- --xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlscFMIACgkQNddxu25G l88pIAgApDMCc6Fp4TsWioe0uuL9ro98tgHa2rtemKiyB/W20I7UhBniUOLSv8oQ X8UFUM10NEeBT0qpYpH1T2x1JfN4f0fu5K0mDqL67j6hgJItTZqSr+O7Q7y8t6v9 ki1LFDBQpurwXPTQ54UpL2Oi+dfsqCZB//7ja/AsSUlvqXyt9ybnWA7AtBbriF8l j6jARKc4jFhhsgg+xxbUGnak8B/5CMYU3/uQK5m9TqaDJdb5DRzB+d43DG0rNM41 EXmS7dyfipBZguLpAkU+J1rFLhB5ul1sP6V2YcvsCL/qcTwIhQ++5qjG89SC6lg2 TIFSU9A0Wrt7Rsk84LlGK8CsCCp/Rw== =MbHG -----END PGP SIGNATURE----- --xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs-- From owner-svn-src-head@freebsd.org Sat Jun 9 17:39:55 2018 Return-Path: Delivered-To: svn-src-head@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 9CBB91016141; Sat, 9 Jun 2018 17:39:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 2C23586EB3; Sat, 9 Jun 2018 17:39:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id t5-v6so19404366ioa.8; Sat, 09 Jun 2018 10:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=q97nx81gxsWrCWwCRTdsEvWkLF8PgB1utw3u6wdc2fQ=; b=hWvVa5Ixvvq2QsmR2KQTm1jQn77qocLyhlNBLAGvuTm6wqXglEKXTpGYH/GrCHBczy sKsXJ9jvU95D8lu08nY3KqDGhTobWYMx2ef2ozJQb41RJy5QuQXYsU636u6S9bM4NXIx C0eEuSrxOsqTQ2Cw7E3exSi0p07VHLanY+/3vm/dzaoRN2FTB+jH8EgG8aT+6ADDR3Hr W5f35Himq65M/VCMaMkaXIPOQlJVvXVqNXLFKxQCr+E7cBtvuMfr5gXv4za+xApQI3X0 X/96LjS9R7Fx25w1cN5Wuklq1er8BO5josYPzbXJ4cOw7xvcGOir66MCOY4+LRIZxOkp cu/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=q97nx81gxsWrCWwCRTdsEvWkLF8PgB1utw3u6wdc2fQ=; b=lCmFKnUvDg1m1nh2x3ipEQaEL8J5Rv1cbnUWqdvsvjXNm0ngh8TnlnCrkvkTXKuCpw 78bzdpZBcTOlasFfwJnDuVESwLR0Rco9cJHKDcwwizXzXG0N2zuYF8I9VH+bb2HjBXSr sPPg8zgEo65ifM6JS5shOeITpQ4BZbxEicVDzKd9WUCzyj5L92sq9ZRvE32G7a3FRIkS PF80X9AVavcAvoU24Tcg9XAMChnUQjDkv/GlCjCidF7sa7GIak0Qf67qcaLkg26R9rTf EYF32Ob5sX5FaZGsBlOK09r3CKoYHGsV3xrRrQiUmcbr1h5EqUYnmbyHSWDCEgHpqUFy 64VQ== X-Gm-Message-State: APt69E3X7NqgWF1QuPgO29+WxoHmOhjLBpGeOm3EJe/wbIAeLbEbIIRJ qIjWuuVy17Q+h00Ecw9raEV7CT0o X-Google-Smtp-Source: ADUXVKJjMhoJZ76ZmrYCAjSU7bOmQvFf2rDPwBzNGyJAb/d5S9LNwC1INABXoD2tiag8HjlYGKXrOQ== X-Received: by 2002:a6b:8208:: with SMTP id e8-v6mr8865256iod.264.1528565994529; Sat, 09 Jun 2018 10:39:54 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id u206-v6sm2134934itc.40.2018.06.09.10.39.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 10:39:53 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 13:39:51 -0400 From: Mark Johnston To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bdrewery@freebsd.org Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609173951.GB1394@pesky> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 17:39:55 -0000 On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Am Sat, 9 Jun 2018 15:10:49 +0000 (UTC) > Mark Johnston schrieb: > > > Author: markj > > Date: Sat Jun 9 15:10:49 2018 > > New Revision: 334883 > > URL: https://svnweb.freebsd.org/changeset/base/334883 > > > > Log: > > Don't process DWARF generated from non-C/C++ code. > > > > ctfconvert(1) is not designed to handle DWARF generated from such code, > > and will generally fail in non-obvious ways. Use an explicit check to > > help catch such potential failures. > > > > Reported by: Johannes Lundberg > > MFC after: 2 weeks > > > > Modified: > > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > ============================================================================== > > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15:10:39 > > 2018 (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > Sat Jun 9 15:10:49 2018 (r334883) @@ -1901,7 +1901,7 @@ should_have_dwarf(Elf > > *elf) int > > dw_read(tdata_t *td, Elf *elf, char *filename __unused) > > { > > - Dwarf_Unsigned abboff, hdrlen, nxthdr; > > + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr; > > Dwarf_Half vers, addrsz, offsz; > > Dwarf_Die cu = 0; > > Dwarf_Die child = 0; > > @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > > } > > > > if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, > > - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > > - if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > > + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > > + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > > exit(0); > > else > > terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); > > @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > > debug(1, "DWARF emitter: %s\n", prod); > > free(prod); > > } > > + > > + if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) == 0) > > + switch (lang) { > > + case DW_LANG_C: > > + case DW_LANG_C89: > > + case DW_LANG_C99: > > + case DW_LANG_C11: > > + case DW_LANG_C_plus_plus: > > + case DW_LANG_C_plus_plus_03: > > + case DW_LANG_C_plus_plus_11: > > + case DW_LANG_C_plus_plus_14: > > + break; > > + default: > > + terminate("file contains DWARF for unsupported " > > + "language %d", lang); > > + } > > + else > > + warning("die %llu: failed to get language attribute: %s\n", > > + die_off(&dw, cu), dwarf_errmsg(dw.dw_err)); > > > > if ((dw.dw_cuname = die_name(&dw, cu)) != NULL) { > > char *base = xstrdup(basename(dw.dw_cuname)); > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > This commit makes buildworld (WITH_META_MODE) failing: I added these identifiers in r334881, and the CI build is passing. Might this be a problem with META_MODE? > [...] > ===> cddl/usr.bin/ctfconvert (obj,all,install) > Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o > - --- dwarf.o --- > /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error: use of undeclared > identifier 'DW_LANG_C11' case DW_LANG_C11: > ^ > /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error: use of undeclared > identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03: > ^ > /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error: use of undeclared > identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11: > ^ > /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error: use of undeclared > identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14: > ^ > 4 errors generated. > *** [dwarf.o] Error code 1 From owner-svn-src-head@freebsd.org Sat Jun 9 18:02:42 2018 Return-Path: Delivered-To: svn-src-head@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 D9E9A1019FB4; Sat, 9 Jun 2018 18:02:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 6C1FB69DC4; Sat, 9 Jun 2018 18:02:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x244.google.com with SMTP id l25-v6so19410206ioh.12; Sat, 09 Jun 2018 11:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6nMre5dyDL4iQXzMzsdvuJrtxfy+9G1kwiHfoR+RTFo=; b=MZbtvyetfZKs09A3c1VClq09ZxNXU/w/N6mjcjPmyLKhKUfzW299jUkdIOwD0mvqLI C7GYEXlz9ouNImFDGmi5qjsA8OAeF52ooZt0QaoSlg1LFxtJUrx3ScM3cEfr0B0YufX9 Cjf7unux5Mp+et2P9oIyAJB+Ytrcccz9xQuo7BzDp7+U10Qkbm30fYiNq/mXWuaQEZNW uK2ifcjmr3v/di31GUhykzPJYFX0B38G/99czIrdnh6R6FJeFcn0v9KN0C+WeGk4f27B BMNW9L3TJGRooPtWk6b79b6dckWTHHWP9+/Q9z7+WBcNVyQ00s1j65jj4Aoy4eC2bmZ9 qPXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6nMre5dyDL4iQXzMzsdvuJrtxfy+9G1kwiHfoR+RTFo=; b=O1yVu5Fg0MaA4irAtaveZNSHIdvq8mIJRzQnv/V0auscC94jndp7Z4ymjL+clJaG2W fV019JTsl2pjXoQ5SUOLCHd86J9zZc8IublJpoyPICkdZWdwq3KwZH7M+QpU/O8cxVyI QzlizXSlM4Lq/yynCSd1cfFLCwyEXz3Y5mPxkcj5AperihyhBPTzXEwkExyz0UrymbFb hlVBQxhu6c0EQ0LPi340Yjgaqe9KYucE2Bmw9UWEiu2t3sNuLpgaStNymJstXfiuqvVD eQxZnhl40geKgCnVqhT2CWbpqTEqp8bA1t9+129FSyQEw/YOKTFxW31tYX88+/ej4N1C c5hw== X-Gm-Message-State: APt69E15o35reuWdxNR9sT3Sh4Ne1PROzQVlB/Wlee19fjyHZUh0jiYh ee8jBYbOAELRSJuh4Lj3JuMzQs5z X-Google-Smtp-Source: ADUXVKLD+zpH8d420o/3GPXZl9xkD7LZ5mre+h0tZfLOJJAk8vJpZtfdyp6/HN9E/dHsOer24m7uIA== X-Received: by 2002:a6b:1b93:: with SMTP id b141-v6mr9641868iob.240.1528567360601; Sat, 09 Jun 2018 11:02:40 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id k139-v6sm2352673itk.27.2018.06.09.11.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 11:02:39 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 14:02:37 -0400 From: Mark Johnston To: Bryan Drewery Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609180237.GD1394@pesky> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:02:42 -0000 On Sat, Jun 09, 2018 at 01:56:18PM -0400, Bryan Drewery wrote: > On 6/9/18 1:39 PM, Mark Johnston wrote: > > On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA512 > >> > >> Am Sat, 9 Jun 2018 15:10:49 +0000 (UTC) > >> Mark Johnston schrieb: > >> > >>> Author: markj > >>> Date: Sat Jun 9 15:10:49 2018 > >>> New Revision: 334883 > >>> URL: https://svnweb.freebsd.org/changeset/base/334883 > >>> > >>> Log: > >>> Don't process DWARF generated from non-C/C++ code. > >>> > >>> ctfconvert(1) is not designed to handle DWARF generated from such code, > >>> and will generally fail in non-obvious ways. Use an explicit check to > >>> help catch such potential failures. > >>> > >>> Reported by: Johannes Lundberg > >>> MFC after: 2 weeks > >>> > >>> Modified: > >>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> > >>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> ============================================================================== > >>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15:10:39 > >>> 2018 (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> Sat Jun 9 15:10:49 2018 (r334883) @@ -1901,7 +1901,7 @@ should_have_dwarf(Elf > >>> *elf) int > >>> dw_read(tdata_t *td, Elf *elf, char *filename __unused) > >>> { > >>> - Dwarf_Unsigned abboff, hdrlen, nxthdr; > >>> + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr; > >>> Dwarf_Half vers, addrsz, offsz; > >>> Dwarf_Die cu = 0; > >>> Dwarf_Die child = 0; > >>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > >>> } > >>> > >>> if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, > >>> - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > >>> - if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > >>> + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > >>> + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > >>> exit(0); > >>> else > >>> terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); > >>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > >>> debug(1, "DWARF emitter: %s\n", prod); > >>> free(prod); > >>> } > >>> + > >>> + if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) == 0) > >>> + switch (lang) { > >>> + case DW_LANG_C: > >>> + case DW_LANG_C89: > >>> + case DW_LANG_C99: > >>> + case DW_LANG_C11: > >>> + case DW_LANG_C_plus_plus: > >>> + case DW_LANG_C_plus_plus_03: > >>> + case DW_LANG_C_plus_plus_11: > >>> + case DW_LANG_C_plus_plus_14: > >>> + break; > >>> + default: > >>> + terminate("file contains DWARF for unsupported " > >>> + "language %d", lang); > >>> + } > >>> + else > >>> + warning("die %llu: failed to get language attribute: %s\n", > >>> + die_off(&dw, cu), dwarf_errmsg(dw.dw_err)); > >>> > >>> if ((dw.dw_cuname = die_name(&dw, cu)) != NULL) { > >>> char *base = xstrdup(basename(dw.dw_cuname)); > >>> _______________________________________________ > >>> svn-src-head@freebsd.org mailing list > >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > >> This commit makes buildworld (WITH_META_MODE) failing: > > > > I added these identifiers in r334881, and the CI build is passing. Might > > this be a problem with META_MODE? > > > >> [...] > >> ===> cddl/usr.bin/ctfconvert (obj,all,install) > >> Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o > > obj-tools means it is trying to build a HOST NATIVE version of this. > Where are these defined? In this case they need to be defined in > /usr/include already unless the build has -I.CURDIR/somewhere/to/headers > instead. The definitions are in contrib/elftoolchain/libdwarf/dwarf.h. Indeed, the ctfconvert makefile doesn't explicitly add libdwarf to the include path. I'm surprised that this is necessary though - do I need to modify the BOOTSTRAPPING check for _elftoolchain_libs in Makefile.inc1? From owner-svn-src-head@freebsd.org Sat Jun 9 18:05:40 2018 Return-Path: Delivered-To: svn-src-head@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 49CB4101AB45; Sat, 9 Jun 2018 18:05:40 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9FA16A2BC; Sat, 9 Jun 2018 18:05:39 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id B10DE230CA; Sat, 9 Jun 2018 18:05:39 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f178.google.com with SMTP id r24-v6so19428909ioh.9; Sat, 09 Jun 2018 11:05:39 -0700 (PDT) X-Gm-Message-State: APt69E36eyzjq+tp8VlJqyZc3O0yRlwmQVnQyiqbC/ZZyFeGR2LZnY7Z z6BGa559Pj+htR21p9E4j6gMaIbxnbEPD3KM+hs= X-Google-Smtp-Source: ADUXVKLfgit2ErbwuA8BaA4be1nLO5QyT+5AbkuuxeUEBBWewA5pLT5eaFGCOAMDEoZeAo3cMP6+Izc/N10qq4j9jzo= X-Received: by 2002:a6b:9654:: with SMTP id y81-v6mr9006340iod.237.1528567539070; Sat, 09 Jun 2018 11:05:39 -0700 (PDT) MIME-Version: 1.0 References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> <20180609175104.GC1394@pesky> In-Reply-To: <20180609175104.GC1394@pesky> From: Matthew Macy Date: Sat, 9 Jun 2018 11:05:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys To: Mark Johnston Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:05:40 -0000 On Sat, Jun 9, 2018 at 10:51 Mark Johnston wrote: > On Sat, Jun 09, 2018 at 08:11:15AM -0400, John Baldwin wrote: > > On 6/8/18 12:34 PM, Matthew Macy wrote: > > >> The fact that our NMI handler isn't re-entrant can lead to subtle > > >> problems. If while executing the NMI handler we hit a dtrace > > >> probe or DDB breakpoint, the iret executed upon return to the handler > > >> will re-enable NMIs. Then, if a second NMI arrives before the handler > > >> for the first has returned, the trapframe will be clobbered. Did you > > >> rule out an issue like this? > > > > > > No, but it happened instantly on all CPUs an a non-debug kernel 100% > > > of the time after I changed pmc_process_interrupt earlier this week. > > > My voodoo fix now avoids it. What you're describing sounds episodic > > > and doesn't sound like it would be fixed / worked around by my change. > > > > OTOH, a compiler bug will crop up in other places. It is best to run > > it to ground. Can you describe what the bug was in more detail? > > It would probably not be hard to come up with something you can run > > creduce against to get down to a test case. If you do that, the > > LLVM folks are quite helpful and able at fixing the issue which fixes > > it in more places than just here. > > The bug is the rdtscp() intrinsic added in r334746 is wrong. It was just > copied from rdtsc(), but unlike rdtsc, rdtscp clobbers rcx, which is the > register containing the tf pointer. > Thanks for identifying that. Are you going to update it? -M From owner-svn-src-head@freebsd.org Sat Jun 9 18:11:47 2018 Return-Path: Delivered-To: svn-src-head@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 DF046101BE47; Sat, 9 Jun 2018 18:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7A36AC93; Sat, 9 Jun 2018 18:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70A56215C2; Sat, 9 Jun 2018 18:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59IBkCV027835; Sat, 9 Jun 2018 18:11:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59IBk2o027834; Sat, 9 Jun 2018 18:11:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091811.w59IBk2o027834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 18:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334889 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 334889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:11:47 -0000 Author: kevans Date: Sat Jun 9 18:11:46 2018 New Revision: 334889 URL: https://svnweb.freebsd.org/changeset/base/334889 Log: bsdgrep(1): Some more int -> bool conversions and name changes Again motivated by upcoming work to rewrite a bunch of this- single-letter variable names and slightly misleading variable names ("lastmatches" to indicate that the last matched) are not helpful. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sat Jun 9 17:49:43 2018 (r334888) +++ head/usr.bin/grep/util.c Sat Jun 9 18:11:46 2018 (r334889) @@ -74,7 +74,7 @@ static bool procmatches(struct mprintc *mc, struct par static int litexec(const struct pat *pat, const char *string, size_t nmatch, regmatch_t pmatch[]); #endif -static int procline(struct parsec *pc); +static bool procline(struct parsec *pc); static void printline(struct parsec *pc, int sep); static void printline_metadata(struct str *line, int sep); @@ -210,7 +210,7 @@ procmatch_match(struct mprintc *mc, struct parsec *pc) while (pc->matchidx >= MAX_MATCHES) { /* Reset matchidx and try again */ pc->matchidx = 0; - if (procline(pc) == 0) + if (procline(pc)) printline(pc, ':'); else break; @@ -283,7 +283,8 @@ procfile(const char *fn) struct file *f; struct stat sb; mode_t s; - int lines, t; + int lines; + bool line_matched; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : errstr[1]; @@ -316,6 +317,7 @@ procfile(const char *fn) pc.cntlines = false; memset(&mc, 0, sizeof(mc)); mc.printmatch = true; + line_matched = false; if ((pc.binary && binbehave == BINFILE_BIN) || cflag || qflag || lflag || Lflag) mc.printmatch = false; @@ -354,11 +356,12 @@ procfile(const char *fn) return (0); } - if ((t = procline(&pc)) == 0) + line_matched = procline(&pc); + if (line_matched) ++lines; /* Halt processing if we hit our match limit */ - if (!procmatches(&mc, &pc, t == 0)) + if (!procmatches(&mc, &pc, line_matched)) break; } if (Bflag > 0) @@ -453,31 +456,33 @@ litexec(const struct pat *pat, const char *string, siz * matches. The matching lines are passed to printline() to display the * appropriate output. */ -static int +static bool procline(struct parsec *pc) { regmatch_t pmatch, lastmatch, chkmatch; wchar_t wbegin, wend; size_t st, nst; unsigned int i; - int c = 0, r = 0, lastmatches = 0, leflags = eflags; + int r = 0, leflags = eflags; size_t startm = 0, matchidx; unsigned int retry; + bool lastmatched, matched; matchidx = pc->matchidx; /* Special case: empty pattern with -w flag, check first character */ if (matchall && wflag) { if (pc->ln.len == 0) - return (0); + return (true); wend = L' '; if (sscanf(&pc->ln.dat[0], "%lc", &wend) != 1 || iswword(wend)) - return (1); + return (false); else - return (0); + return (true); } else if (matchall) - return (0); + return (true); + matched = false; st = pc->lnstart; nst = 0; /* Initialize to avoid a false positive warning from GCC. */ @@ -485,7 +490,7 @@ procline(struct parsec *pc) /* Loop to process the whole line */ while (st <= pc->ln.len) { - lastmatches = 0; + lastmatched = false; startm = matchidx; retry = 0; if (st > 0 && pc->ln.dat[st - 1] != fileeol) @@ -537,11 +542,11 @@ procline(struct parsec *pc) if (r == REG_NOMATCH) continue; } - lastmatches++; + lastmatched = true; lastmatch = pmatch; if (matchidx == 0) - c++; + matched = true; /* * Replace previous match if the new one is earlier @@ -567,7 +572,7 @@ procline(struct parsec *pc) if ((color == NULL && !oflag) || qflag || lflag || matchidx >= MAX_MATCHES) { pc->lnstart = nst; - lastmatches = 0; + lastmatched = false; break; } } @@ -577,7 +582,7 @@ procline(struct parsec *pc) * again just in case we still have a chance to match later in * the string. */ - if (lastmatches == 0 && retry > pc->lnstart) { + if (!lastmatched && retry > pc->lnstart) { st = retry; continue; } @@ -588,10 +593,10 @@ procline(struct parsec *pc) break; /* If we didn't have any matches or REG_NOSUB set */ - if (lastmatches == 0 || (cflags & REG_NOSUB)) + if (!lastmatched || (cflags & REG_NOSUB)) nst = pc->ln.len; - if (lastmatches == 0) + if (!lastmatched) /* No matches */ break; else if (st == nst && lastmatch.rm_so == lastmatch.rm_eo) @@ -606,8 +611,8 @@ procline(struct parsec *pc) /* Reflect the new matchidx in the context */ pc->matchidx = matchidx; if (vflag) - c = !c; - return (c ? 0 : 1); + matched = !matched; + return matched; } /* From owner-svn-src-head@freebsd.org Sat Jun 9 18:31:20 2018 Return-Path: Delivered-To: svn-src-head@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 938DF101FFD8; Sat, 9 Jun 2018 18:31:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 460746CC4A; Sat, 9 Jun 2018 18:31:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 285FD217F7; Sat, 9 Jun 2018 18:31:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59IVKv0040724; Sat, 9 Jun 2018 18:31:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59IVJqk040722; Sat, 9 Jun 2018 18:31:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806091831.w59IVJqk040722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 Jun 2018 18:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334890 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 334890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:31:20 -0000 Author: markj Date: Sat Jun 9 18:31:19 2018 New Revision: 334890 URL: https://svnweb.freebsd.org/changeset/base/334890 Log: Tell the compiler that rdtscp clobbers %ecx. Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Sat Jun 9 18:11:46 2018 (r334889) +++ head/sys/amd64/include/cpufunc.h Sat Jun 9 18:31:19 2018 (r334890) @@ -391,7 +391,7 @@ rdtscp(void) { uint32_t low, high; - __asm __volatile("rdtscp" : "=a" (low), "=d" (high)); + __asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx"); return (low | ((uint64_t)high << 32)); } Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Sat Jun 9 18:11:46 2018 (r334889) +++ head/sys/i386/include/cpufunc.h Sat Jun 9 18:31:19 2018 (r334890) @@ -373,7 +373,7 @@ rdtscp(void) { uint64_t rv; - __asm __volatile("rdtscp" : "=A" (rv)); + __asm __volatile("rdtscp" : "=A" (rv) : : "ecx"); return (rv); } From owner-svn-src-head@freebsd.org Sat Jun 9 18:37:58 2018 Return-Path: Delivered-To: svn-src-head@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 224DB1000E46; Sat, 9 Jun 2018 18:37:58 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D2D6D734; Sat, 9 Jun 2018 18:37:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.173.237]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MdaiW-1fbesa2QjU-00PQZG; Sat, 09 Jun 2018 20:37:48 +0200 Date: Sat, 9 Jun 2018 20:37:14 +0200 From: "O. Hartmann" To: Mark Johnston Cc: Bryan Drewery , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "O. Hartmann" Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609203741.20ff3112@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180609180237.GD1394@pesky> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> <20180609180237.GD1394@pesky> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:6GO9t/IKZParHJmYHRjjAO6FnK8hnaLEfggH07EYlOCC8dqEkIl KUVgP7k8XNg8On95+TvThpZBeqUFsFJ4lt+4hlli+P1L+0gU/XGnuLRm+7WhGxNC3n/5nD4 tBtZON0d2/ZulUFkpb5GKjPT4ZfXZF6WqApHABSnDpA9KVqz/hSSE+CfwE5HwkBhR26oENH c0MZwmVYeFPDiI3vTOiXA== X-UI-Out-Filterresults: notjunk:1;V01:K0:YqvHA/qq1h0=:LpAM9Wiwe3r/dtWZBUzcO9 wrCBozTw0r4sGp95/3Quu5jD3hkW9ThpCOUJJs5goW8sAX619OOiR5cWT6rU+F4YS8DPBiZc8 WwcFQlJgdF84g0vSjoGp4E/qgk7k9ahsS9tcBH4zfPHNsyKKVSDeAmmEiVzqeaUUrlzPXMFpE MM5Sw+eSDJVjTRpg8smVpIT21RbS0sAh6vCMBywwQr8h/hECJ3r5o8MxRTOshTNAqWfQbEQon I3TwfppFOAKgYwGTrAMC3Q8UO6vCUUicLwtSFA/ctvQOINFw05ne99Qj2t9SlEz8sp+2BAAYo DX9//8NKpoETHh7/mEiAWp/h26+2u9Njxpf9ROo1r6haXfcZ/fKKfL26DdNMlPKS4ITWFq4d/ wX04lWwzymX0MgkyyS4dOohtpQVxnXaz8PhIHnxnLplyZkkz4mK0zngnCDgb/V331+k5DziaZ xevTvWsTebyCx31oEQoNP1gXYZG26aGA6zeBCGeKxgpahcHyZGB5TfArnPJ9AxEWwCrzcj991 YZC2CQjL8V4fmzFGv4NQbxYQt5y/i0YJJphqLaOi7/KV1gWjeCY4zSu94GfvvuNpy8IxsgwT1 oemqicTUI/0PCJmhuj1/O3q7g+rsK6GegJEW5EQ1RttZIoPlx+D0fuwudSwM/L+/MUIcpHrXa ExkaiiZIa3B+PGaDkmkTBZbkmtFOlyva5BZLXhVTfF7ireuDBjxcbKzDchUDE5Vlo9M5PbK9i nusLbfdlOpszNyHa/L5uW0tN9BRFXkELCCw3wiMqsK/xhBGpgOpJYCQ0ASO3tEZD38x41uFe2 0YFin3s X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:37:58 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFNh dCwgOSBKdW4gMjAxOCAxNDowMjozNyAtMDQwMA0KTWFyayBKb2huc3RvbiA8bWFya2pAZnJlZWJz ZC5vcmc+IHNjaHJpZWI6DQoNCj4gT24gU2F0LCBKdW4gMDksIDIwMTggYXQgMDE6NTY6MThQTSAt MDQwMCwgQnJ5YW4gRHJld2VyeSB3cm90ZToNCj4gPiBPbiA2LzkvMTggMTozOSBQTSwgTWFyayBK b2huc3RvbiB3cm90ZTogIA0KPiA+ID4gT24gU2F0LCBKdW4gMDksIDIwMTggYXQgMDc6MzU6MDBQ TSArMDIwMCwgTy4gSGFydG1hbm4gd3JvdGU6ICANCj4gPiA+PiAtLS0tLUJFR0lOIFBHUCBTSUdO RUQgTUVTU0FHRS0tLS0tDQo+ID4gPj4gSGFzaDogU0hBNTEyDQo+ID4gPj4NCj4gPiA+PiBBbSBT YXQsIDkgSnVuIDIwMTggMTU6MTA6NDkgKzAwMDAgKFVUQykNCj4gPiA+PiBNYXJrIEpvaG5zdG9u IDxtYXJrakBGcmVlQlNELm9yZz4gc2NocmllYjoNCj4gPiA+PiAgDQo+ID4gPj4+IEF1dGhvcjog bWFya2oNCj4gPiA+Pj4gRGF0ZTogU2F0IEp1biAgOSAxNToxMDo0OSAyMDE4DQo+ID4gPj4+IE5l dyBSZXZpc2lvbjogMzM0ODgzDQo+ID4gPj4+IFVSTDogaHR0cHM6Ly9zdm53ZWIuZnJlZWJzZC5v cmcvY2hhbmdlc2V0L2Jhc2UvMzM0ODgzDQo+ID4gPj4+DQo+ID4gPj4+IExvZzoNCj4gPiA+Pj4g ICBEb24ndCBwcm9jZXNzIERXQVJGIGdlbmVyYXRlZCBmcm9tIG5vbi1DL0MrKyBjb2RlLg0KPiA+ ID4+PiAgIA0KPiA+ID4+PiAgIGN0ZmNvbnZlcnQoMSkgaXMgbm90IGRlc2lnbmVkIHRvIGhhbmRs ZSBEV0FSRiBnZW5lcmF0ZWQgZnJvbSBzdWNoIGNvZGUsDQo+ID4gPj4+ICAgYW5kIHdpbGwgZ2Vu ZXJhbGx5IGZhaWwgaW4gbm9uLW9idmlvdXMgd2F5cy4gIFVzZSBhbiBleHBsaWNpdCBjaGVjayB0 bw0KPiA+ID4+PiAgIGhlbHAgY2F0Y2ggc3VjaCBwb3RlbnRpYWwgZmFpbHVyZXMuDQo+ID4gPj4+ ICAgDQo+ID4gPj4+ICAgUmVwb3J0ZWQgYnk6CUpvaGFubmVzIEx1bmRiZXJnIDxqb2hhbHVuMEBn bWFpbC5jb20+DQo+ID4gPj4+ICAgTUZDIGFmdGVyOgkyIHdlZWtzDQo+ID4gPj4+DQo+ID4gPj4+ IE1vZGlmaWVkOg0KPiA+ID4+PiAgIGhlYWQvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3Rvb2xz L2N0Zi9jdnQvZHdhcmYuYw0KPiA+ID4+Pg0KPiA+ID4+PiBNb2RpZmllZDogaGVhZC9jZGRsL2Nv bnRyaWIvb3BlbnNvbGFyaXMvdG9vbHMvY3RmL2N2dC9kd2FyZi5jDQo+ID4gPj4+ID09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQ0KPiA+ID4+PiAtLS0gaGVhZC9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMv dG9vbHMvY3RmL2N2dC9kd2FyZi5jCVNhdCBKdW4gIDkgMTU6MTA6MzkNCj4gPiA+Pj4gMjAxOAko cjMzNDg4MikgKysrIGhlYWQvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3Rvb2xzL2N0Zi9jdnQv ZHdhcmYuYw0KPiA+ID4+PiBTYXQgSnVuICA5IDE1OjEwOjQ5IDIwMTgJKHIzMzQ4ODMpIEBAIC0x OTAxLDcgKzE5MDEsNyBAQA0KPiA+ID4+PiBzaG91bGRfaGF2ZV9kd2FyZihFbGYgKmVsZikgaW50 DQo+ID4gPj4+ICBkd19yZWFkKHRkYXRhX3QgKnRkLCBFbGYgKmVsZiwgY2hhciAqZmlsZW5hbWUg X191bnVzZWQpDQo+ID4gPj4+ICB7DQo+ID4gPj4+IC0JRHdhcmZfVW5zaWduZWQgYWJib2ZmLCBo ZHJsZW4sIG54dGhkcjsNCj4gPiA+Pj4gKwlEd2FyZl9VbnNpZ25lZCBhYmJvZmYsIGhkcmxlbiwg bGFuZywgbnh0aGRyOw0KPiA+ID4+PiAgCUR3YXJmX0hhbGYgdmVycywgYWRkcnN6LCBvZmZzejsN Cj4gPiA+Pj4gIAlEd2FyZl9EaWUgY3UgPSAwOw0KPiA+ID4+PiAgCUR3YXJmX0RpZSBjaGlsZCA9 IDA7DQo+ID4gPj4+IEBAIC0xOTQxLDggKzE5NDEsOCBAQCBkd19yZWFkKHRkYXRhX3QgKnRkLCBF bGYgKmVsZiwgY2hhciAqZmlsZW5hbWUgX191bnVzZWQNCj4gPiA+Pj4gIAl9DQo+ID4gPj4+ICAN Cj4gPiA+Pj4gIAlpZiAoKHJjID0gZHdhcmZfbmV4dF9jdV9oZWFkZXJfYihkdy5kd19kdywgJmhk cmxlbiwgJnZlcnMsICZhYmJvZmYsDQo+ID4gPj4+IC0JCSZhZGRyc3osICZvZmZzeiwgTlVMTCwg Jm54dGhkciwgJmR3LmR3X2VycikpICE9IERXX0RMVl9PSykgew0KPiA+ID4+PiAtCQlpZiAoZHcu ZHdfZXJyLmVycl9lcnJvciA9PSAJRFdfRExFX05PX0VOVFJZKQ0KPiA+ID4+PiArCSAgICAmYWRk cnN6LCAmb2Zmc3osIE5VTEwsICZueHRoZHIsICZkdy5kd19lcnIpKSAhPSBEV19ETFZfT0spIHsN Cj4gPiA+Pj4gKwkJaWYgKGR3LmR3X2Vyci5lcnJfZXJyb3IgPT0gRFdfRExFX05PX0VOVFJZKQ0K PiA+ID4+PiAgCQkJZXhpdCgwKTsNCj4gPiA+Pj4gIAkJZWxzZQ0KPiA+ID4+PiAgCQkJdGVybWlu YXRlKCJyYyA9ICVkICVzXG4iLCByYywgZHdhcmZfZXJybXNnKGR3LmR3X2VycikpOw0KPiA+ID4+ PiBAQCAtMTk3MSw2ICsxOTcxLDI1IEBAIGR3X3JlYWQodGRhdGFfdCAqdGQsIEVsZiAqZWxmLCBj aGFyICpmaWxlbmFtZSBfX3VudXNlZA0KPiA+ID4+PiAgCQlkZWJ1ZygxLCAiRFdBUkYgZW1pdHRl cjogJXNcbiIsIHByb2QpOw0KPiA+ID4+PiAgCQlmcmVlKHByb2QpOw0KPiA+ID4+PiAgCX0NCj4g PiA+Pj4gKw0KPiA+ID4+PiArCWlmIChkd2FyZl9hdHRydmFsX3Vuc2lnbmVkKGN1LCBEV19BVF9s YW5ndWFnZSwgJmxhbmcsICZkdy5kd19lcnIpID09IDApDQo+ID4gPj4+ICsJCXN3aXRjaCAobGFu Zykgew0KPiA+ID4+PiArCQljYXNlIERXX0xBTkdfQzoNCj4gPiA+Pj4gKwkJY2FzZSBEV19MQU5H X0M4OToNCj4gPiA+Pj4gKwkJY2FzZSBEV19MQU5HX0M5OToNCj4gPiA+Pj4gKwkJY2FzZSBEV19M QU5HX0MxMToNCj4gPiA+Pj4gKwkJY2FzZSBEV19MQU5HX0NfcGx1c19wbHVzOg0KPiA+ID4+PiAr CQljYXNlIERXX0xBTkdfQ19wbHVzX3BsdXNfMDM6DQo+ID4gPj4+ICsJCWNhc2UgRFdfTEFOR19D X3BsdXNfcGx1c18xMToNCj4gPiA+Pj4gKwkJY2FzZSBEV19MQU5HX0NfcGx1c19wbHVzXzE0Og0K PiA+ID4+PiArCQkJYnJlYWs7DQo+ID4gPj4+ICsJCWRlZmF1bHQ6DQo+ID4gPj4+ICsJCQl0ZXJt aW5hdGUoImZpbGUgY29udGFpbnMgRFdBUkYgZm9yIHVuc3VwcG9ydGVkICINCj4gPiA+Pj4gKwkJ CSAgICAibGFuZ3VhZ2UgJWQiLCBsYW5nKTsNCj4gPiA+Pj4gKwkJfQ0KPiA+ID4+PiArCWVsc2UN Cj4gPiA+Pj4gKwkJd2FybmluZygiZGllICVsbHU6IGZhaWxlZCB0byBnZXQgbGFuZ3VhZ2UgYXR0 cmlidXRlOiAlc1xuIiwNCj4gPiA+Pj4gKwkJICAgIGRpZV9vZmYoJmR3LCBjdSksIGR3YXJmX2Vy cm1zZyhkdy5kd19lcnIpKTsNCj4gPiA+Pj4gIA0KPiA+ID4+PiAgCWlmICgoZHcuZHdfY3VuYW1l ID0gZGllX25hbWUoJmR3LCBjdSkpICE9IE5VTEwpIHsNCj4gPiA+Pj4gIAkJY2hhciAqYmFzZSA9 IHhzdHJkdXAoYmFzZW5hbWUoZHcuZHdfY3VuYW1lKSk7DQo+ID4gPj4+IF9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+ID4gPj4+IHN2bi1zcmMtaGVhZEBm cmVlYnNkLm9yZyBtYWlsaW5nIGxpc3QNCj4gPiA+Pj4gaHR0cHM6Ly9saXN0cy5mcmVlYnNkLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL3N2bi1zcmMtaGVhZA0KPiA+ID4+PiBUbyB1bnN1YnNjcmliZSwg c2VuZCBhbnkgbWFpbCB0byAic3ZuLXNyYy1oZWFkLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIiAg DQo+ID4gPj4gVGhpcyBjb21taXQgbWFrZXMgYnVpbGR3b3JsZCAoV0lUSF9NRVRBX01PREUpIGZh aWxpbmc6ICANCj4gPiA+IA0KPiA+ID4gSSBhZGRlZCB0aGVzZSBpZGVudGlmaWVycyBpbiByMzM0 ODgxLCBhbmQgdGhlIENJIGJ1aWxkIGlzIHBhc3NpbmcuIE1pZ2h0DQo+ID4gPiB0aGlzIGJlIGEg cHJvYmxlbSB3aXRoIE1FVEFfTU9ERT8NCj4gPiA+ICAgDQo+ID4gPj4gWy4uLl0gIA0KPiA+ID4+ ID09PT4gY2RkbC91c3IuYmluL2N0ZmNvbnZlcnQgKG9iaixhbGwsaW5zdGFsbCkgIA0KPiA+ID4+ IEJ1aWxkaW5nIC91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL29iai10b29scy9jZGRs L3Vzci5iaW4vY3RmY29udmVydC9kd2FyZi5vICANCj4gPiANCj4gPiBvYmotdG9vbHMgbWVhbnMg aXQgaXMgdHJ5aW5nIHRvIGJ1aWxkIGEgSE9TVCBOQVRJVkUgdmVyc2lvbiBvZiB0aGlzLg0KPiA+ IFdoZXJlIGFyZSB0aGVzZSBkZWZpbmVkPyBJbiB0aGlzIGNhc2UgdGhleSBuZWVkIHRvIGJlIGRl ZmluZWQgaW4NCj4gPiAvdXNyL2luY2x1ZGUgYWxyZWFkeSB1bmxlc3MgdGhlIGJ1aWxkIGhhcyAt SS5DVVJESVIvc29tZXdoZXJlL3RvL2hlYWRlcnMNCj4gPiBpbnN0ZWFkLiAgDQo+IA0KPiBUaGUg ZGVmaW5pdGlvbnMgYXJlIGluIGNvbnRyaWIvZWxmdG9vbGNoYWluL2xpYmR3YXJmL2R3YXJmLmgu IEluZGVlZCwNCj4gdGhlIGN0ZmNvbnZlcnQgbWFrZWZpbGUgZG9lc24ndCBleHBsaWNpdGx5IGFk ZCBsaWJkd2FyZiB0byB0aGUgaW5jbHVkZQ0KPiBwYXRoLiBJJ20gc3VycHJpc2VkIHRoYXQgdGhp cyBpcyBuZWNlc3NhcnkgdGhvdWdoIC0gZG8gSSBuZWVkIHRvIG1vZGlmeQ0KPiB0aGUgQk9PVFNU UkFQUElORyBjaGVjayBmb3IgX2VsZnRvb2xjaGFpbl9saWJzIGluIE1ha2VmaWxlLmluYzE/DQo+ IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IHN2bi1z cmMtaGVhZEBmcmVlYnNkLm9yZyBtYWlsaW5nIGxpc3QNCj4gaHR0cHM6Ly9saXN0cy5mcmVlYnNk Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3N2bi1zcmMtaGVhZA0KPiBUbyB1bnN1YnNjcmliZSwgc2Vu ZCBhbnkgbWFpbCB0byAic3ZuLXNyYy1oZWFkLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KDQpJ IHN0YXJ0ZWQgb24gb25lIG9mIHRoZSBmYXN0ZXIgYm94ZXMgd2l0aCBhIG1ha2UgY2xlYW53b3Js ZCBhbmQgdHJpZWQgdGhlbiB0byByZWJ1aWxkDQp3b3JsZCBhbmQga2VybmVsLiBJdCBlbmRzIHVw IGF0IHRoZSB2ZXJ5IHNhbWUgZXJyb3IgZm9yIG1lLg0KDQpSZWdhcmRzLA0KDQpvaCANCg0KLSAt LSANCk8uIEhhcnRtYW5uDQoNCkljaCB3aWRlcnNwcmVjaGUgZGVyIE51dHp1bmcgb2RlciDDnGJl cm1pdHRsdW5nIG1laW5lciBEYXRlbiBmw7xyDQpXZXJiZXp3ZWNrZSBvZGVyIGbDvHIgZGllIE1h cmt0LSBvZGVyIE1laW51bmdzZm9yc2NodW5nICjCpyAyOCBBYnMuIDQgQkRTRykuDQotLS0tLUJF R0lOIFBHUCBTSUdOQVRVUkUtLS0tLQ0KDQppTFVFQVJNS0FCMFdJUVFaVlpNekF0d0MyVC84NlRy UzUyOGZ5RmhZbEFVQ1d4d2VkUUFLQ1JEUzUyOGZ5RmhZDQpsUHIzQWZ3TmNtZXNIMDE0dGhSSTNX eVNnOFh4NzNPNG1zSkVaUzQxOWZYZWwwVjlZRFJ6eGRuMlZMN2VFN0Z2DQpqbjI5RVVuTyt1QkdN UUk5dU9GVzN0Y3ZUK2RFQWZ3Sm54MXorNm45NytHUjZWRC9YSG1QTzZQaHVrMlRZTWV0DQpyT29w cU1rR1ZJeHBwOTFEVE1PTHo2YXl6NGJoWWRmcG1Kb09UQ0VwYU9wV0FscmJVSHVHDQo9ZDRkZA0K LS0tLS1FTkQgUEdQIFNJR05BVFVSRS0tLS0tDQo= From owner-svn-src-head@freebsd.org Sat Jun 9 19:51:11 2018 Return-Path: Delivered-To: svn-src-head@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 CE74210111EE; Sat, 9 Jun 2018 19:51:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0B771A66; Sat, 9 Jun 2018 19:51:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6035E224D7; Sat, 9 Jun 2018 19:51:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59JpAxi077779; Sat, 9 Jun 2018 19:51:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59JpAB6077778; Sat, 9 Jun 2018 19:51:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091951.w59JpAB6077778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 19:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334891 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 19:51:11 -0000 Author: kevans Date: Sat Jun 9 19:51:09 2018 New Revision: 334891 URL: https://svnweb.freebsd.org/changeset/base/334891 Log: lualoader: Add cli.lua(8) to the tree Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D14818 Added: head/stand/lua/cli.lua.8 (contents, props changed) Added: head/stand/lua/cli.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/cli.lua.8 Sat Jun 9 19:51:09 2018 (r334891) @@ -0,0 +1,112 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 9, 2018 +.Dt CLI.LUA 8 +.Os +.Sh NAME +.Nm cli.lua +.Nd FreeBSD Lua CLI module +.Sh DESCRIPTION +.Nm +contains the main functionality required to add new CLI commands, which can be +executed at the loader prompt. +.Pp +Before hooking into the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local cli = require("cli") +.Ss Adding new commands +New loader commands may be created by adding functions to the object returned by +requiring the +.Nm +module. +.Pp +For instance: +.Pp +.Bd -literal -offset indent -compact +local cli = require("cli") + +cli.foo = function(...) + -- Expand args to command name and the rest of argv. These arguments + -- are pushed directly to the stack by loader, then handed off to + -- cli_execute. cli_execute then passes them on to the invoked + -- function, where they appear as varargs that must be peeled apart into + -- their respective components. + local _, argv = cli.arguments(...) + + print("This is the foo command!") + for k, v in ipairs(argv) do + print("arg #" .. tostring(k) .. ": '" .. v .. "'") + end + -- Perform a loader command directly. This will not get dispatched back + -- to Lua, so it is acceptable to have a function of the exact same name + -- in loader. Lua will have the first chance to handle any commands + -- executed at the loader prompt. + loader.perform("foo") +end +.Ed +.Pp +This function may be invoked by a user at the loader prompt by simply typing +.Ic foo . +Arguments may be passed to it as usual, space-delimited. +.Ss Default Commands +As of present, the +.Nm +module by default provides commands for +.Ic autoboot +and +.Ic boot . +In both cases, the +.Xr core.lua 8 +module will load all ELF modules as-needed before executing the equivalent +built-in loader commands. +All non-kernel arguments to these commands are passed in the same order to the +loader command. +.Ss Exported Functions +The following functions are exported from +.Nm : +.Bl -tag -width cli.arguments -offset indent +.It Fn cli.arguments ... +Takes varargs passed on the stack from +.Xr loader 8 +to +.Ic cli_execute , +splits them out into two return values: the command name, traditionally argv[0], +and the rest of argv. +.El +.Sh SEE ALSO +.Xr loader.conf 5 , +.Xr core.lua 8 , +.Xr loader 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-head@freebsd.org Sat Jun 9 20:01:04 2018 Return-Path: Delivered-To: svn-src-head@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 7C9D5101348B; Sat, 9 Jun 2018 20:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1C672392; Sat, 9 Jun 2018 20:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CDB622680; Sat, 9 Jun 2018 20:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59K13ac083506; Sat, 9 Jun 2018 20:01:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59K13HO083505; Sat, 9 Jun 2018 20:01:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806092001.w59K13HO083505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 Jun 2018 20:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334892 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 334892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 20:01:04 -0000 Author: markj Date: Sat Jun 9 20:01:03 2018 New Revision: 334892 URL: https://svnweb.freebsd.org/changeset/base/334892 Log: Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt. Reported by: O. Hartmann Reviewed by: bdrewery Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jun 9 19:51:09 2018 (r334891) +++ head/Makefile.inc1 Sat Jun 9 20:01:03 2018 (r334892) @@ -1843,7 +1843,8 @@ update: .PHONY # ELF Tool Chain libraries are needed for ELF tools and dtrace tools. # r296685 fix cross-endian objcopy # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. -.if ${BOOTSTRAPPING} < 1200020 +# r334881 added libdwarf constants used by ctfconvert. +.if ${BOOTSTRAPPING} < 1200067 _elftoolchain_libs= lib/libelf lib/libdwarf .endif Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 9 19:51:09 2018 (r334891) +++ head/sys/sys/param.h Sat Jun 9 20:01:03 2018 (r334892) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200066 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200067 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Jun 9 20:02:21 2018 Return-Path: Delivered-To: svn-src-head@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 9B73B10139CF; Sat, 9 Jun 2018 20:02:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::22f]) (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 1AE457275D; Sat, 9 Jun 2018 20:02:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x22f.google.com with SMTP id m5-v6so7893043pgd.3; Sat, 09 Jun 2018 13:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=koSyKsTI5cs6nykOAwCRAi7meAmarw+wd0GzaRnnDEE=; b=KLcdNQtfVH+shAu60nNyBEDarPIfE/wUDhBO6yscIf8+d1/F4IrYxdNAf8W4cDSUCM PPhEwls5ZfPX+tXq4mKLScsouSIaOrmSNFpe53Rdl+9Et8BxciFbzAE/U5KlBHVdp2yy gkiAaU5pfaeh6XLMmiVEQMqRroFMHW3iZvJ8ClO9yHHhd/WQi3W3uGPRtDG4fG71IZHW Aa7IIq6xjQyPjCrd/UjU0vUziBu5oZ7jN1Gylt+QmR93ubScZDFAecCKEZpAYj99Vbyz FdL8/nggwnLCrG9mVJRLYVyNybWt8+h4K6rXURt7owin8hAImvOL9ceQKP/PvuFQVNZn iJ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=koSyKsTI5cs6nykOAwCRAi7meAmarw+wd0GzaRnnDEE=; b=pt4jQDLWJ5xr+0XbZoK4LIAh8A277ruIZfyt9xlXpaflKc0ECQJaO90KZGqcCt2xEO 6qKabfaEMcBA52Qx9JggE+GTo63O2K7byFhcGxnScius9oxOuWyh0JLY8DtbRtcj0HtW hdouoV3AXkf6EpybEgqrhbZNIupeqIFI3/lM9YAG5fzPLw/t7SooPM3fSok1OopO5eoI j6oTLl9iVHLm/Bbg5ZNRIouC3cvtAi7GeJEXPnLDiUsrCzp+b4s9DM1JjHXghT1pwOjP F1eTEO8wj4gWhNSUVqo1vuusVuBtgKveimKdsBAF7VJtf9oZ2a0MOyREB/VHe1S0HSI3 aplg== X-Gm-Message-State: APt69E2c/UsYZpn2TWUeL8xCkU8K3yYjql7Hkj/IA4w8rArOddhzmDUN bnehG9CboR4jKEZ33W5ZYsTLoRIf X-Google-Smtp-Source: ADUXVKJEBkEK13u9zlLPPPF4D+CzEBtDr1WthASyGjIxuFRxU6IVw3UVWRJ4mbH48OYLNXjqXvF9sw== X-Received: by 2002:a62:fd0b:: with SMTP id p11-v6mr11301082pfh.52.1528574539993; Sat, 09 Jun 2018 13:02:19 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-156.dsl.bell.ca. [70.49.169.156]) by smtp.gmail.com with ESMTPSA id t3-v6sm67853220pgs.91.2018.06.09.13.02.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 13:02:19 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 16:02:16 -0400 From: Mark Johnston To: "O. Hartmann" Cc: Bryan Drewery , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609200215.GB25160@raichu> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> <20180609180237.GD1394@pesky> <20180609203741.20ff3112@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609203741.20ff3112@thor.intern.walstatt.dynvpn.de> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 20:02:21 -0000 On Sat, Jun 09, 2018 at 08:37:14PM +0200, O. Hartmann wrote: > I started on one of the faster boxes with a make cleanworld and tried then to rebuild > world and kernel. It ends up at the very same error for me. I believe r334892 will fix the problem, please give it a try. Sorry for the breakage. From owner-svn-src-head@freebsd.org Sat Jun 9 20:06:07 2018 Return-Path: Delivered-To: svn-src-head@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 4B3F01014704; Sat, 9 Jun 2018 20:06:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F07DF72B68; Sat, 9 Jun 2018 20:06:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D201C22805; Sat, 9 Jun 2018 20:06:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59K66dH088375; Sat, 9 Jun 2018 20:06:06 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59K66br088374; Sat, 9 Jun 2018 20:06:06 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092006.w59K66br088374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 20:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334893 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 20:06:07 -0000 Author: eadler Date: Sat Jun 9 20:06:06 2018 New Revision: 334893 URL: https://svnweb.freebsd.org/changeset/base/334893 Log: top(1): allow starting with -T flag Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 9 20:01:03 2018 (r334892) +++ head/usr.bin/top/top.c Sat Jun 9 20:06:06 2018 (r334893) @@ -328,7 +328,7 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid optind = 1; } - while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:tw")) != EOF) + while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw")) != EOF) { switch(i) { From owner-svn-src-head@freebsd.org Sat Jun 9 20:24:19 2018 Return-Path: Delivered-To: svn-src-head@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 7CFF810188EB; Sat, 9 Jun 2018 20:24:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E23073DA1; Sat, 9 Jun 2018 20:24:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B6D322B34; Sat, 9 Jun 2018 20:24:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59KOIdO098742; Sat, 9 Jun 2018 20:24:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59KOIwO098738; Sat, 9 Jun 2018 20:24:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806092024.w59KOIwO098738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 Jun 2018 20:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334894 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 334894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 20:24:19 -0000 Author: bapt Date: Sat Jun 9 20:24:17 2018 New Revision: 334894 URL: https://svnweb.freebsd.org/changeset/base/334894 Log: Isolate the pr(1) related code in its own source files This keeps diffreg.c closer to what it is supposed to do: diffing regular files. It also allows my code to get a proper license Added: head/usr.bin/diff/pr.c (contents, props changed) head/usr.bin/diff/pr.h (contents, props changed) Modified: head/usr.bin/diff/Makefile head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/Makefile ============================================================================== --- head/usr.bin/diff/Makefile Sat Jun 9 20:06:06 2018 (r334893) +++ head/usr.bin/diff/Makefile Sat Jun 9 20:24:17 2018 (r334894) @@ -3,7 +3,7 @@ .include PROG= diff -SRCS= diff.c diffdir.c diffreg.c xmalloc.c +SRCS= diff.c diffdir.c diffreg.c xmalloc.c pr.c HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sat Jun 9 20:06:06 2018 (r334893) +++ head/usr.bin/diff/diffreg.c Sat Jun 9 20:24:17 2018 (r334894) @@ -70,11 +70,7 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include -#include -#include #include #include @@ -88,15 +84,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include +#include "pr.h" #include "diff.h" #include "xmalloc.h" -#define _PATH_PR "/usr/bin/pr" - /* * diff - compare two files. */ @@ -260,13 +252,9 @@ diffreg(char *file1, char *file2, int flags, int capsi { FILE *f1, *f2; int i, rval; - int ostdout = -1; - int pr_pd, kq; - struct kevent *e; + struct pr *pr = NULL; cap_rights_t rights_ro; - e = NULL; - kq = -1; f1 = f2 = NULL; rval = D_SAME; anychange = 0; @@ -324,53 +312,9 @@ diffreg(char *file1, char *file2, int flags, int capsi goto closem; } - if (lflag) { - /* redirect stdout to pr */ - int pfd[2]; - pid_t pid; - char *header; + if (lflag) + pr = start_pr(file1, file2); - xasprintf(&header, "%s %s %s", diffargs, file1, file2); - signal(SIGPIPE, SIG_IGN); - fflush(stdout); - rewind(stdout); - pipe(pfd); - switch ((pid = pdfork(&pr_pd, PD_CLOEXEC))) { - case -1: - status |= 2; - free(header); - err(2, "No more processes"); - case 0: - /* child */ - if (pfd[0] != STDIN_FILENO) { - dup2(pfd[0], STDIN_FILENO); - close(pfd[0]); - } - close(pfd[1]); - execl(_PATH_PR, _PATH_PR, "-h", header, (char *)0); - _exit(127); - default: - - /* parent */ - if (pfd[1] != STDOUT_FILENO) { - ostdout = dup(STDOUT_FILENO); - dup2(pfd[1], STDOUT_FILENO); - close(pfd[1]); - } - close(pfd[0]); - rewind(stdout); - free(header); - kq = kqueue(); - if (kq == -1) - err(2, "kqueue"); - e = xmalloc(sizeof(struct kevent)); - EV_SET(e, pr_pd, EVFILT_PROCDESC, EV_ADD, NOTE_EXIT, 0, - NULL); - if (kevent(kq, e, 1, NULL, 0, NULL) == -1) - err(2, "kevent"); - } - } - if (capsicum) { cap_rights_init(&rights_ro, CAP_READ, CAP_FSTAT, CAP_SEEK); if (cap_rights_limit(fileno(f1), &rights_ro) < 0 @@ -443,26 +387,8 @@ diffreg(char *file1, char *file2, int flags, int capsi ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); check(f1, f2, flags); output(file1, f1, file2, f2, flags); - if (ostdout != -1 && e != NULL) { - /* close the pipe to pr and restore stdout */ - int wstatus; - - fflush(stdout); - if (ostdout != STDOUT_FILENO) { - close(STDOUT_FILENO); - dup2(ostdout, STDOUT_FILENO); - close(ostdout); - } - if (kevent(kq, NULL, 0, e, 1, NULL) == -1) - err(2, "kevent"); - wstatus = e[0].data; - close(kq); - if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0) - errx(2, "pr exited abnormally"); - else if (WIFSIGNALED(wstatus)) - errx(2, "pr killed by signal %d", - WTERMSIG(wstatus)); - } + if (pr != NULL) + stop_pr(pr); closem: if (anychange) { Added: head/usr.bin/diff/pr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/pr.c Sat Jun 9 20:24:17 2018 (r334894) @@ -0,0 +1,124 @@ +/*- + * Copyright (c) 2017 Baptiste Daroussin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "pr.h" +#include "diff.h" +#include "xmalloc.h" + +#define _PATH_PR "/usr/bin/pr" + +struct pr * +start_pr(char *file1, char *file2) +{ + int pfd[2]; + int pr_pd; + pid_t pid; + char *header; + struct pr *pr; + + pr = xcalloc(1, sizeof(*pr)); + + xasprintf(&header, "%s %s %s", diffargs, file1, file2); + signal(SIGPIPE, SIG_IGN); + fflush(stdout); + rewind(stdout); + pipe(pfd); + switch ((pid = pdfork(&pr_pd, PD_CLOEXEC))) { + case -1: + status |= 2; + free(header); + err(2, "No more processes"); + case 0: + /* child */ + if (pfd[0] != STDIN_FILENO) { + dup2(pfd[0], STDIN_FILENO); + close(pfd[0]); + } + close(pfd[1]); + execl(_PATH_PR, _PATH_PR, "-h", header, (char *)0); + _exit(127); + default: + + /* parent */ + if (pfd[1] != STDOUT_FILENO) { + pr->ostdout = dup(STDOUT_FILENO); + dup2(pfd[1], STDOUT_FILENO); + close(pfd[1]); + close(pfd[1]); + } + close(pfd[0]); + rewind(stdout); + free(header); + pr->kq = kqueue(); + if (pr->kq == -1) + err(2, "kqueue"); + pr->e = xmalloc(sizeof(struct kevent)); + EV_SET(pr->e, pr_pd, EVFILT_PROCDESC, EV_ADD, NOTE_EXIT, 0, + NULL); + if (kevent(pr->kq, pr->e, 1, NULL, 0, NULL) == -1) + err(2, "kevent"); + } + return (pr); +} + +/* close the pipe to pr and restore stdout */ +void +stop_pr(struct pr *pr) +{ + int wstatus; + + if (pr == NULL) + return; + + fflush(stdout); + if (pr->ostdout != STDOUT_FILENO) { + close(STDOUT_FILENO); + dup2(pr->ostdout, STDOUT_FILENO); + close(pr->ostdout); + } + if (kevent(pr->kq, NULL, 0, pr->e, 1, NULL) == -1) + err(2, "kevent"); + wstatus = pr->e[0].data; + close(pr->kq); + if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) != 0) + errx(2, "pr exited abnormally"); + else if (WIFSIGNALED(wstatus)) + errx(2, "pr killed by signal %d", + WTERMSIG(wstatus)); +} Added: head/usr.bin/diff/pr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/pr.h Sat Jun 9 20:24:17 2018 (r334894) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2017 Baptiste Daroussin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +struct pr { + int ostdout; + int kq; + struct kevent *e; +}; + +struct pr *start_pr(char *file1, char *file2); +void stop_pr(struct pr *); From owner-svn-src-head@freebsd.org Sat Jun 9 21:05:26 2018 Return-Path: Delivered-To: svn-src-head@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 B342610005C2; Sat, 9 Jun 2018 21:05:26 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6364A76021; Sat, 9 Jun 2018 21:05:26 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 447222320B; Sat, 9 Jun 2018 21:05:26 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59L5QPO019733; Sat, 9 Jun 2018 21:05:26 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59L5QWG019732; Sat, 9 Jun 2018 21:05:26 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201806092105.w59L5QWG019732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Sat, 9 Jun 2018 21:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334895 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 334895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 21:05:26 -0000 Author: ygy (doc committer) Date: Sat Jun 9 21:05:25 2018 New Revision: 334895 URL: https://svnweb.freebsd.org/changeset/base/334895 Log: Add myself to the calendar Requested by: mckusick Reviewed by: emaste Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Jun 9 20:24:17 2018 (r334894) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Jun 9 21:05:25 2018 (r334895) @@ -17,6 +17,7 @@ 01/06 Philippe Audeoud born in Bretigny-Sur-Orge, France, 1980 01/08 Michael L. Hostbaek born in Copenhagen, Denmark, 1977 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 +01/10 Guangyuan Yang born in Yangzhou, Jiangsu, People's Republic of China, 1997 01/12 Yen-Ming Lee born in Taipei, Taiwan, Republic of China, 1977 01/12 Ying-Chieh Liao born in Taipei, Taiwan, Republic of China, 1979 01/12 Kristof Provost born in Aalst, Belgium, 1983 From owner-svn-src-head@freebsd.org Sat Jun 9 21:09:25 2018 Return-Path: Delivered-To: svn-src-head@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 AF9131001372; Sat, 9 Jun 2018 21:09:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613E376423; Sat, 9 Jun 2018 21:09:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43BA423218; Sat, 9 Jun 2018 21:09:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59L9PXw019942; Sat, 9 Jun 2018 21:09:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59L9P9B019941; Sat, 9 Jun 2018 21:09:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806092109.w59L9P9B019941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 9 Jun 2018 21:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334896 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 334896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 21:09:25 -0000 Author: bapt Date: Sat Jun 9 21:09:24 2018 New Revision: 334896 URL: https://svnweb.freebsd.org/changeset/base/334896 Log: diff: Import fixes from OpenBSD original commit log by miller@OpenBSD r1.46: Fix exit value when diffing directories with missing files and the -N or -P options are not used. From Ibrahim Khalifa Modified: head/usr.bin/diff/diffdir.c Modified: head/usr.bin/diff/diffdir.c ============================================================================== --- head/usr.bin/diff/diffdir.c Sat Jun 9 21:05:25 2018 (r334895) +++ head/usr.bin/diff/diffdir.c Sat Jun 9 21:09:24 2018 (r334896) @@ -58,7 +58,7 @@ diffdir(char *p1, char *p2, int flags) dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1)); if (dirlen1 >= sizeof(path1) - 1) { warnc(ENAMETOOLONG, "%s", p1); - status = 2; + status |= 2; return; } if (path1[dirlen1 - 1] != '/') { @@ -68,7 +68,7 @@ diffdir(char *p1, char *p2, int flags) dirlen2 = strlcpy(path2, *p2 ? p2 : ".", sizeof(path2)); if (dirlen2 >= sizeof(path2) - 1) { warnc(ENAMETOOLONG, "%s", p2); - status = 2; + status |= 2; return; } if (path2[dirlen2 - 1] != '/') { @@ -131,12 +131,12 @@ diffdir(char *p1, char *p2, int flags) dp2++; } else if (pos < 0) { /* file only in first dir, only diff if -N */ - if (Nflag) + if (Nflag) { diffit(dent1, path1, dirlen1, path2, dirlen2, flags); - else { + } else { print_only(path1, dirlen1, dent1->d_name); - status = 1; + status |= 1; } dp1++; } else { @@ -146,7 +146,7 @@ diffdir(char *p1, char *p2, int flags) flags); else { print_only(path2, dirlen2, dent2->d_name); - status = 1; + status |= 1; } dp2++; } From owner-svn-src-head@freebsd.org Sat Jun 9 21:12:47 2018 Return-Path: Delivered-To: svn-src-head@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 566901002175; Sat, 9 Jun 2018 21:12:47 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC13F76A6C; Sat, 9 Jun 2018 21:12:46 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.173.237]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mh9cj-1ffBPs2cW9-00MOwd; Sat, 09 Jun 2018 23:12:41 +0200 Date: Sat, 9 Jun 2018 23:12:13 +0200 From: "O. Hartmann" To: Mark Johnston Cc: "O. Hartmann" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609231240.58d41bef@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180609200215.GB25160@raichu> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> <20180609180237.GD1394@pesky> <20180609203741.20ff3112@thor.intern.walstatt.dynvpn.de> <20180609200215.GB25160@raichu> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:g5KS0yce711n+6oq07d7FTSqrHxmZiAEnGdjDXvPc5QQIbhAaBW +h761KpQZ4AmzzMWZ6Qe3pTc9tsgMq3YGe8s8FwK5hnR2sgxfravUgXtYeNLDDU2+jPt0tY gIu2n/E/X4KxNdRjBdrth3SusdRL6nJgvXIZ0Iyu/2+BsX+hrVnVicuUhbOSAMBoydYdeYD idM+gsWUPH3hRUdOMbiRg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ujFt/rsUJYc=:4YaxEgmsIMn8l3/HpmLBq5 fqzSvpYHeRCoGfoJLZKmkPs6ILHPxtnPqAJ5FQgr1b3kCqVaCea4ATbZpAH9AvLzrz+Oc9Qu+ MBjAnP/wOIyE2trXvboyGayEdkGTL36oD7m9+S7UemU7priYU2JhP9uB5HiWa27pSE7ZLscJq d9GmXJOKavB6L10qNP3aMbVS/P/chehVQa1iAM2od6s0ZBjBPB79lLuZMqA9qu16K69OXWGIW tqx4WpLM2GS1qycd7mEcHDa8JNcIpodWGAG9YVArYRTKcbrYXMmP4JQvXm7OBkB8MFwpSJEV9 +mc9Lypicf85U65ET0HVUdz8AXuFGc6jwgHzl1meHVwDwozpTRtxDnN3DxL/oMV6PmkvWYWJv KViib29CH2sIez/hnJLY0n79KvO4v2R14Z3er4D8w7dLxT5M+rzF8SBESfGE94hGp/kUZme5V 0WZkIc9vQUg6tlZvc5kmD6dEYjLU7njg4tpEezfd5a85vWbkcHjzCiMex+3LwevuFDTFyYacq obYEuXzNs0ZPQnbNVssN8Y369ZO7+1wBnM9jGZYWPXjL1lF6BFgTpBOv91R/sKXw9sTQz3Uwr eVuhey+PRDcyCfZwstF24Ew9h8c7s3GER6hPMZ3niyGEO2CF1vhuLl69LkcqUUAVXYQJD+J/R 8VYte4UJDeP9rb52g+/fvQedx8zA09I+Tl8/I8ni2toup6KpelpOl+jjs+9sHIJmwoa+O/79d XHvY68ecmUTBOb/BrRATLj5gQDEgrLMOm2Vb04JJDPL7vDpn0jsvqpjNs8h/v5rGu32LRFFp8 hf6khRy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 21:12:47 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFNh dCwgOSBKdW4gMjAxOCAxNjowMjoxNiAtMDQwMA0KTWFyayBKb2huc3RvbiA8bWFya2pAZnJlZWJz ZC5vcmc+IHNjaHJpZWI6DQoNCj4gT24gU2F0LCBKdW4gMDksIDIwMTggYXQgMDg6Mzc6MTRQTSAr MDIwMCwgTy4gSGFydG1hbm4gd3JvdGU6DQo+ID4gSSBzdGFydGVkIG9uIG9uZSBvZiB0aGUgZmFz dGVyIGJveGVzIHdpdGggYSBtYWtlIGNsZWFud29ybGQgYW5kIHRyaWVkIHRoZW4gdG8gcmVidWls ZA0KPiA+IHdvcmxkIGFuZCBrZXJuZWwuIEl0IGVuZHMgdXAgYXQgdGhlIHZlcnkgc2FtZSBlcnJv ciBmb3IgbWUuICANCj4gDQo+IEkgYmVsaWV2ZSByMzM0ODkyIHdpbGwgZml4IHRoZSBwcm9ibGVt LCBwbGVhc2UgZ2l2ZSBpdCBhIHRyeS4gU29ycnkgZm9yDQo+IHRoZSBicmVha2FnZS4NCj4gX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1o ZWFkQGZyZWVic2Qub3JnIG1haWxpbmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3Jn L21haWxtYW4vbGlzdGluZm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFu eSBtYWlsIHRvICJzdm4tc3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNCllvdXIg YmVsaWV2ZSBzZWVtcyByaWdodC4NCg0KVGhhbmtzLA0KDQpvaA0KDQotIC0tIA0KTy4gSGFydG1h bm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcgbWVp bmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIgTWVp bnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJR05B VFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVD V3h4Q3lBQUtDUkRTNTI4ZnlGaFkNCmxCQ0NBZ0NpM3lBUkltM25jUU0wZXR3Q3lQYUJ2Y1BxZGpY Y3dmaFBQZ1dyeUw4QmNxREhvMGIydXNBRWdpczkNCldXN3lyMVJmMEt6N2l0RUtwWVBIK2M3K215 RFpBZjBialdmYTNOM2M0UFZRNjFSR0VkZE40aVBLRXFreHo1K0gNClk5Wm5MWDU2M3h2NlBoNFdt MWMvaFFMQUhicStkMzdrWlVTeDJZNWFjRHZTdXM1cXVIOHgNCj0zbUVJDQotLS0tLUVORCBQR1Ag U0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Sat Jun 9 21:40:25 2018 Return-Path: Delivered-To: svn-src-head@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 9D8161008102; Sat, 9 Jun 2018 21:40:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B734787B7; Sat, 9 Jun 2018 21:40:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C6602373E; Sat, 9 Jun 2018 21:40:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59LeOKL036199; Sat, 9 Jun 2018 21:40:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59LeO0S036198; Sat, 9 Jun 2018 21:40:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092140.w59LeO0S036198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 21:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334897 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 21:40:25 -0000 Author: eadler Date: Sat Jun 9 21:40:24 2018 New Revision: 334897 URL: https://svnweb.freebsd.org/changeset/base/334897 Log: top(1): Implement long options This also documents some reserved or differing options from top's original upstream. Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 9 21:09:24 2018 (r334896) +++ head/usr.bin/top/top.c Sat Jun 9 21:40:24 2018 (r334897) @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -86,6 +87,33 @@ static void (*d_process)(int line, char *thisline) = i static void reset_display(void); + +static const struct option longopts[] = { + { "cpu-display-mode", no_argument, NULL, 'C' }, /* differs from orignal */ + /* D reserved */ + { "thread", no_argument, NULL, 'H' }, + { "idle-procs", no_argument, NULL, 'I' }, + { "system-procs", no_argument, NULL, 'S' }, + { "thread-id", no_argument, NULL, 'T' }, /* differs from orignal */ + { "user", required_argument, NULL, 'U' }, + { "all", no_argument, NULL, 'a' }, + { "batch", no_argument, NULL, 'b' }, + /* c reserved */ + { "displays", required_argument, NULL, 'd' }, + { "interactive", no_argument, NULL, 'i' }, + { "jail-id", no_argument, NULL, 'j' }, + { "display-mode", required_argument, NULL, 'm' }, + /* n is identical to batch */ + { "sort-order", required_argument, NULL, 'o' }, + { "pid", required_argument, NULL, 'p' }, + { "quick", no_argument, NULL, 'q' }, + { "delay", required_argument, NULL, 's' }, + { "threads", no_argument, NULL, 't' }, + { "uids", no_argument, NULL, 'u' }, + { "version", no_argument, NULL, 'v' }, + { "system-idle-procs", no_argument, NULL, 'z' } +}; + static void reset_uids(void) { @@ -328,7 +356,7 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid optind = 1; } - while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw")) != EOF) + while ((i = getopt_long(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw", longopts, NULL)) != EOF) { switch(i) { From owner-svn-src-head@freebsd.org Sat Jun 9 21:40:34 2018 Return-Path: Delivered-To: svn-src-head@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 9E1BC1008189; Sat, 9 Jun 2018 21:40:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FF60788BA; Sat, 9 Jun 2018 21:40:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E84723742; Sat, 9 Jun 2018 21:40:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59LeXSn036247; Sat, 9 Jun 2018 21:40:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59LeXh9036246; Sat, 9 Jun 2018 21:40:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092140.w59LeXh9036246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334898 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 21:40:34 -0000 Author: eadler Date: Sat Jun 9 21:40:33 2018 New Revision: 334898 URL: https://svnweb.freebsd.org/changeset/base/334898 Log: top(1): initial pass to freebsdize the man page The previous man page used many conventions not typical in FreeBSD. Since we've forked top completely, convert the man page too. Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Sat Jun 9 21:40:24 2018 (r334897) +++ head/usr.bin/top/top.1 Sat Jun 9 21:40:33 2018 (r334898) @@ -1,390 +1,311 @@ .\" $FreeBSD$ -.nr N -1 -.nr D 2 -.TH TOP 1 Local -.UC 4 -.SH NAME -top \- display and update information about the top cpu processes -.SH SYNOPSIS -.B top -[ -.B \-abCHIijnPqStuvwz -] [ -.BI \-d count -] [ -.BI \-m io | cpu -] [ -.BI \-o field -] -.br -.ti +4 -[ -.BI \-p pid -] [ -.BI \-s time -] [ -.BI \-J jail -] [ -.BI \-U username -] [ -.I number -] -.SH DESCRIPTION -.\" This defines appropriate quote strings for nroff and troff -.ds lq \&" -.ds rq \&" -.if t .ds lq `` -.if t .ds rq '' -.\" Just in case these number registers aren't set yet... -.if \nN==0 .nr N 10 -.if \nD==0 .nr D 2 -.I Top +.Dd June 9, 2018 +.Dt TOP 1 +.Os +.Sh NAME +.Nm top +.Nd display and update information about the top cpu processes +.Sh SYNOPSIS +.Nm +.Op Fl CHIPSTabijnpqtuvxz +.Op Fl J Ar jail +.Op Fl U Ar uid +.Op Fl d Ar count +.Op Fl m Ar cpu|io +.Op Fl s Ar time +.Op Fl o Ar field +.Op Fl p Ar pid +.Op Ar count +.Sh DESCRIPTION +.Nm displays the top -.if !\nN==-1 \nN processes on the system and periodically updates this information. -.if \nN==-1 \ -\{\ If standard output is an intelligent terminal (see below) then as many processes as will fit on the terminal screen are displayed -by default. Otherwise, a good number of them are shown (around 20). -.\} -Raw cpu percentage is used to rank the processes. If -.I number +by default. +Otherwise, a good number of them are shown (around 20). +Raw cpu percentage is used to rank the processes. +If +.Ar number is given, then the top -.I number +.Ar number processes will be displayed instead of the default. -.PP -.I Top +.Pp +.Nm makes a distinction between terminals that support advanced capabilities -and those that do not. This -distinction affects the choice of defaults for certain options. In the -remainder of this document, an \*(lqintelligent\*(rq terminal is one that +and those that do not. +This distinction affects the choice of defaults for certain options. +In the remainder of this document, an \*(lqintelligent\*(rq terminal is one that supports cursor addressing, clear screen, and clear to end of line. Conversely, a \*(lqdumb\*(rq terminal is one that does not support such -features. If the output of -.I top +features. +If the output of +.Nm is redirected to a file, it acts as if it were being run on a dumb terminal. -.SH OPTIONS -.TP -.B \-C +.Bl -tag -width indent -compact +.It Fl C Toggle CPU display mode. By default top displays the weighted CPU percentage in the WCPU column (this is the same value that -.IR ps (1) +.Xr ps 1 displays as CPU). Each time -.B \-C +.It Fl C flag is passed it toggles between \*(lqraw cpu\*(rq mode and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or the \*(lqWCPU\*(rq column respectively. -.TP -.B \-S -Show system processes in the display. Normally, system processes such as -the pager and the swapper are not shown. This option makes them visible. -.TP -.B \-a +.It Fl S +Show system processes in the display. +Normally, system processes such as the pager and the swapper are not shown. +This option makes them visible. +.It Fl a Display command names derived from the argv[] vector, rather than real -executable name. It's useful when you want to watch applications, that -puts their status information there. If the real name differs from argv[0], +executable name. +It it useful when you want to watch applications, that +puts their status information there. +If the real name differs from argv[0], it will be displayed in parenthesis. -.TP -.B \-b -Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is -ignored. Interrupt characters (such as ^C and ^\e) still have an effect. +.It Fl b +Use \*(lqbatch\*(rq mode. +In this mode, all input from the terminal is +ignored. +Interrupt characters (such as ^C and ^\e) still have an effect. This is the default on a dumb terminal, or when the output is not a terminal. -.TP -.B \-H +.It Fl H Display each thread for a multithreaded process individually. By default a single summary line is displayed for each process. -.TP -.B \-i -Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately -read for processing. See the section on \*(lqInteractive Mode\*(rq +.It Fl i +Use \*(lqinteractive\*(rq mode. +In this mode, any input is immediately +read for processing. +See the section on \*(lqInteractive Mode\*(rq for an explanation of -which keys perform what functions. After the command is processed, the +which keys perform what functions. +After the command is processed, the screen will immediately be updated, even if the command was not -understood. This mode is the default when standard output is an +understood. +This mode is the default when standard output is an intelligent terminal. -.TP -.B \-I +.It Fl I Do not display idle processes. By default, top displays both active and idle processes. -.TP -.B \-j +.It Fl j Display the -.IR jail (8) +.Xr jail 8 ID. -.TP -.B \-T +.It Fl T Toggle displaying thread ID (tid) instead of process id (pid). -.TP -.B \-t +.It Fl t Do not display the -.I top -process. -.TP -.BI \-m display -Display either 'cpu' or 'io' statistics. Default is 'cpu'. -.TP -.B \-n -Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq +.Nm +process itself. +.It Fl display +Display either 'cpu' or 'io' statistics. +Default is 'cpu'. +.It Fl n +Use \*(lqnon-interactive\*(rq mode. +This is identical to \*(lqbatch\*(rq mode. -.TP -.B \-P +.It Fl P Display per-cpu CPU usage statistics. -.TP -.B \-q +.It Fl q Renice -.I top -to -20 so that it will run faster. This can be used when the system is +.Nm +to -20 so that it will run faster. +This can be used when the system is being very sluggish to improve the possibility of discovering the problem. This option can only be used by root. -.TP -.B \-u -Do not take the time to map uid numbers to usernames. Normally, -.I top +.It Fl u +Do not map uid numbers to usernames. +Normally, +.Nm will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map -all the user id numbers it encounters into login names. This option -disables all that, while possibly decreasing execution time. The uid -numbers are displayed instead of the names. -.TP -.B \-v +all the user id numbers it encounters into login names. +This option disables all that, while possibly decreasing execution time. +The uid numbers are displayed instead of the names. +.It Fl v Write version number information to stderr then exit immediately. -false other processing takes place when this option is used. To see current -revision information while top is running, use the help command \*(lq?\*(rq. -.TP -.B \-w +.It Fl w Display approximate swap usage for each process. -.TP -.B \-z +.It Fl z Do not display the system idle process. -.TP -.BI \-d count +.It Fl d Ar count Show only -.I count -displays, then exit. A display is considered to be one update of the -screen. This option allows the user to select the number of displays he -wants to see before -.I top -automatically exits. For intelligent terminals, no upper limit -is set. The default is 1 for dumb terminals. Please, note that for -.I count +.Ar count +displays, then exit. +A display is considered to be one update of the +screen. +The default is 1 for dumb terminals. +Note that for +.Ar count = 1 no information is available about the percentage of time spent by the CPU in every state. -.TP -.BI \-s time +.It Fl s Ar time Set the delay between screen updates to -.I time -seconds. The default delay between updates is \nD seconds. -.TP -.BI \-o field -Sort the process display area on the specified field. The field name +.Ar time +seconds. +The default delay between updates is 1 second. +.It Fl o Ar field +Sort the process display area on the specified field. +The field name is the name of the column as seen in the output, but in lower case: \*(lqcpu\*(lq, \*(rqsize\*(lq, \*(rqres\*(lq, \*(rqtime\*(lq, \*(rqpri\*(lq, \*(rqthreads\*(lq, \*(lqtotal\*(lq, \*(rqread\*(lq, \*(rqwrite\*(lq, \*(rqfault\*(lq, \*(rqvcsw\*(lq, \*(rqivcsw\*(lq, \*(lqjid\*(lq, \*(rqswap\*(lq or \*(rqpid\*(lq. -.TP -.BI \-p pid +.It Fl p Ar pid Show only the process -.IR pid . -.TP -.BI \-J jail +.Ar pid . +.It Fl J Ar jail Show only those processes owned by -.IR jail . +.Ar jail . This may be either the -.B jid +.Ar jid or -.B name +.Ar name of the jail. Use -.B 0 +0 to limit to host processes. -Using this option implies the -.B \-j -flag. -.PP -.BI \-U username +Using this option implies +.Fl j . +.Pp +.It Fl U Ar username Show only those processes owned by -.IR username . +.Ar username . This option currently only accepts usernames and will not understand uid numbers. -.PP +.El +.Pp Both -.I count +.Ar count and -.I number +.Ar number fields can be specified as \*(lqinfinite\*(rq, indicating that they can -stretch as far as possible. This is accomplished by using any proper +stretch as far as possible. +This is accomplished by using any proper prefix of the keywords \*(lqinfinity\*(rq, \*(lqmaximum\*(rq, or \*(lqall\*(rq. -The default for -.I count -on an intelligent terminal is, in fact, -.BI infinity . -.PP -The environment variable -.B TOP -is examined for options before the command line is scanned. This enables -a user to set his or her own defaults. The number of processes to display -can also be specified in the environment variable -.BR TOP . -The options -.BR \-a , -.BR \-C , -.BR \-H , -.BR \-I , -.BR \-j , -.BR \-P , -.BR \-S , -.BR \-T , -.BR \-t , -.BR \-u , -.BR \-w , -and -.B \-z -are actually toggles. A second specification of any of these options -will negate the first. Thus a user who has the environment variable -.B TOP -set to \*(lq\-I\*(rq may use the command \*(lqtop \-I\*(rq to see idle processes. -.SH "INTERACTIVE MODE" +Boolean flags are toggles. +A second specification of any of these options will negate the first. +.Sh "INTERACTIVE MODE" When -.I top +.Nm is running in \*(lqinteractive mode\*(rq, it reads commands from the -terminal and acts upon them accordingly. In this mode, the terminal is +terminal and acts upon them accordingly. +In this mode, the terminal is put in \*(lqCBREAK\*(rq, so that a character will be -processed as soon as it is typed. Almost always, a key will be +processed as soon as it is typed. +Almost always, a key will be pressed when -.I top +.Nm is between displays; that is, while it is waiting for -.I time -seconds to elapse. If this is the case, the command will be +.Ar time +seconds to elapse. +If this is the case, the command will be processed and the display will be updated immediately thereafter -(reflecting any changes that the command may have specified). This -happens even if the command was incorrect. If a key is pressed while -.I top +(reflecting any changes that the command may have specified). +This +happens even if the command was incorrect. +If a key is pressed while +.Nm is in the middle of updating the display, it will finish the update and -then process the command. Some commands require additional information, -and the user will be prompted accordingly. While typing this information +then process the command. +Some commands require additional information, +and the user will be prompted accordingly. +While typing this information in, the user's erase and kill keys (as set up by the command -.IR stty ) +.Xr stty 1 ) are recognized, and a newline terminates the input. -.PP +.Pp These commands are currently recognized (^L refers to control-L): -.TP -.B ^L +.Bl -tag -width indent +.It ^L Redraw the screen. -.IP "\fBh\fP\ or\ \fB?\fP" -Display a summary of the commands (help screen). Version information +.It h +Display a summary of the commands (help screen). +Version information is included in this display. -.TP -.B q +.It q Quit -.IR top. -.TP -.B d +.Nm +.It d Change the number of displays to show (prompt for new number). Remember that the next display counts as one, so typing -.B d1 +.It d1 will make -.I top +.Nm show one final display and then immediately exit. -.TP -.B m +.It m Toggle the display between 'cpu' and 'io' modes. -.TP -.B n or # +.It n or # Change the number of processes to display (prompt for new number). -.TP -.B s +.It s Change the number of seconds to delay between displays (prompt for new number). -.TP -.B S +.It S Toggle the display of system processes. -.TP -.B a +.It a Toggle the display of process titles. -.TP -.B k -Send a signal (\*(lqkill\*(rq by default) to a list of processes. This -acts similarly to the command -.IR kill (1)). -.TP -.B r -Change the priority (the \*(lqnice\*(rq) of a list of processes. +.It k +Send a signal (\*(lqkill\*(rq by default) to a list of processes. This acts similarly to the command -.IR renice (8)). -.TP -.B u +.Xr kill 1 . +.It r +Change the priority (the \*(lqnice\*(rq) of a list of processes. +This acts similarly to +.Xr renice 8 . +.It u Display only processes owned by a specific set of usernames (prompt for -username). If the username specified is simply \*(lq+\*(rq or \*(lq-\*(rq, -then processes belonging to all users will be displayed. Usernames can be added +username). +If the username specified is simply \*(lq+\*(rq or \*(lq-\*(rq, +then processes belonging to all users will be displayed. +Usernames can be added to and removed from the set by prepending them with \*(lq+\*(rq and \*(lq-\*(rq, respectively. -.TP -.B o -Change the order in which the display is sorted. This command is not -available on all systems. The sort key names vary from system to system -but usually include: \*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq, -\*(lqtime\*(rq. The default is cpu. -.TP -.B p +.It o +Change the order in which the display is sorted. +The sort key names include +\*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq, +\*(lqtime\*(rq. +The default is cpu. +.It p Display a specific process (prompt for pid). If the pid specified is simply \*(lq+\*(rq, then show all processes. -.TP -.B e +.It e Display a list of system errors (if any) generated by the last -.BR k ill -or -.BR r enice command. -.TP -.B H +.It B H Toggle the display of threads. -.TP -.B i -(or -.BR I ) +.It i or I Toggle the display of idle processes. -.TP -.B j +.It j Toggle the display of -.IR jail (8) +.Xr jail 8 ID. -.TP -.B J +.It J Display only processes owned by a specific jail (prompt for jail). If the jail specified is simply \*(lq+\*(rq, then processes belonging to all jails and the host will be displayed. This will also enable the display of JID. -.TP -.B P +.It P Toggle the display of per-CPU statistics. -.TP -.B T -Toggle display of TID vs PID -.TP -.B t +.It T +Toggle display of TID and PID +.It t Toggle the display of the -.I top +.Nm process. -.TP -.B w +.It w Toggle the display of swap usage. -.TP -.B z +.It z Toggle the display of the system idle process. -.SH "THE DISPLAY" -The actual display varies depending on the specific variant of Unix -that the machine is running. This description may not exactly match -what is seen by top running on this particular machine. Differences -are listed at the end of this manual entry. -.PP +.El +.Sh "THE DISPLAY" The top few lines of the display show general information about the state of the system, including the last process id assigned to a process (on most systems), @@ -396,19 +317,23 @@ the number of processes in each state and a percentage of time spent in each of the processor states (user, nice, system, and idle). It also includes information about physical and virtual memory allocation. -.PP +.Pp The remainder of the screen displays information about individual -processes. This display is similar in spirit to -.IR ps (1) -but it is not exactly the same. PID is the process id, -JID, when displayed, is the -.IR jail (8) +processes. +This display is similar in spirit to +.Xr ps 1 +but it is not exactly the same. +PID is the process id, +JID, when displayed, is the +.Xr jail 8 ID corresponding to the process, USERNAME is the name of the process's owner (if -.B \-u +.Fl u is specified, a UID column will be substituted for USERNAME), PRI is the current priority of the process, -NICE is the nice amount (in the range \-20 to 20), +NICE is the +.Xr nice 1 +amount, SIZE is the total size of the process (text, data, and stack), RES is the current amount of resident memory, SWAP is the approximate amount of swap, if enabled @@ -422,143 +347,93 @@ C is the processor number on which the process is exec TIME is the number of system and user cpu seconds that the process has used, WCPU, when displayed, is the weighted cpu percentage (this is the same value that -.IR ps (1) +.Xr ps 1 displays as CPU), CPU is the raw percentage and is the field that is sorted to determine the order of the processes, and COMMAND is the name of the command that the process is currently running (if the process is swapped out, this column is marked \*(lq\*(rq). -.SH NOTES +.Pp If a process is in the \*(lqSLEEP\*(rq or \*(lqLOCK\*(rq state, the state column will report the name of the event or lock on which the process is waiting. Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events are not. -.SH AUTHOR -William LeFebvre, EECS Department, Northwestern University -.SH ENVIRONMENT -.DT -TOP user-configurable defaults for options. -.SH FILES -.DT -/dev/kmem kernel memory -.br -/dev/mem physical memory -.br -/etc/passwd used to map uid numbers to user names -.br -/boot/kernel/kernel system image -.SH BUGS -Don't shoot me, but the default for -.B \-I -has changed once again. So many people were confused by the fact that -.I top -wasn't showing them all the processes that I have decided to make the -default behavior show idle processes, just like it did in version 2. -But to appease folks who can't stand that behavior, I have added the -ability to set \*(lqdefault\*(rq options in the environment variable -.B TOP -(see the OPTIONS section). Those who want the behavior that version -3.0 had need only set the environment variable -.B TOP -to \*(lq\-I\*(rq. -.PP +.Sh AUTHORS +.An William LeFebvre, EECS Department, Northwestern University +.Sh BUGS The command name for swapped processes should be tracked down, but this would make the program run slower. -.PP +.Pp As with -.IR ps (1), +.Xr ps 1 , things can change while -.I top -is collecting information for an update. The picture it gives is only a +.Nm +is collecting information for an update. +The picture it gives is only a close approximation to reality. -.SH SEE ALSO -kill(1), -ps(1), -stty(1), -mem(4), -getrusage(2), -renice(8) -.SH "FreeBSD NOTES" - -.SH DESCRIPTION OF MEMORY +.Sh ENVIRONMENT +.Bl -tag -width TOP -compact +.It Pa TOP +Default set of arguments to +.Nm . +.El +.Sh SEE ALSO +.Xr kill 1 , +.Xr ps 1 , +.Xr stty 1 , +.Xr getrusage 2 , +.Xr humanize_number 3 , +.Xr mem 4 , +.Xr renice 8 +.Sh DESCRIPTION OF MEMORY Mem: 61M Active, 86M Inact, 368K Laundry, 22G Wired, 102G Free ARC: 15G Total, 9303M MFU, 6155M MRU, 1464K Anon, 98M Header, 35M Other 15G Compressed, 27G Uncompressed, 1.75:1 Ratio, 174M Overhead Swap: 4096M Total, 532M Free, 13% Inuse, 80K In, 104K Out -.TP -.B K: -Kilobyte -.TP -.B M: -Megabyte -.TP -.B G: -Gigabyte -.TP -.B %: -1/100 -.SS Physical Memory Stats -.TP -.B Active: +.Sh Physical Memory Stats +.Bl -tag -width indent +.It Active: number of bytes active -.TP -.B Inact: +.It Inact: number of clean bytes inactive -.TP -.B Laundry: +.It Laundry: number of dirty bytes queued for laundering -.TP -.B Wired: -number of bytes wired down, including BIO-level cached file data pages -.TP -.B Buf: -number of bytes used for BIO-level disk caching -.TP -.B Free: +.It Wired: +number of bytes wired down, including IO-level cached file data pages +.It Buf: +number of bytes used for IO-level disk caching +.It Free: number of bytes free -.SS ZFS ARC Stats +.It ZFS ARC Stats These stats are only displayed when the ARC is in use. -.TP -.B Total: +.It Total: number of wired bytes used for the ZFS ARC -.TP -.B MRU: +.It MRU: number of ARC bytes holding most recently used data -.TP -.B MFU: +.It MFU: number of ARC bytes holding most frequently used data -.TP -.B Anon: +.It Anon: number of ARC bytes holding in flight data -.TP -.B Header: +.It Header: number of ARC bytes holding headers -.TP -.B Other: +.It Other: miscellaneous ARC bytes -.TP -.B Compressed: +.It Compressed: bytes of memory used by ARC caches -.TP -.B Uncompressed: +.It Uncompressed: bytes of data stored in ARC caches before compression -.TP -.B Ratio: +.It Ratio: compression ratio of data cached in the ARC -.SS Swap Stats -.TP -.B Total: +.It Swap Stats +.It Total: total available swap usage -.TP -.B Free: +.It Free: total free swap usage -.TP -.B Inuse: +.It Inuse: swap usage -.TP -.B In: +.It In: bytes paged in from swap devices (last interval) -.TP -.B Out: +.It Out: bytes paged out to swap devices (last interval) +.El From owner-svn-src-head@freebsd.org Sat Jun 9 22:30:11 2018 Return-Path: Delivered-To: svn-src-head@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 21AAB101313C; Sat, 9 Jun 2018 22:30:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7AE67B17B; Sat, 9 Jun 2018 22:30:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8EFD23F69; Sat, 9 Jun 2018 22:30:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59MUAia061559; Sat, 9 Jun 2018 22:30:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59MUAtY061558; Sat, 9 Jun 2018 22:30:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092230.w59MUAtY061558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 22:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334899 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 22:30:11 -0000 Author: eadler Date: Sat Jun 9 22:30:10 2018 New Revision: 334899 URL: https://svnweb.freebsd.org/changeset/base/334899 Log: top(1): implement additional missing long options Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 9 21:40:33 2018 (r334898) +++ head/usr.bin/top/top.c Sat Jun 9 22:30:10 2018 (r334899) @@ -87,12 +87,13 @@ static void (*d_process)(int line, char *thisline) = i static void reset_display(void); - static const struct option longopts[] = { { "cpu-display-mode", no_argument, NULL, 'C' }, /* differs from orignal */ /* D reserved */ { "thread", no_argument, NULL, 'H' }, { "idle-procs", no_argument, NULL, 'I' }, + { "jail", required_argument, NULL, 'J' }, + { "per-cpu", no_argument, NULL, 'P' }, { "system-procs", no_argument, NULL, 'S' }, { "thread-id", no_argument, NULL, 'T' }, /* differs from orignal */ { "user", required_argument, NULL, 'U' }, @@ -111,6 +112,7 @@ static const struct option longopts[] = { { "threads", no_argument, NULL, 't' }, { "uids", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'v' }, + { "swap", no_argument, NULL, 'w' }, { "system-idle-procs", no_argument, NULL, 'z' } }; From owner-svn-src-head@freebsd.org Sat Jun 9 23:08:03 2018 Return-Path: Delivered-To: svn-src-head@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 56DC7101B53D; Sat, 9 Jun 2018 23:08:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C61E7D0DC; Sat, 9 Jun 2018 23:08:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E196A245DA; Sat, 9 Jun 2018 23:08:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59N82Fv081475; Sat, 9 Jun 2018 23:08:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59N82Y9081474; Sat, 9 Jun 2018 23:08:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092308.w59N82Y9081474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 23:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334901 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:08:03 -0000 Author: eadler Date: Sat Jun 9 23:08:02 2018 New Revision: 334901 URL: https://svnweb.freebsd.org/changeset/base/334901 Log: top(1): handle specific pids better When told to watch a specific pid, don't filter idle, system, or self processes. The summary at the top will still flip correctly though. Modified: head/usr.bin/top/machine.c head/usr.bin/top/top.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 9 23:07:32 2018 (r334900) +++ head/usr.bin/top/machine.c Sat Jun 9 23:08:02 2018 (r334901) @@ -841,11 +841,11 @@ get_process_info(struct system_info *si, struct proces /* not in use */ continue; - if (!sel->self && pp->ki_pid == mypid) + if (!sel->self && pp->ki_pid == mypid && sel->pid == -1) /* skip self */ continue; - if (!sel->system && (pp->ki_flag & P_SYSTEM)) + if (!sel->system && (pp->ki_flag & P_SYSTEM) && sel->pid == -1) /* skip system process */ continue; @@ -861,7 +861,7 @@ get_process_info(struct system_info *si, struct proces /* skip zombies */ continue; - if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD) + if (!sel->kidle && pp->ki_tdflags & TDF_IDLETD && sel->pid == -1) /* skip kernel idle process */ continue; Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 9 23:07:32 2018 (r334900) +++ head/usr.bin/top/top.c Sat Jun 9 23:08:02 2018 (r334901) @@ -259,7 +259,6 @@ main(int argc, char *argv[]) char *order_name = NULL; int order_index = 0; fd_set readfds; - char old_system = false; static const char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwopT"; /* these defines enumerate the "strchr"s of the commands in command_chars */ @@ -381,7 +380,6 @@ _Static_assert(sizeof(command_chars) == CMD_toggletid case 'S': /* show system processes */ ps.system = true; - old_system = true; break; case 'I': /* show idle processes */ @@ -1086,7 +1084,6 @@ restart: break; case CMD_viewsys: ps.system = !ps.system; - old_system = ps.system; break; case CMD_showargs: fmt_flags ^= FMT_SHOWARGS; @@ -1193,7 +1190,6 @@ restart: if (tempbuf2[0] == '+' && tempbuf2[1] == '\0') { ps.pid = (pid_t)-1; - ps.system = old_system; } else { unsigned long long num; const char *errstr; @@ -1206,10 +1202,7 @@ restart: tempbuf2); no_command = true; } else { - if (ps.system == false) - old_system = false; ps.pid = (pid_t)num; - ps.system = true; } } putchar('\r'); From owner-svn-src-head@freebsd.org Sat Jun 9 23:13:54 2018 Return-Path: Delivered-To: svn-src-head@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 B9D49101C9BE for ; Sat, 9 Jun 2018 23:13:54 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5206C7D7DA for ; Sat, 9 Jun 2018 23:13:54 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f169.google.com (mail-yb0-f169.google.com [209.85.213.169]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 1E8FE25033 for ; Sat, 9 Jun 2018 23:13:54 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f169.google.com with SMTP id p22-v6so5550711yba.13 for ; Sat, 09 Jun 2018 16:13:54 -0700 (PDT) X-Gm-Message-State: APt69E3HixXz3+cPAo3xh8wNQ8+1W/wfGlQhuyz40DMfT/iBNCiM1x8K fM/A7IeefgkGUOfAoZZOB1KuUM7xsxEvIwoReHQb2Q== X-Google-Smtp-Source: ADUXVKLNcXyVwrD+reX0svdTwNfHU3MBuNENmJ51RwG/o7vo4rfKKxvQFGTA0S2sNGMAeO7wiTk2TBkq4w3YKlcQzOk= X-Received: by 2002:a5b:64c:: with SMTP id o12-v6mr6760901ybq.460.1528586033672; Sat, 09 Jun 2018 16:13:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 16:13:23 -0700 (PDT) In-Reply-To: References: <201806090214.w592EYsJ056425@repo.freebsd.org> <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> From: Eitan Adler Date: Sat, 9 Jun 2018 16:13:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334864 - head/usr.bin/top To: Florian Smeets Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:13:54 -0000 On 9 June 2018 at 08:55, Eitan Adler wrote: >>> Another issue I just found is that if you start top with -P some columns >>> don't show any values: Thanks to "git bisect" I've narrowed this down to r334822. Patch coming soon. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 23:15:00 2018 Return-Path: Delivered-To: svn-src-head@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 832B8101CD32; Sat, 9 Jun 2018 23:15:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 353B17D96C; Sat, 9 Jun 2018 23:15:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1646224770; Sat, 9 Jun 2018 23:15:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59NExFH086317; Sat, 9 Jun 2018 23:14:59 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59NExGv086316; Sat, 9 Jun 2018 23:14:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806092314.w59NExGv086316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 9 Jun 2018 23:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334902 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 334902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:15:00 -0000 Author: rmacklem Date: Sat Jun 9 23:14:59 2018 New Revision: 334902 URL: https://svnweb.freebsd.org/changeset/base/334902 Log: Delete an unused macro and clean up a comment about it. NFSDEV_MIRRORSTR was defined for the pNFS server, but has not been used, so this patch deletes it. It also cleans up the comment and hopefully makes it more readable. Modified: head/sys/fs/nfs/nfs.h Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Sat Jun 9 23:08:02 2018 (r334901) +++ head/sys/fs/nfs/nfs.h Sat Jun 9 23:14:59 2018 (r334902) @@ -179,13 +179,10 @@ struct nfsd_nfsd_args { }; /* - * NFSDEV_MIRRORSTR - string of digits that number the DSs 0->999. - * (To support more than 1000 DSs on an MDS, this needs to be increased.) - * NFSDEV_MAXMIRRORS - Maximum # of mirrors for a DS. - * (Most will only have a single mirror, but this setting allows up to 3.) + * NFSDEV_MAXMIRRORS - Maximum level of mirroring for a DS. + * (Most will only put files on two DSs, but this setting allows up to 4.) * NFSDEV_MAXVERS - maximum number of NFS versions supported by Flex File. */ -#define NFSDEV_MIRRORSTR 3 #define NFSDEV_MAXMIRRORS 4 #define NFSDEV_MAXVERS 4 From owner-svn-src-head@freebsd.org Sat Jun 9 23:24:09 2018 Return-Path: Delivered-To: svn-src-head@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 8CEA2101F1A3; Sat, 9 Jun 2018 23:24:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 346357E386; Sat, 9 Jun 2018 23:24:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1568924902; Sat, 9 Jun 2018 23:24:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59NO8nn091508; Sat, 9 Jun 2018 23:24:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59NO8vl091507; Sat, 9 Jun 2018 23:24:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806092324.w59NO8vl091507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 23:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334903 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 334903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:24:09 -0000 Author: eadler Date: Sat Jun 9 23:24:08 2018 New Revision: 334903 URL: https://svnweb.freebsd.org/changeset/base/334903 Log: top(1): correctly reset per-cpu counters I had changed this from a for loop to a memset during an earlier cleanup. This change was incorrect so revert it. While here, clean up Reported by: flo Modified: head/usr.bin/top/display.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sat Jun 9 23:14:59 2018 (r334902) +++ head/usr.bin/top/display.c Sat Jun 9 23:24:08 2018 (r334903) @@ -162,28 +162,23 @@ display_resize(void) int display_updatecpus(struct statics *statics) { - int *lp; int lines; int i; /* call resize to do the dirty work */ lines = display_resize(); if (pcpu_stats) - num_cpus = statics->ncpus; + num_cpus = statics->ncpus; else - num_cpus = 1; + num_cpus = 1; cpustates_column = 5; /* CPU: */ - if (num_cpus != 1) - cpustates_column += 2; /* CPU 0: */ - for (i = num_cpus; i > 9; i /= 10) - cpustates_column++; + if (num_cpus > 1) { + cpustates_column += 1 + digits(num_cpus); /* CPU #: */ + } /* fill the "last" array with all -1s, to insure correct updating */ - lp = lcpustates; - i = num_cpustates * num_cpus; - while (--i >= 0) - { - *lp++ = -1; + for (i = 0; i < num_cpustates * num_cpus; ++i) { + lcpustates[i] = -1; } return(lines); @@ -541,7 +536,9 @@ z_cpustates(void) } /* fill the "last" array with all -1s, to insure correct updating */ - memset(lcpustates, -1, num_cpustates * num_cpus); + for (i = 0; i < num_cpustates * num_cpus; ++i) { + lcpustates[i] = -1; + } } /* Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sat Jun 9 23:14:59 2018 (r334902) +++ head/usr.bin/top/utils.c Sat Jun 9 23:24:08 2018 (r334903) @@ -134,8 +134,8 @@ digits(int val) while (val > 0) { - cnt++; - val /= 10; + cnt++; + val /= 10; } return(cnt); } From owner-svn-src-head@freebsd.org Sat Jun 9 23:24:56 2018 Return-Path: Delivered-To: svn-src-head@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 B1C31101F4F0 for ; Sat, 9 Jun 2018 23:24:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6383B7E535 for ; Sat, 9 Jun 2018 23:24:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.161.179]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 28CAA2514A for ; Sat, 9 Jun 2018 23:24:56 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f179.google.com with SMTP id v197-v6so5252501ywc.13 for ; Sat, 09 Jun 2018 16:24:56 -0700 (PDT) X-Gm-Message-State: APt69E2D35OWW8qQAEiUGY+zPDQlaoE+0dDTUrUW0K5U3zpZjSm0gxWO boB4pXRBcl/EVUrk3y45TVfKd4YYOalFMTyHR1luwQ== X-Google-Smtp-Source: ADUXVKKAjDyCgOvbS4VKcESiTtykQKR7u0iQKnQ00sTw7YPQqdnNb/5wGWwSuBcoGVegArUU0EwKKh2LpvrTW/gGWAc= X-Received: by 2002:a81:2c56:: with SMTP id s83-v6mr6832558yws.387.1528586695769; Sat, 09 Jun 2018 16:24:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 16:24:25 -0700 (PDT) In-Reply-To: References: <201806090214.w592EYsJ056425@repo.freebsd.org> <06a78fe9-defe-d798-3764-4f1df521538f@smeets.xyz> From: Eitan Adler Date: Sat, 9 Jun 2018 16:24:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334864 - head/usr.bin/top To: Florian Smeets Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:24:56 -0000 On 9 June 2018 at 16:13, Eitan Adler wrote: > On 9 June 2018 at 08:55, Eitan Adler wrote: > >>>> Another issue I just found is that if you start top with -P some columns >>>> don't show any values: > > Thanks to "git bisect" I've narrowed this down to r334822. Patch coming soon. Fixed in r334903. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Sat Jun 9 23:38:23 2018 Return-Path: Delivered-To: svn-src-head@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 3D70510012EB; Sat, 9 Jun 2018 23:38:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E80757EF37; Sat, 9 Jun 2018 23:38:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8CD324AAC; Sat, 9 Jun 2018 23:38:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59NcMGH097184; Sat, 9 Jun 2018 23:38:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59NcMbi097183; Sat, 9 Jun 2018 23:38:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806092338.w59NcMbi097183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 9 Jun 2018 23:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334904 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 334904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 23:38:23 -0000 Author: rmacklem Date: Sat Jun 9 23:38:22 2018 New Revision: 334904 URL: https://svnweb.freebsd.org/changeset/base/334904 Log: Delete some macros that are unused. These macros were added because they were used by the pNFS server last year. However, they are no longer used by the pNFS server code and might as well be deleted. This is a partial reversion of r326735. Modified: head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sat Jun 9 23:24:08 2018 (r334903) +++ head/sys/fs/nfs/nfsport.h Sat Jun 9 23:38:22 2018 (r334904) @@ -705,21 +705,6 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKLAYOUT(l) mtx_unlock(&((l)->mtx)) #define NFSDDSLOCK() mtx_lock(&nfsrv_dslock_mtx) #define NFSDDSUNLOCK() mtx_unlock(&nfsrv_dslock_mtx) -#define NFSDSCLOCKMUTEXPTR (&nfsrv_dsclock_mtx) -#define NFSDSCLOCK() mtx_lock(&nfsrv_dsclock_mtx) -#define NFSDSCUNLOCK() mtx_unlock(&nfsrv_dsclock_mtx) -#define NFSDSRMLOCKMUTEXPTR (&nfsrv_dsrmlock_mtx) -#define NFSDSRMLOCK() mtx_lock(&nfsrv_dsrmlock_mtx) -#define NFSDSRMUNLOCK() mtx_unlock(&nfsrv_dsrmlock_mtx) -#define NFSDWRPCLOCKMUTEXPTR (&nfsrv_dwrpclock_mtx) -#define NFSDWRPCLOCK() mtx_lock(&nfsrv_dwrpclock_mtx) -#define NFSDWRPCUNLOCK() mtx_unlock(&nfsrv_dwrpclock_mtx) -#define NFSDSRPCLOCKMUTEXPTR (&nfsrv_dsrpclock_mtx) -#define NFSDSRPCLOCK() mtx_lock(&nfsrv_dsrpclock_mtx) -#define NFSDSRPCUNLOCK() mtx_unlock(&nfsrv_dsrpclock_mtx) -#define NFSDARPCLOCKMUTEXPTR (&nfsrv_darpclock_mtx) -#define NFSDARPCLOCK() mtx_lock(&nfsrv_darpclock_mtx) -#define NFSDARPCUNLOCK() mtx_unlock(&nfsrv_darpclock_mtx) /* * Use these macros to initialize/free a mutex.