Re: svn commit: r363068 - head/sys/kern

2020-07-10 Thread Piotr P. Stefaniak

 */
-   memcpy(sbp, >mnt_stat, sizeof(*sbp));
+   if (sbp != >mnt_stat)
+   memcpy(sbp, >mnt_stat, sizeof(*sbp));



Slightly unrelated question: wouldn't it be prudent to incorporate this
logic into memcpy?
___
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-unsubscr...@freebsd.org"


Re: svn commit: r362705 - head/bin/ps

2020-06-27 Thread Piotr P. Stefaniak

On 2020-06-27 22:21:02, Konstantin Belousov wrote:

On Sat, Jun 27, 2020 at 07:09:33PM +, Piotr Pawel Stefaniak wrote:

Author: pstef



@@ -1454,6 +1457,18 @@ pidmax_init(void)
xo_warn("unable to read kern.pid_max");
pid_max = 9;
}
+}
+
+static void
+smp_init(void)
+{
+   size_t size;
+
+   size = sizeof(smp);
+   if ((sysctlbyname("machdep.smp_active", , , NULL, 0) != 0 &&

There is no such sysctl machdep.smp_active, and it does not make sense to
call it (even if it existed in some ancient FreeBSD version, I am not sure).


top(1) does that.


+   sysctlbyname("kern.smp.active", , , NULL, 0) != 0) ||
+   size != sizeof(smp))

The indent on this and previous lines is wrong.


+   smp = 0;
 }

That said, I do not see why do you need to check this kind of configuration
at all, on UP we return CPU 0 for all threads.


I'll remove it.
___
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-unsubscr...@freebsd.org"


Re: svn commit: r358181 - head/usr.sbin/pstat

2020-06-22 Thread Piotr P. Stefaniak

On 2020-02-20 21:12:10, Christian S.J. Peron wrote:

Author: csjp
Date: Thu Feb 20 21:12:10 2020
New Revision: 358181
URL: https://svnweb.freebsd.org/changeset/base/358181

Log:
 - Implement -h (human readable) for the size of the underlying block disk.
   Currently, the size of the swap device is unconditionally reported using
   blocks, even if -h has been used.
 - While here, switch to CONVERT_BLOCKS() instead of CONVERT() which will
   avoid overflowing size counters (in human readable form see: r196244)
 - Update the column headers to reflect that a size is being reported instead
   of the block size units being used

 Before:

 $ swapinfo
 Device  1K-blocks UsedAvail Capacity
 /dev/gpt/swapfs   10485760  1048576 0%


In the above, the "1K-blocks" and "1048576" line up because both the
header and the value have field width of hlen which is always set by
getbsize(, ). In other words, the header name sets the
width for the column. It is especially apparent when you compare output
with BLOCKSIZE=10 and BLOCKSIZE=1K.


 After:

 $ swapinfo -h
 Device   Size UsedAvail Capacity
 /dev/gpt/swapfs1.0G   0B 1.0G 0%


Here the width for the header is sizeof "Size" and the width for values
of the size is 8, so the header and the values don't make up a column.

Since field width for all values of Size, Used, and Avail are hardcoded
to 8 as well as the column headers, I think the best suggestion I can
give is to change it like this:

@@ -475,7 +475,7 @@ print_swap_header(void)
 
if (humanflag) {

header = SIZEHDR;
-   hlen = sizeof(SIZEHDR);
+   hlen = 8; /* as the hardcoded field width of values */
} else {
header = getbsize(, );
}

Although 8 seems to me a bit high. And too bad that humanize_number() is
locale-agnostic. 


 Differential Revision: https://reviews.freebsd.org/D23758
 Reviewed by:   kevans
 MFC after: 3 weeks

Modified:
 head/usr.sbin/pstat/pstat.c

___
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-unsubscr...@freebsd.org"


Re: svn commit: r362460 - in head/sys: compat/cloudabi fs/devfs kern sys

2020-06-21 Thread Piotr P. Stefaniak

On 2020-06-21 08:51:24, Thomas Munro wrote:

Author: tmunro
Date: Sun Jun 21 08:51:24 2020
New Revision: 362460
URL: https://svnweb.freebsd.org/changeset/base/362460

Log:
 vfs: track sequential reads and writes separately


This sounds great to me! Have you considered MFC-ing this?
___
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-unsubscr...@freebsd.org"


Re: svn commit: r338239 - head

2018-08-23 Thread Piotr P. Stefaniak

On 2018-08-23 05:06:32, Warner Losh wrote:

Author: imp
Date: Thu Aug 23 05:06:31 2018
New Revision: 338239
URL: https://svnweb.freebsd.org/changeset/base/338239

Log:
 Add a special note to UPDATING for the devmatch stuff. While tested,
 there's an elevated risk of trouble, and you must update kernel,
 userland and rc scripts for the best experience.

Modified:
 head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Thu Aug 23 05:06:27 2018(r338238)
+++ head/UPDATING   Thu Aug 23 05:06:31 2018(r338239)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)

+20170822:


Shouldn't that be 20180822?
___
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-unsubscr...@freebsd.org"


Re: svn commit: r336481 - head/share/misc

2018-07-19 Thread Piotr P. Stefaniak

On 2018-07-19 12:58:10, Mateusz Piotrowski wrote:

Author: 0mp (ports committer)
Date: Thu Jul 19 12:58:10 2018
New Revision: 336481
URL: https://svnweb.freebsd.org/changeset/base/336481

Log:
 Update mentor and mentee information.

 Reviewed by:   mat (mentor)
 Approved by:   mat (mentor)
 Differential Revision: https://reviews.freebsd.org/D16295

Modified:
 head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Jul 19 12:56:54 2018
(r336480)
+++ head/share/misc/committers-ports.dotThu Jul 19 12:58:10 2018
(r336481)
@@ -40,6 +40,7 @@ node [color=lightblue2, style=filled, bgcolor=black];

# Current ports committers go here. Try to keep things sorted.

+0mp [label="Mateusz Piotrowski\n...@freebsd.org\n2018/06/16"]
ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]

dot(1) doesn't like this.
___
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-unsubscr...@freebsd.org"


Re: svn commit: r334817 - in head/usr.sbin/cron: cron crontab lib

2018-06-08 Thread Piotr P. Stefaniak

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:

 @25sleep 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.
___
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-unsubscr...@freebsd.org"


Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard

2017-02-21 Thread Piotr P. Stefaniak

On 2017-02-21 21:59:47, Piotr P. Stefaniak wrote:

$ tcc -Wt,f ./test.c -o test


Oops, of course it's "-Wt,-f". 


signature.asc
Description: PGP signature


Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard

2017-02-21 Thread Piotr P. Stefaniak

On 2017-02-22 00:46:31, Bruce Evans wrote:

On Mon, 20 Feb 2017, Conrad Meyer wrote:

Maybe this is moot.  I don't believe any architecture FreeBSD actually
supports has non-zero bitpattern NULL, but something weird like CHERI
might.


Compilers should do portability checks on it.  In fact, the convolutions
in this file do little except define nullptr and __null to let compilers
do more checking.  Only the C++ case even has them.  Compilers can do
most checks using just the C90 definition of null pointer constants.


tcc(1) of the TenDRA project can set the null pointer representation to
0x via -f option of trans(1) (but only on x86):

$ cat test.c
#include 
int main(void)
{
char *x = NULL;
unsigned long int y = (unsigned long int)x;
printf("%lx\n", y);
return 0;
}

$ tcc ./test.c -o test
$ ./test
0
$ tcc -Wt,f ./test.c -o test
$ ./test


See http://www.tendra.org/trans.1/ for more details.


signature.asc
Description: PGP signature