svn commit: r288145 - head/sys/kern

2015-09-23 Thread Mateusz Guzik
Author: mjg
Date: Wed Sep 23 12:45:08 2015
New Revision: 288145
URL: https://svnweb.freebsd.org/changeset/base/288145

Log:
  kqueue: simplify kern_kqueue by not refing/unrefing creds too early
  
  No functional changes.

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Wed Sep 23 07:44:07 2015(r288144)
+++ head/sys/kern/kern_event.c  Wed Sep 23 12:45:08 2015(r288145)
@@ -759,28 +759,25 @@ kern_kqueue(struct thread *td, int flags
struct filedesc *fdp;
struct kqueue *kq;
struct file *fp;
-   struct proc *p;
struct ucred *cred;
int fd, error;
 
-   p = td->td_proc;
+   fdp = td->td_proc->p_fd;
cred = td->td_ucred;
-   crhold(cred);
-   if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_KQUEUES))) {
-   crfree(cred);
+   if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_KQUEUES)))
return (ENOMEM);
-   }
 
-   fdp = p->p_fd;
error = falloc_caps(td, , , flags, fcaps);
-   if (error)
-   goto done2;
+   if (error != 0) {
+   chgkqcnt(cred->cr_ruidinfo, -1, 0);
+   return (error);
+   }
 
/* An extra reference on `fp' has been held for us by falloc(). */
kq = malloc(sizeof *kq, M_KQUEUE, M_WAITOK | M_ZERO);
kqueue_init(kq);
kq->kq_fdp = fdp;
-   kq->kq_cred = cred;
+   kq->kq_cred = crhold(cred);
 
FILEDESC_XLOCK(fdp);
TAILQ_INSERT_HEAD(>fd_kqlist, kq, kq_list);
@@ -790,12 +787,7 @@ kern_kqueue(struct thread *td, int flags
fdrop(fp, td);
 
td->td_retval[0] = fd;
-done2:
-   if (error != 0) {
-   chgkqcnt(cred->cr_ruidinfo, -1, 0);
-   crfree(cred);
-   }
-   return (error);
+   return (0);
 }
 
 #ifndef _SYS_SYSPROTO_H_
___
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: r286995 - head/share/mk

2015-09-23 Thread Bryan Drewery
On 9/22/2015 11:25 PM, Baptiste Daroussin wrote:
> On Tue, Sep 22, 2015 at 10:07:33PM -0700, Bryan Drewery wrote:
>> On 8/21/15 8:15 AM, Warner Losh wrote:
>>> Author: imp
>>> Date: Fri Aug 21 15:15:22 2015
>>> New Revision: 286995
>>> URL: https://svnweb.freebsd.org/changeset/base/286995
>>>
>>> Log:
>>>   Document bsd.progs.mk, including its status as being strongly
>>>   discouraged and that it will be going away as soon as is practicable.
>>>
>>> Modified:
>>>   head/share/mk/bsd.README
>>
>> I find this functionality irreplaceable for simplicity. The alternative
>> is more Makefiles for simple extra progs. Granted it has meta mode
>> dirdeps issues but I think that is acceptable as there are other ways to
>> address that.
>>
>> Where is this deprecation coming from? Is it just due to bapt's
>> in-progress (but not working) patch at https://reviews.freebsd.org/D3444
>> to remove bsd.progs.mk in place of PROGS in bsd.prog.mk?
>>
>> I would like to document PROGS properly. I had no idea how it worked
>> until reading over it tonight. If the plan wasn't to remove PROGS itself
>> I will do so.
>>
> This is the exact opposite.
> 
> the review comes from the fact that bsd.progs.mk is broken.and has not be 
> fixed
> for a while. The brokenness comes from the fact it is including magically
> bsd.prog.mk multiple times, the easiy to see brokenness is the fact that
> everything defining FILES/SCRIPTS and other magic macros that bsd.prog.mk 
> accept
> via it multiple inputs will be reinstalled multiple times, one can fix those 
> by
> exhaustively adding overwrites of every single macros, but hat would be really
> tedious each time one of the thing included in bsd.prog.mk get modified or 
> added
> 

I have fixed this actually. I am committing today.

> You can easily see that for all the bsd.tests.mk.
> 
> While I do really like the fonctionnality it is very complicticated to get it
> working.
> 
> My work in progress version is eaily fixable by adding:
> https://lists.freebsd.org/pipermail/freebsd-arch/2003-June/000906.html
> 
> And extending the above for LDFLAGS and CXXFLAGS.
> 
> Which had been rejected in the past multiple times :(
> 
> The subject came back again
> https://lists.freebsd.org/pipermail/freebsd-arch/2010-September/010613.html
> 
> I think D3444 would be a good excuse to bring back the idea of perfiles 
> specific
> FLAGS. But I didn't want to wake up dead subject noone agreed on.
> 
> Best regards,
> Bapt
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r288146 - head/sys/cam/ctl

2015-09-23 Thread Alexander Motin
Author: mav
Date: Wed Sep 23 15:49:27 2015
New Revision: 288146
URL: https://svnweb.freebsd.org/changeset/base/288146

Log:
  Make HA peers announce their parameters on connect.
  
  HA protocol requires strict version, parameters and configuration match.
  Differences there may cause full set of problems up to kernel panic.
  To avoid that, validate peer parameters on connect, and abort connection
  immediately if some mismatch detected.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_ha.c
  head/sys/cam/ctl/ctl_ha.h
  head/sys/cam/ctl/ctl_io.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Wed Sep 23 12:45:08 2015(r288145)
+++ head/sys/cam/ctl/ctl.c  Wed Sep 23 15:49:27 2015(r288146)
@@ -715,8 +715,20 @@ ctl_isc_ha_link_up(struct ctl_softc *sof
 {
struct ctl_port *port;
struct ctl_lun *lun;
+   union ctl_ha_msg msg;
int i;
 
+   /* Announce this node parameters to peer for validation. */
+   msg.login.msg_type = CTL_MSG_LOGIN;
+   msg.login.version = CTL_HA_VERSION;
+   msg.login.ha_mode = softc->ha_mode;
+   msg.login.ha_id = softc->ha_id;
+   msg.login.max_luns = CTL_MAX_LUNS;
+   msg.login.max_ports = CTL_MAX_PORTS;
+   msg.login.max_init_per_port = CTL_MAX_INIT_PER_PORT;
+   ctl_ha_msg_send(CTL_HA_CHAN_CTL, , sizeof(msg.login),
+   M_WAITOK);
+
STAILQ_FOREACH(port, >port_list, links) {
ctl_isc_announce_port(port);
for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) {
@@ -999,6 +1011,36 @@ ctl_isc_iid_sync(struct ctl_softc *softc
port->wwpn_iid[iid].name = NULL;
 }
 
+static void
+ctl_isc_login(struct ctl_softc *softc, union ctl_ha_msg *msg, int len)
+{
+
+   if (msg->login.version != CTL_HA_VERSION) {
+   printf("CTL HA peers have different versions %d != %d\n",
+   msg->login.version, CTL_HA_VERSION);
+   ctl_ha_msg_abort(CTL_HA_CHAN_CTL);
+   return;
+   }
+   if (msg->login.ha_mode != softc->ha_mode) {
+   printf("CTL HA peers have different ha_mode %d != %d\n",
+   msg->login.ha_mode, softc->ha_mode);
+   ctl_ha_msg_abort(CTL_HA_CHAN_CTL);
+   return;
+   }
+   if (msg->login.ha_id == softc->ha_id) {
+   printf("CTL HA peers have same ha_id %d\n", msg->login.ha_id);
+   ctl_ha_msg_abort(CTL_HA_CHAN_CTL);
+   return;
+   }
+   if (msg->login.max_luns != CTL_MAX_LUNS ||
+   msg->login.max_ports != CTL_MAX_PORTS ||
+   msg->login.max_init_per_port != CTL_MAX_INIT_PER_PORT) {
+   printf("CTL HA peers have different limits\n");
+   ctl_ha_msg_abort(CTL_HA_CHAN_CTL);
+   return;
+   }
+}
+
 /*
  * ISC (Inter Shelf Communication) event handler.  Events from the HA
  * subsystem come in here.
@@ -1275,9 +1317,13 @@ ctl_isc_event_handler(ctl_ha_channel cha
case CTL_MSG_IID_SYNC:
ctl_isc_iid_sync(softc, msg, param);
break;
+   case CTL_MSG_LOGIN:
+   ctl_isc_login(softc, msg, param);
+   break;
default:
printf("Received HA message of unknown type %d\n",
msg->hdr.msg_type);
+   ctl_ha_msg_abort(CTL_HA_CHAN_CTL);
break;
}
if (msg != )

Modified: head/sys/cam/ctl/ctl_ha.c
==
--- head/sys/cam/ctl/ctl_ha.c   Wed Sep 23 12:45:08 2015(r288145)
+++ head/sys/cam/ctl/ctl_ha.c   Wed Sep 23 15:49:27 2015(r288146)
@@ -283,8 +283,9 @@ ctl_ha_rx_thread(void *arg)
else
next = sizeof(wire_hdr);
SOCKBUF_LOCK(>so_rcv);
-   while (sbavail(>so_rcv) < next) {
-   if (softc->ha_connected == 0 || so->so_error ||
+   while (sbavail(>so_rcv) < next || softc->ha_disconnect) {
+   if (softc->ha_connected == 0 || softc->ha_disconnect ||
+   so->so_error ||
(so->so_rcv.sb_state & SBS_CANTRCVMORE)) {
goto errout;
}
@@ -541,6 +542,18 @@ ctl_ha_listen(struct ha_softc *softc)
printf("%s: REUSEADDR setting failed %d\n",
__func__, error);
}
+   bzero(, sizeof(struct sockopt));
+   opt.sopt_dir = SOPT_SET;
+   opt.sopt_level = SOL_SOCKET;
+   opt.sopt_name = SO_REUSEPORT;
+   opt.sopt_val = 
+   opt.sopt_valsize = sizeof(val);
+   val = 1;
+   

Re: svn commit: r286995 - head/share/mk

2015-09-23 Thread Warner Losh
On Tue, Sep 22, 2015 at 10:07 PM, Bryan Drewery 
wrote:

> On 8/21/15 8:15 AM, Warner Losh wrote:
> > Author: imp
> > Date: Fri Aug 21 15:15:22 2015
> > New Revision: 286995
> > URL: https://svnweb.freebsd.org/changeset/base/286995
> >
> > Log:
> >   Document bsd.progs.mk, including its status as being strongly
> >   discouraged and that it will be going away as soon as is practicable.
> >
> > Modified:
> >   head/share/mk/bsd.README
>
> I find this functionality irreplaceable for simplicity. The alternative
> is more Makefiles for simple extra progs. Granted it has meta mode
> dirdeps issues but I think that is acceptable as there are other ways to
> address that.
>
> Where is this deprecation coming from? Is it just due to bapt's
> in-progress (but not working) patch at https://reviews.freebsd.org/D3444
> to remove bsd.progs.mk in place of PROGS in bsd.prog.mk?
>
> I would like to document PROGS properly. I had no idea how it worked
> until reading over it tonight. If the plan wasn't to remove PROGS itself
> I will do so.
>

It doesn't work and has lots of issues. Those issues haven't been fixed.
It didn't look like they would be fixed any time soon. It seemed there
was a consensus to deprecate it because of those issues.
bapt was part of that group, and his problems with packaging that
bsd.progs.mk creates played into this decision.

If the issues are fixed, then we can change our recommendations based
on the changed circumstance.

Warner
___
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: r286995 - head/share/mk

2015-09-23 Thread Bryan Drewery
On 9/23/2015 9:44 AM, Warner Losh wrote:
> 
> 
> On Tue, Sep 22, 2015 at 10:07 PM, Bryan Drewery  > wrote:
> 
> On 8/21/15 8:15 AM, Warner Losh wrote:
> > Author: imp
> > Date: Fri Aug 21 15:15:22 2015
> > New Revision: 286995
> > URL: https://svnweb.freebsd.org/changeset/base/286995
> >
> > Log:
> >   Document bsd.progs.mk , including its
> status as being strongly
> >   discouraged and that it will be going away as soon as is
> practicable.
> >
> > Modified:
> >   head/share/mk/bsd.README
> 
> I find this functionality irreplaceable for simplicity. The alternative
> is more Makefiles for simple extra progs. Granted it has meta mode
> dirdeps issues but I think that is acceptable as there are other ways to
> address that.
> 
> Where is this deprecation coming from? Is it just due to bapt's
> in-progress (but not working) patch at https://reviews.freebsd.org/D3444
> to remove bsd.progs.mk  in place of PROGS in
> bsd.prog.mk ?
> 
> I would like to document PROGS properly. I had no idea how it worked
> until reading over it tonight. If the plan wasn't to remove PROGS itself
> I will do so.
> 
> 
> It doesn't work and has lots of issues. Those issues haven't been fixed.
> It didn't look like they would be fixed any time soon. It seemed there
> was a consensus to deprecate it because of those issues.
> bapt was part of that group, and his problems with packaging that
> bsd.progs.mk  creates played into this decision.
> 
> If the issues are fixed, then we can change our recommendations based
> on the changed circumstance.
> 
> Warner

Yes I think I've addressed the issues. I'm still testing and will have
it committed soon. It is still fragile, but most of share/mk is.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r288147 - head/lib/libc/isc

2015-09-23 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Sep 23 16:16:16 2015
New Revision: 288147
URL: https://svnweb.freebsd.org/changeset/base/288147

Log:
  Use ANSI C prototypes.  Eliminates -Wold-style-definition warnings.
  
  Submitted by:   Sascha Wildner 
  Obtained from:  DragonFlyBSD (commit 5d7d35b17f98588c39b30036f1a3fe8802935c2c)

Modified:
  head/lib/libc/isc/ev_timers.c

Modified: head/lib/libc/isc/ev_timers.c
==
--- head/lib/libc/isc/ev_timers.c   Wed Sep 23 15:49:27 2015
(r288146)
+++ head/lib/libc/isc/ev_timers.c   Wed Sep 23 16:16:16 2015
(r288147)
@@ -117,7 +117,7 @@ evCmpTime(struct timespec a, struct time
 }
 
 struct timespec
-evNowTime() {
+evNowTime(void) {
struct timeval now;
 #ifdef CLOCK_REALTIME
struct timespec tsnow;
@@ -136,7 +136,7 @@ evNowTime() {
 }
 
 struct timespec
-evUTCTime() {
+evUTCTime(void) {
struct timeval now;
 #ifdef CLOCK_REALTIME
struct timespec tsnow;
___
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: r287185 - head/share/mk

2015-09-23 Thread Warner Losh
I've been making a pass through the tree and found that

FOO.${MK_BAR}+= a b c

vs

.if ${MK_BAR} != "no"
FOO+= a b c
.endif

simpler to understand. This commit is one small slice of that which I could
commit. These files have a high enough churn rate that I'm not always able
to keep up enough to push my changes. So this was part of what I could do
today to start to reduce my patch-set.

This was discussed on a...@freebsd.org a while ago.

Warner

On Tue, Sep 22, 2015 at 9:32 PM, Bryan Drewery  wrote:

> On 8/26/15 6:52 PM, Warner Losh wrote:
> > Author: imp
> > Date: Thu Aug 27 01:52:45 2015
> > New Revision: 287185
> > URL: https://svnweb.freebsd.org/changeset/base/287185
> >
> > Log:
> >   For each FOO in FILESLISTS, append the value of FOO.yes, sort, and
> >   remove duplicates.
> >
> > Modified:
> >   head/share/mk/bsd.files.mk
> >
> > Modified: head/share/mk/bsd.files.mk
> >
> ==
> > --- head/share/mk/bsd.files.mkThu Aug 27 01:02:01 2015
> (r287184)
> > +++ head/share/mk/bsd.files.mkThu Aug 27 01:52:45 2015
> (r287185)
> > @@ -10,6 +10,9 @@ :
> >  FILESGROUPS?=FILES
> >
> >  .for group in ${FILESGROUPS}
> > +# Add in foo.yes and remove duplicates from all the groups
> > +${${group}}:= ${${group}} ${${group}.yes}
> > +${${group}}:= ${${group}:O:u}
> >  buildfiles: ${${group}}
> >  .endfor
> >
> >
>
> What is this for?
>
> --
> Regards,
> Bryan Drewery
>
___
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: r287185 - head/share/mk

2015-09-23 Thread Bryan Drewery
On 9/23/2015 9:37 AM, Warner Losh wrote:
> I've been making a pass through the tree and found that
> 
> FOO.${MK_BAR}+= a b c
> 
> vs
> 
> .if ${MK_BAR} != "no"
> FOO+= a b c
> .endif
> 

Ah I see.

> simpler to understand. This commit is one small slice of that which I
> could commit. These files have a high enough churn rate that I'm not
> always able to keep up enough to push my changes. So this was part of
> what I could do today to start to reduce my patch-set.
> 
> This was discussed on a...@freebsd.org  a while
> ago.
> 

Sounds good, thanks.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r286995 - head/share/mk

2015-09-23 Thread Garrett Cooper

> On Sep 23, 2015, at 10:02, Bryan Drewery  wrote:
> 
>> On 9/23/2015 9:44 AM, Warner Losh wrote:
>> 
>> 
>> On Tue, Sep 22, 2015 at 10:07 PM, Bryan Drewery > > wrote:
>> 
>>>On 8/21/15 8:15 AM, Warner Losh wrote:
>>> Author: imp
>>> Date: Fri Aug 21 15:15:22 2015
>>> New Revision: 286995
>>> URL: https://svnweb.freebsd.org/changeset/base/286995
>>> 
>>> Log:
>>>  Document bsd.progs.mk , including its
>>status as being strongly
>>>  discouraged and that it will be going away as soon as is
>>practicable.
>>> 
>>> Modified:
>>>  head/share/mk/bsd.README
>> 
>>I find this functionality irreplaceable for simplicity. The alternative
>>is more Makefiles for simple extra progs. Granted it has meta mode
>>dirdeps issues but I think that is acceptable as there are other ways to
>>address that.
>> 
>>Where is this deprecation coming from? Is it just due to bapt's
>>in-progress (but not working) patch at https://reviews.freebsd.org/D3444
>>to remove bsd.progs.mk  in place of PROGS in
>>bsd.prog.mk ?
>> 
>>I would like to document PROGS properly. I had no idea how it worked
>>until reading over it tonight. If the plan wasn't to remove PROGS itself
>>I will do so.
>> 
>> 
>> It doesn't work and has lots of issues. Those issues haven't been fixed.
>> It didn't look like they would be fixed any time soon. It seemed there
>> was a consensus to deprecate it because of those issues.
>> bapt was part of that group, and his problems with packaging that
>> bsd.progs.mk  creates played into this decision.
>> 
>> If the issues are fixed, then we can change our recommendations based
>> on the changed circumstance.
>> 
>> Warner
> 
> Yes I think I've addressed the issues. I'm still testing and will have
> it committed soon. It is still fragile, but most of share/mk is.

I know you've been playing with meta mode a lot. Have you tried building with 
non-meta mode, with MK_TESTS=yes, then run he following steps as root after a 
successful installworld?

NOTE: wipe out /usr/tests before running installworld to ensure the files that 
are present there aren't from previous runs

cd /usr/tests
kyua test

Please add me to the CR.

Thanks,
-NGie
___
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: r286995 - head/share/mk

2015-09-23 Thread Garrett Cooper

> On Sep 23, 2015, at 11:20, Bryan Drewery  wrote:

...

>> NOTE: wipe out /usr/tests before running installworld to ensure the files 
>> that are present there aren't from previous runs
>> 
>> cd /usr/tests
>> kyua test
> 
> I am comparing full objtree and destdir from before/after the change,
> including a 'make clean' comparison. There's no room for missing anything.

make install[world] is where I and others have run into failures in the past. 
Please be sure to test this out.

If you move /usr/tests off to another directory, you could run diff -Narq as 
well (which will be faster than kyua test as far as finding potential issues 
are concerned with missing files).
___
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: r286995 - head/share/mk

2015-09-23 Thread Bryan Drewery
On 9/23/2015 11:41 AM, Garrett Cooper wrote:
> 
>> On Sep 23, 2015, at 11:20, Bryan Drewery  wrote:
> 
> ...
> 
>>> NOTE: wipe out /usr/tests before running installworld to ensure the files 
>>> that are present there aren't from previous runs
>>>
>>> cd /usr/tests
>>> kyua test
>>
>> I am comparing full objtree and destdir from before/after the change,
>> including a 'make clean' comparison. There's no room for missing anything.
> 
> make install[world] is where I and others have run into failures in the past. 
> Please be sure to test this out.
> 

This is what I mean by 'destdir' comparison. Installworld.

> If you move /usr/tests off to another directory, you could run diff -Narq as 
> well (which will be faster than kyua test as far as finding potential issues 
> are concerned with missing files).
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r288151 - head/contrib/llvm/projects

2015-09-23 Thread Ed Maste
Author: emaste
Date: Wed Sep 23 19:30:46 2015
New Revision: 288151
URL: https://svnweb.freebsd.org/changeset/base/288151

Log:
  Bring LLVM libunwind snapshot into contrib/llvm/projects

Added:
  head/contrib/llvm/projects/
 - copied from r288150, vendor/llvm-libunwind/dist/
Directory Properties:
  head/contrib/llvm/projects/libunwind/   (props changed)
___
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"


svn commit: r288148 - head/sys/cam/ctl

2015-09-23 Thread Alexander Motin
Author: mav
Date: Wed Sep 23 18:33:00 2015
New Revision: 288148
URL: https://svnweb.freebsd.org/changeset/base/288148

Log:
  Synchronize mode pages between HA peers.
  
  We allow to modify only few fields in mode pages now, but still it is
  not good if they unexpectedly change during failover.  Also this fixes
  reporting of "Mode parameters changed" UAs on secondary node.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_io.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Wed Sep 23 16:16:16 2015(r288147)
+++ head/sys/cam/ctl/ctl.c  Wed Sep 23 18:33:00 2015(r288148)
@@ -611,6 +611,14 @@ alloc:
ctl_ha_msg_send(CTL_HA_CHAN_CTL, >port, sizeof(msg->port) + i,
M_WAITOK);
free(msg, M_CTL);
+
+   if (lun->flags & CTL_LUN_PRIMARY_SC) {
+   for (i = 0; i < CTL_NUM_MODE_PAGES; i++) {
+   ctl_isc_announce_mode(lun, -1,
+   lun->mode_pages.index[i].page_code & SMPH_PC_MASK,
+   lun->mode_pages.index[i].subpage);
+   }
+   }
 }
 
 void
@@ -710,6 +718,38 @@ ctl_isc_announce_iid(struct ctl_port *po
free(msg, M_CTL);
 }
 
+void
+ctl_isc_announce_mode(struct ctl_lun *lun, uint32_t initidx,
+uint8_t page, uint8_t subpage)
+{
+   struct ctl_softc *softc = lun->ctl_softc;
+   union ctl_ha_msg msg;
+   int i;
+
+   if (softc->ha_link != CTL_HA_LINK_ONLINE)
+   return;
+   for (i = 0; i < CTL_NUM_MODE_PAGES; i++) {
+   if ((lun->mode_pages.index[i].page_code & SMPH_PC_MASK) ==
+   page && lun->mode_pages.index[i].subpage == subpage)
+   break;
+   }
+   if (i == CTL_NUM_MODE_PAGES)
+   return;
+   bzero(, sizeof(msg.mode));
+   msg.hdr.msg_type = CTL_MSG_MODE_SYNC;
+   msg.hdr.nexus.targ_port = initidx / CTL_MAX_INIT_PER_PORT;
+   msg.hdr.nexus.initid = initidx % CTL_MAX_INIT_PER_PORT;
+   msg.hdr.nexus.targ_lun = lun->lun;
+   msg.hdr.nexus.targ_mapped_lun = lun->lun;
+   msg.mode.page_code = page;
+   msg.mode.subpage = subpage;
+   msg.mode.page_len = lun->mode_pages.index[i].page_len;
+   memcpy(msg.mode.data, lun->mode_pages.index[i].page_data,
+   msg.mode.page_len);
+   ctl_ha_msg_send(CTL_HA_CHAN_CTL, , sizeof(msg.mode),
+   M_WAITOK);
+}
+
 static void
 ctl_isc_ha_link_up(struct ctl_softc *softc)
 {
@@ -1041,6 +1081,44 @@ ctl_isc_login(struct ctl_softc *softc, u
}
 }
 
+static void
+ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_ha_msg *msg, int len)
+{
+   struct ctl_lun *lun;
+   int i;
+   uint32_t initidx, targ_lun;
+
+   targ_lun = msg->hdr.nexus.targ_mapped_lun;
+   mtx_lock(>ctl_lock);
+   if ((targ_lun >= CTL_MAX_LUNS) ||
+   ((lun = softc->ctl_luns[targ_lun]) == NULL)) {
+   mtx_unlock(>ctl_lock);
+   return;
+   }
+   mtx_lock(>lun_lock);
+   mtx_unlock(>ctl_lock);
+   if (lun->flags & CTL_LUN_DISABLED) {
+   mtx_unlock(>lun_lock);
+   return;
+   }
+   for (i = 0; i < CTL_NUM_MODE_PAGES; i++) {
+   if ((lun->mode_pages.index[i].page_code & SMPH_PC_MASK) ==
+   msg->mode.page_code &&
+   lun->mode_pages.index[i].subpage == msg->mode.subpage)
+   break;
+   }
+   if (i == CTL_NUM_MODE_PAGES) {
+   mtx_unlock(>lun_lock);
+   return;
+   }
+   memcpy(lun->mode_pages.index[i].page_data, msg->mode.data,
+   lun->mode_pages.index[i].page_len);
+   initidx = ctl_get_initindex(>hdr.nexus);
+   if (initidx != -1)
+   ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE);
+   mtx_unlock(>lun_lock);
+}
+
 /*
  * ISC (Inter Shelf Communication) event handler.  Events from the HA
  * subsystem come in here.
@@ -1320,6 +1398,9 @@ ctl_isc_event_handler(ctl_ha_channel cha
case CTL_MSG_LOGIN:
ctl_isc_login(softc, msg, param);
break;
+   case CTL_MSG_MODE_SYNC:
+   ctl_isc_mode_sync(softc, msg, param);
+   break;
default:
printf("Received HA message of unknown type %d\n",
msg->hdr.msg_type);
@@ -5952,7 +6033,11 @@ ctl_control_page_handler(struct ctl_scsi
if (set_ua != 0)
ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE);
mtx_unlock(>lun_lock);
-
+   if (set_ua) {
+   ctl_isc_announce_mode(lun,
+   ctl_get_initindex(>io_hdr.nexus),
+   page_index->page_code, page_index->subpage);
+   }
return (0);
 }
 
@@ -5989,7 +6074,11 @@ ctl_caching_sp_handler(struct ctl_scsiio
 

Re: svn commit: r286995 - head/share/mk

2015-09-23 Thread Baptiste Daroussin
On Tue, Sep 22, 2015 at 10:07:33PM -0700, Bryan Drewery wrote:
> On 8/21/15 8:15 AM, Warner Losh wrote:
> > Author: imp
> > Date: Fri Aug 21 15:15:22 2015
> > New Revision: 286995
> > URL: https://svnweb.freebsd.org/changeset/base/286995
> > 
> > Log:
> >   Document bsd.progs.mk, including its status as being strongly
> >   discouraged and that it will be going away as soon as is practicable.
> > 
> > Modified:
> >   head/share/mk/bsd.README
> 
> I find this functionality irreplaceable for simplicity. The alternative
> is more Makefiles for simple extra progs. Granted it has meta mode
> dirdeps issues but I think that is acceptable as there are other ways to
> address that.
> 
> Where is this deprecation coming from? Is it just due to bapt's
> in-progress (but not working) patch at https://reviews.freebsd.org/D3444
> to remove bsd.progs.mk in place of PROGS in bsd.prog.mk?
> 
> I would like to document PROGS properly. I had no idea how it worked
> until reading over it tonight. If the plan wasn't to remove PROGS itself
> I will do so.
> 
This is the exact opposite.

the review comes from the fact that bsd.progs.mk is broken.and has not be fixed
for a while. The brokenness comes from the fact it is including magically
bsd.prog.mk multiple times, the easiy to see brokenness is the fact that
everything defining FILES/SCRIPTS and other magic macros that bsd.prog.mk accept
via it multiple inputs will be reinstalled multiple times, one can fix those by
exhaustively adding overwrites of every single macros, but hat would be really
tedious each time one of the thing included in bsd.prog.mk get modified or added

You can easily see that for all the bsd.tests.mk.

While I do really like the fonctionnality it is very complicticated to get it
working.

My work in progress version is eaily fixable by adding:
https://lists.freebsd.org/pipermail/freebsd-arch/2003-June/000906.html

And extending the above for LDFLAGS and CXXFLAGS.

Which had been rejected in the past multiple times :(

The subject came back again
https://lists.freebsd.org/pipermail/freebsd-arch/2010-September/010613.html

I think D3444 would be a good excuse to bring back the idea of perfiles specific
FLAGS. But I didn't want to wake up dead subject noone agreed on.

Best regards,
Bapt


signature.asc
Description: PGP signature


Re: svn commit: r288122 - in head/sys: kern vm

2015-09-23 Thread Scott Long via svn-src-head
It should be noted that Netflix has been running with an earlier version of 
this patch for nearly 10 months.

Scott

> On Sep 22, 2015, at 11:16 AM, Alan Cox  wrote:
> 
> Author: alc
> Date: Tue Sep 22 18:16:52 2015
> New Revision: 288122
> URL: https://svnweb.freebsd.org/changeset/base/288122
> 
> Log:
>  Change vm_page_unwire() such that it (1) accepts PQ_NONE as the specified
>  queue and (2) returns a Boolean indicating whether the page's wire count
>  transitioned to zero.
> 
>  Exploit this change in vfs_vmio_release() to avoid pointlessly enqueueing
>  a page that is about to be freed.
> 
>  (An earlier version of this change was developed by attilio@ and kmacy@.
>  Any errors in this version are my own.)
> 
>  Reviewed by: kib
>  Sponsored by:EMC / Isilon Storage Division
> 
> Modified:
>  head/sys/kern/vfs_bio.c
>  head/sys/vm/vm_page.c
>  head/sys/vm/vm_page.h
> 
> Modified: head/sys/kern/vfs_bio.c
> ==
> --- head/sys/kern/vfs_bio.c   Tue Sep 22 17:34:51 2015(r288121)
> +++ head/sys/kern/vfs_bio.c   Tue Sep 22 18:16:52 2015(r288122)
> @@ -2076,6 +2076,7 @@ vfs_vmio_release(struct buf *bp)
>   vm_object_t obj;
>   vm_page_t m;
>   int i;
> + bool freed;
> 
>   if (buf_mapped(bp)) {
>   BUF_CHECK_MAPPED(bp);
> @@ -2088,23 +2089,28 @@ vfs_vmio_release(struct buf *bp)
>   for (i = 0; i < bp->b_npages; i++) {
>   m = bp->b_pages[i];
>   bp->b_pages[i] = NULL;
> - /*
> -  * In order to keep page LRU ordering consistent, put
> -  * everything on the inactive queue.
> -  */
>   vm_page_lock(m);
> - vm_page_unwire(m, PQ_INACTIVE);
> -
> - /*
> -  * Might as well free the page if we can and it has
> -  * no valid data.  We also free the page if the
> -  * buffer was used for direct I/O
> -  */
> - if ((bp->b_flags & B_ASYNC) == 0 && !m->valid) {
> - if (m->wire_count == 0 && !vm_page_busied(m))
> - vm_page_free(m);
> - } else if (bp->b_flags & B_DIRECT)
> - vm_page_try_to_free(m);
> + if (vm_page_unwire(m, PQ_NONE)) {
> + /*
> +  * Determine if the page should be freed before adding
> +  * it to the inactive queue.
> +  */
> + if ((bp->b_flags & B_ASYNC) == 0 && m->valid == 0) {
> + freed = !vm_page_busied(m);
> + if (freed)
> + vm_page_free(m);
> + } else if ((bp->b_flags & B_DIRECT) != 0)
> + freed = vm_page_try_to_free(m);
> + else
> + freed = false;
> + if (!freed) {
> + /*
> +  * In order to maintain LRU page ordering, put
> +  * the page at the tail of the inactive queue.
> +  */
> + vm_page_deactivate(m);
> + }
> + }
>   vm_page_unlock(m);
>   }
>   if (obj != NULL)
> 
> Modified: head/sys/vm/vm_page.c
> ==
> --- head/sys/vm/vm_page.c Tue Sep 22 17:34:51 2015(r288121)
> +++ head/sys/vm/vm_page.c Tue Sep 22 18:16:52 2015(r288122)
> @@ -2476,42 +2476,46 @@ vm_page_wire(vm_page_t m)
> /*
>  * vm_page_unwire:
>  *
> - * Release one wiring of the specified page, potentially enabling it to be
> - * paged again.  If paging is enabled, then the value of the parameter
> - * "queue" determines the queue to which the page is added.
> - *
> - * However, unless the page belongs to an object, it is not enqueued because
> - * it cannot be paged out.
> + * Release one wiring of the specified page, potentially allowing it to be
> + * paged out.  Returns TRUE if the number of wirings transitions to zero and
> + * FALSE otherwise.
> + *
> + * Only managed pages belonging to an object can be paged out.  If the number
> + * of wirings transitions to zero and the page is eligible for page out, then
> + * the page is added to the specified paging queue (unless PQ_NONE is
> + * specified).
>  *
>  * If a page is fictitious, then its wire count must always be one.
>  *
>  * A managed page must be locked.
>  */
> -void
> +boolean_t
> vm_page_unwire(vm_page_t m, uint8_t queue)
> {
> 
> - KASSERT(queue < PQ_COUNT,
> + KASSERT(queue < PQ_COUNT || queue == PQ_NONE,
>   ("vm_page_unwire: invalid queue %u request for page %p",
>   queue, m));
>   if ((m->oflags & VPO_UNMANAGED) == 0)
> - 

svn commit: r288144 - head/sys/kern

2015-09-23 Thread Jeff Roberson
Author: jeff
Date: Wed Sep 23 07:44:07 2015
New Revision: 288144
URL: https://svnweb.freebsd.org/changeset/base/288144

Log:
   - Fix a nonsense reordering that somehow slipped into my last diff.
  
  Reported by:  pho

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Sep 23 05:39:20 2015(r288143)
+++ head/sys/kern/vfs_bio.c Wed Sep 23 07:44:07 2015(r288144)
@@ -2090,6 +2090,8 @@ vfs_vmio_invalidate(struct buf *bp)
if (m == bogus_page)
panic("vfs_vmio_invalidate: Unexpected bogus page.");
 
+   presid = resid > (PAGE_SIZE - poffset) ?
+   (PAGE_SIZE - poffset) : resid;
KASSERT(presid >= 0, ("brelse: extra page"));
while (vm_page_xbusied(m)) {
vm_page_lock(m);
@@ -2097,8 +2099,6 @@ vfs_vmio_invalidate(struct buf *bp)
vm_page_busy_sleep(m, "mbncsh");
VM_OBJECT_WLOCK(obj);
}
-   presid = resid > (PAGE_SIZE - poffset) ?
-   (PAGE_SIZE - poffset) : resid;
if (pmap_page_wired_mappings(m) == 0)
vm_page_set_invalid(m, poffset, presid);
resid -= presid;
___
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: r286995 - head/share/mk

2015-09-23 Thread Garrett Cooper

> On Sep 22, 2015, at 23:25, Baptiste Daroussin  wrote:
> 
>> On Tue, Sep 22, 2015 at 10:07:33PM -0700, Bryan Drewery wrote:
>>> On 8/21/15 8:15 AM, Warner Losh wrote:
>>> Author: imp
>>> Date: Fri Aug 21 15:15:22 2015
>>> New Revision: 286995
>>> URL: https://svnweb.freebsd.org/changeset/base/286995
>>> 
>>> Log:
>>>  Document bsd.progs.mk, including its status as being strongly
>>>  discouraged and that it will be going away as soon as is practicable.
>>> 
>>> Modified:
>>>  head/share/mk/bsd.README
>> 
>> I find this functionality irreplaceable for simplicity. The alternative
>> is more Makefiles for simple extra progs. Granted it has meta mode
>> dirdeps issues but I think that is acceptable as there are other ways to
>> address that.
>> 
>> Where is this deprecation coming from? Is it just due to bapt's
>> in-progress (but not working) patch at https://reviews.freebsd.org/D3444
>> to remove bsd.progs.mk in place of PROGS in bsd.prog.mk?
>> 
>> I would like to document PROGS properly. I had no idea how it worked
>> until reading over it tonight. If the plan wasn't to remove PROGS itself
>> I will do so.
> This is the exact opposite.
> 
> the review comes from the fact that bsd.progs.mk is broken.and has not be 
> fixed
> for a while. The brokenness comes from the fact it is including magically
> bsd.prog.mk multiple times, the easiy to see brokenness is the fact that
> everything defining FILES/SCRIPTS and other magic macros that bsd.prog.mk 
> accept
> via it multiple inputs will be reinstalled multiple times, one can fix those 
> by
> exhaustively adding overwrites of every single macros, but hat would be really
> tedious each time one of the thing included in bsd.prog.mk get modified or 
> added
> 
> You can easily see that for all the bsd.tests.mk.
> 
> While I do really like the fonctionnality it is very complicticated to get it
> working.
> 
> My work in progress version is eaily fixable by adding:
> https://lists.freebsd.org/pipermail/freebsd-arch/2003-June/000906.html
> 
> And extending the above for LDFLAGS and CXXFLAGS.
> 
> Which had been rejected in the past multiple times :(
> 
> The subject came back again
> https://lists.freebsd.org/pipermail/freebsd-arch/2010-September/010613.html
> 
> I think D3444 would be a good excuse to bring back the idea of perfiles 
> specific
> FLAGS. But I didn't want to wake up dead subject noone agreed on.

I have some work in perforce that was largely tested, but the impact was "high" 
and bsd.progs.mk filled the gap, but it has a lot of gaps with bsd.prog.mk 
(it's bsd.prog.mk with some assembly required type issues and the way 
bsd.test.mk uses it is like putting a square peg in a round hole). I have other 
work in svn I've been doing to fix it, but with work/life the way it is, I have 
not incredibly motivated to follow through with it.

Whatever's done though should probably leverage the tests I wrote up in 
perforce. There were a bunch of them that are worth capturing and using as 
"requirements" for PROGS in bsd.progs.mk.
___
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: r286995 - head/share/mk

2015-09-23 Thread Bryan Drewery
On 9/23/2015 11:18 AM, Garrett Cooper wrote:
> 
>> On Sep 23, 2015, at 10:02, Bryan Drewery  wrote:
>>
>>> On 9/23/2015 9:44 AM, Warner Losh wrote:
>>>
>>>
>>> On Tue, Sep 22, 2015 at 10:07 PM, Bryan Drewery >> > wrote:
>>>
On 8/21/15 8:15 AM, Warner Losh wrote:
 Author: imp
 Date: Fri Aug 21 15:15:22 2015
 New Revision: 286995
 URL: https://svnweb.freebsd.org/changeset/base/286995

 Log:
  Document bsd.progs.mk , including its
>>>status as being strongly
  discouraged and that it will be going away as soon as is
>>>practicable.

 Modified:
  head/share/mk/bsd.README
>>>
>>>I find this functionality irreplaceable for simplicity. The alternative
>>>is more Makefiles for simple extra progs. Granted it has meta mode
>>>dirdeps issues but I think that is acceptable as there are other ways to
>>>address that.
>>>
>>>Where is this deprecation coming from? Is it just due to bapt's
>>>in-progress (but not working) patch at https://reviews.freebsd.org/D3444
>>>to remove bsd.progs.mk  in place of PROGS in
>>>bsd.prog.mk ?
>>>
>>>I would like to document PROGS properly. I had no idea how it worked
>>>until reading over it tonight. If the plan wasn't to remove PROGS itself
>>>I will do so.
>>>
>>>
>>> It doesn't work and has lots of issues. Those issues haven't been fixed.
>>> It didn't look like they would be fixed any time soon. It seemed there
>>> was a consensus to deprecate it because of those issues.
>>> bapt was part of that group, and his problems with packaging that
>>> bsd.progs.mk  creates played into this decision.
>>>
>>> If the issues are fixed, then we can change our recommendations based
>>> on the changed circumstance.
>>>
>>> Warner
>>
>> Yes I think I've addressed the issues. I'm still testing and will have
>> it committed soon. It is still fragile, but most of share/mk is.
> 
> I know you've been playing with meta mode a lot. Have you tried building with 
> non-meta mode, with MK_TESTS=yes, then run he following steps as root after a 
> successful installworld?
> 

I'm only doing this in non-meta mode right now.

> NOTE: wipe out /usr/tests before running installworld to ensure the files 
> that are present there aren't from previous runs
> 
> cd /usr/tests
> kyua test
> 

I am comparing full objtree and destdir from before/after the change,
including a 'make clean' comparison. There's no room for missing anything.

> Please add me to the CR.
> 
> Thanks,
> -NGie
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r288154 - head/usr.bin/bmake

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 21:35:58 2015
New Revision: 288154
URL: https://svnweb.freebsd.org/changeset/base/288154

Log:
  Similar to r266147, don't define PROG in the test subdirs.
  
  Magic things happen when including bsd.prog.mk in them.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.bin/bmake/Makefile.inc

Modified: head/usr.bin/bmake/Makefile.inc
==
--- head/usr.bin/bmake/Makefile.inc Wed Sep 23 21:08:52 2015
(r288153)
+++ head/usr.bin/bmake/Makefile.inc Wed Sep 23 21:35:58 2015
(r288154)
@@ -7,7 +7,9 @@
 .export SRCTOP
 .endif
 
+.if exists(${.CURDIR}/tests)
 PROG= make
+.endif
 
 .if !defined(MK_SHARED_TOOLCHAIN) || ${MK_SHARED_TOOLCHAIN} == "no"
 NO_SHARED?= YES
___
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"


svn commit: r288155 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 21:46:58 2015
New Revision: 288155
URL: https://svnweb.freebsd.org/changeset/base/288155

Log:
  META_MODE: Follow-up r287865 and define CCACHE_DIR as realpath'd.
  
  Filemon(4) will record paths as they are seen, not as fully resolved.  make(1)
  will take the .MAKE.META.IGNORE_PATHS values and resolve them.  This creates
  a discrepancy if CCACHE_DIR is a symlink.  Fix this by ensuring it is
  resolved for its actual usage.
  
  Submitted by: sjg

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Wed Sep 23 21:35:58 2015
(r288154)
+++ head/share/mk/local.meta.sys.mk Wed Sep 23 21:46:58 2015
(r288155)
@@ -193,7 +193,9 @@ UPDATE_DEPENDFILE= NO
 .MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT}
 
 .if defined(CCACHE_DIR)
+CCACHE_DIR := ${CCACHE_DIR:tA}
 .MAKE.META.IGNORE_PATHS += ${CCACHE_DIR}
+.export CCACHE_DIR
 .endif
 
 CSU_DIR.${MACHINE_ARCH} ?= csu/${MACHINE_ARCH}
___
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"


svn commit: r288156 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 22:23:59 2015
New Revision: 288156
URL: https://svnweb.freebsd.org/changeset/base/288156

Log:
  META_MODE: Avoid // in meta log for tracked --sysroot files.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Wed Sep 23 21:46:58 2015
(r288155)
+++ head/share/mk/local.meta.sys.mk Wed Sep 23 22:23:59 2015
(r288156)
@@ -165,7 +165,7 @@ STAGE_SYMLINKS_DIR= ${STAGE_OBJTOP}
 
 LDFLAGS_LAST+= -Wl,-rpath-link -Wl,${STAGE_LIBDIR}
 .if ${MK_SYSROOT} == "yes"
-SYSROOT?= ${STAGE_OBJTOP}/
+SYSROOT?= ${STAGE_OBJTOP}
 .else
 LDFLAGS_LAST+= -L${STAGE_LIBDIR}
 .endif
___
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"


svn commit: r288152 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 20:46:23 2015
New Revision: 288152
URL: https://svnweb.freebsd.org/changeset/base/288152

Log:
  META_MODE: Follow-up r287879 and have 'make -V .OBJDIR' still invoke 
auto.obj.mk.
  
  When inspecting this value it is more expected to have it show the
  automatically-created directory value rather than CURDIR.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/sys.mk

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkWed Sep 23 19:30:46 2015(r288151)
+++ head/share/mk/sys.mkWed Sep 23 20:46:23 2015(r288152)
@@ -52,8 +52,11 @@ __ENV_ONLY_OPTIONS:= \
 .endif
 .if ${MK_AUTO_OBJ} == "yes"
 # This needs to be done early - before .PATH is computed
-# Don't do this if just running 'make -V' or 'make showconfig'
-.if ${.MAKEFLAGS:M-V} == "" && !make(showconfig)
+# Don't do this if just running 'make -V' (but do when inspecting .OBJDIR) or
+# 'make showconfig' (during makeman which enables all options when meta mode
+# is not expected)
+.if (${.MAKEFLAGS:M-V} == "" || ${.MAKEFLAGS:M.OBJDIR} != "") && \
+!make(showconfig)
 .sinclude 
 .endif
 .endif
___
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"


svn commit: r288153 - head/sys/geom

2015-09-23 Thread Conrad E. Meyer
Author: cem
Date: Wed Sep 23 21:08:52 2015
New Revision: 288153
URL: https://svnweb.freebsd.org/changeset/base/288153

Log:
  geom_dev: Use kenv 'dumpdev' in the same way as rc/etc.d/dumpon
  
  Skip a /dev/ prefix, if one is present, when checking for matching
  device names for dump.
  
  Suggested by: avg
  Reviewed by:  markj
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D3725

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cWed Sep 23 20:46:23 2015(r288152)
+++ head/sys/geom/geom_dev.cWed Sep 23 21:08:52 2015(r288153)
@@ -124,6 +124,7 @@ g_dev_fini(struct g_class *mp)
 {
 
freeenv(dumpdev);
+   dumpdev = NULL;
 }
 
 static int
@@ -152,10 +153,16 @@ g_dev_setdumpdev(struct cdev *dev, struc
 static void
 init_dumpdev(struct cdev *dev)
 {
+   const char *devprefix = "/dev/", *devname;
+   size_t len;
 
if (dumpdev == NULL)
return;
-   if (strcmp(devtoname(dev), dumpdev) != 0)
+   len = strlen(devprefix);
+   devname = devtoname(dev);
+   if (strcmp(devname, dumpdev) != 0 &&
+  (strncmp(dumpdev, devprefix, len) != 0 ||
+   strcmp(devname, dumpdev + len) != 0))
return;
if (g_dev_setdumpdev(dev, curthread) == 0) {
freeenv(dumpdev);
___
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: r287934 - head/sys/boot/efi/loader

2015-09-23 Thread Warner Losh
You're right about the Wifi drivers. There's some number you'll want loaded
and we should have sensible defaults. But how to get there from here may
be a bit interesting...  Though if I go with the devd.conf writer early in
boot,
I can make them be rc.conf variable controlled.

Warner

On Wed, Sep 23, 2015 at 8:13 PM, Rui Paulo  wrote:

> Those were the issues that I encountered when I started using MINIMAL.
> I didn't do a thorough investigation.
>
> Auto loading is a much bigger problem that just loading drivers for
> PCI/USB/etc devices.  For example, net80211 doesn't auto load the wlan
> crypto modules by default nor the amrr module.
>
> On Mon, 2015-09-21 at 17:59 -0600, Warner Losh wrote:
> > Apart from the inlining issue John raised (which I agree with his
> > solution on, btw)
> > and the one cam ctl module, what other modules are meaningfully
> > different when
> > compiled as modules.
> >
> > Assume that the auto-loading bit is solved, at least for devices on
> > self-enumerating
> > busses.
> >
> > Warner
> >
> >
> > > On Sep 21, 2015, at 4:53 PM, Rui Paulo  wrote:
> > >
> > > No, that doesn't work very well.  Not only the modules don't auto
> > > -load, the way the modules are compiled is different.  See, for
> > > example, cam ctl which doesn't compile the sg code when it's built
> > > into the kernel, but compiles it when it's built as a module.  The
> > > sg code is currently buggy and causes insta-panics with GNOME 3
> > > (perhaps the auto-mounter in hald (?)).
> > > --
> > > Rui Paulo
> > >
> > >
> > > On Sep 21, 2015, at 11:24 AM, Adrian Chadd 
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > Warner has been working on the modular kernel thing. But
> > > > honestly, I
> > > > think we should just start biting that bullet and ship a modules
> > > > -only
> > > > GENERIC by default..
> > > >
> > > >
> > > > -a
> > > >
> > > >
> > > > On 21 September 2015 at 11:02, Rui Paulo  wrote:
> > > > > So, we're going to keep ignoring the problem and keep patching
> > > > > things up?
> > > > > It's a bit sad that a single driver (pmspcv) is able to cause
> > > > > so much
> > > > > problems.
> > > > >
> > > > > --
> > > > > Rui Paulo
> > > > >
> > > > >
> > > > > On Sep 17, 2015, at 01:36 PM, John Baldwin 
> > > > > wrote:
> > > > >
> > > > > Author: jhb
> > > > > Date: Thu Sep 17 20:36:46 2015
> > > > > New Revision: 287934
> > > > > URL: https://svnweb.freebsd.org/changeset/base/287934
> > > > >
> > > > >
> > > > > Log:
> > > > > The EFI boot loader allocates a single chunk of contiguous
> > > > > memory to
> > > > > hold the kernel, modules, and any other loaded data. This
> > > > > memory block
> > > > > is relocated to the kernel's expected location during the
> > > > > transfer of
> > > > > control from the loader to the kernel.
> > > > >
> > > > > The GENERIC kernel on amd64 has recently grown such that a
> > > > > kernel + zfs.ko
> > > > > no longer fits in the default staging size. Bump the default
> > > > > size from
> > > > > 32MB to 48MB to provide more breathing room.
> > > > >
> > > > > PR: 201679
> > > > > Reviewed by: imp
> > > > > MFC after: 1 week
> > > > > Differential Revision: https://reviews.freebsd.org/D3666
> > > > >
> > > > >
> > > > > Modified:
> > > > > head/sys/boot/efi/loader/copy.c
> > > > >
> > > > > Modified: head/sys/boot/efi/loader/copy.c
> > > > > ===
> > > > > ===
> > > > > --- head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:34 2015
> > > > > (r287933)
> > > > > +++ head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:46 2015
> > > > > (r287934)
> > > > > @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
> > > > > #include 
> > > > >
> > > > > #ifndef EFI_STAGING_SIZE
> > > > > -#define EFI_STAGING_SIZE 32
> > > > > +#define EFI_STAGING_SIZE 48
> > > > > #endif
> > > > >
> > > > > #define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096)
> > > > >
> >
>
> --
> Rui Paulo
>
>
___
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: r287934 - head/sys/boot/efi/loader

2015-09-23 Thread Rui Paulo
I gave you feedback: it crashed somewhere else.  I haven't had time to
work on it.
However, go ahead and commit that fix.  That code was clearly wrong.

On Mon, 2015-09-21 at 23:21 -0700, Scott Long wrote:
> As a side note, I’m still waiting for feedback on the patch I sent
> you for scsi_sg.  I’d like to get this fixed.
> 
> Scott
> 
> > On Sep 21, 2015, at 3:53 PM, Rui Paulo  wrote:
> > 
> > No, that doesn't work very well.  Not only the modules don't auto
> > -load, the way the modules are compiled is different.  See, for
> > example, cam ctl which doesn't compile the sg code when it's built
> > into the kernel, but compiles it when it's built as a module.  The
> > sg code is currently buggy and causes insta-panics with GNOME 3
> > (perhaps the auto-mounter in hald (?)).
> > --
> > Rui Paulo
> > 
> > 
> > On Sep 21, 2015, at 11:24 AM, Adrian Chadd 
> > wrote:
> > 
> > > Hi,
> > > 
> > > Warner has been working on the modular kernel thing. But
> > > honestly, I
> > > think we should just start biting that bullet and ship a modules
> > > -only
> > > GENERIC by default..
> > > 
> > > 
> > > -a
> > > 
> > > 
> > > On 21 September 2015 at 11:02, Rui Paulo  wrote:
> > > > So, we're going to keep ignoring the problem and keep patching
> > > > things up?
> > > > It's a bit sad that a single driver (pmspcv) is able to cause
> > > > so much
> > > > problems.
> > > > 
> > > > --
> > > > Rui Paulo
> > > > 
> > > > 
> > > > On Sep 17, 2015, at 01:36 PM, John Baldwin 
> > > > wrote:
> > > > 
> > > > Author: jhb
> > > > Date: Thu Sep 17 20:36:46 2015
> > > > New Revision: 287934
> > > > URL: https://svnweb.freebsd.org/changeset/base/287934
> > > >  
> > > > 
> > > > Log:
> > > > The EFI boot loader allocates a single chunk of contiguous
> > > > memory to
> > > > hold the kernel, modules, and any other loaded data. This
> > > > memory block
> > > > is relocated to the kernel's expected location during the
> > > > transfer of
> > > > control from the loader to the kernel.
> > > > 
> > > > The GENERIC kernel on amd64 has recently grown such that a
> > > > kernel + zfs.ko
> > > > no longer fits in the default staging size. Bump the default
> > > > size from
> > > > 32MB to 48MB to provide more breathing room.
> > > > 
> > > > PR: 201679
> > > > Reviewed by: imp
> > > > MFC after: 1 week
> > > > Differential Revision: https://reviews.freebsd.org/D3666
> > > >  
> > > > 
> > > > Modified:
> > > > head/sys/boot/efi/loader/copy.c
> > > > 
> > > > Modified: head/sys/boot/efi/loader/copy.c
> > > > ===
> > > > ===
> > > > --- head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:34 2015
> > > > (r287933)
> > > > +++ head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:46 2015
> > > > (r287934)
> > > > @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
> > > > #include 
> > > > 
> > > > #ifndef EFI_STAGING_SIZE
> > > > -#define EFI_STAGING_SIZE 32
> > > > +#define EFI_STAGING_SIZE 48
> > > > #endif
> > > > 
> > > > #define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096)
> > > > 
> 

-- 
Rui Paulo

___
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: r287934 - head/sys/boot/efi/loader

2015-09-23 Thread Rui Paulo
Those were the issues that I encountered when I started using MINIMAL.
I didn't do a thorough investigation.

Auto loading is a much bigger problem that just loading drivers for
PCI/USB/etc devices.  For example, net80211 doesn't auto load the wlan
crypto modules by default nor the amrr module.

On Mon, 2015-09-21 at 17:59 -0600, Warner Losh wrote:
> Apart from the inlining issue John raised (which I agree with his
> solution on, btw)
> and the one cam ctl module, what other modules are meaningfully
> different when
> compiled as modules.
> 
> Assume that the auto-loading bit is solved, at least for devices on
> self-enumerating
> busses.
> 
> Warner
> 
> 
> > On Sep 21, 2015, at 4:53 PM, Rui Paulo  wrote:
> > 
> > No, that doesn't work very well.  Not only the modules don't auto
> > -load, the way the modules are compiled is different.  See, for
> > example, cam ctl which doesn't compile the sg code when it's built
> > into the kernel, but compiles it when it's built as a module.  The
> > sg code is currently buggy and causes insta-panics with GNOME 3
> > (perhaps the auto-mounter in hald (?)).
> > --
> > Rui Paulo
> > 
> > 
> > On Sep 21, 2015, at 11:24 AM, Adrian Chadd 
> > wrote:
> > 
> > > Hi,
> > > 
> > > Warner has been working on the modular kernel thing. But
> > > honestly, I
> > > think we should just start biting that bullet and ship a modules
> > > -only
> > > GENERIC by default..
> > > 
> > > 
> > > -a
> > > 
> > > 
> > > On 21 September 2015 at 11:02, Rui Paulo  wrote:
> > > > So, we're going to keep ignoring the problem and keep patching
> > > > things up?
> > > > It's a bit sad that a single driver (pmspcv) is able to cause
> > > > so much
> > > > problems.
> > > > 
> > > > --
> > > > Rui Paulo
> > > > 
> > > > 
> > > > On Sep 17, 2015, at 01:36 PM, John Baldwin 
> > > > wrote:
> > > > 
> > > > Author: jhb
> > > > Date: Thu Sep 17 20:36:46 2015
> > > > New Revision: 287934
> > > > URL: https://svnweb.freebsd.org/changeset/base/287934
> > > > 
> > > > 
> > > > Log:
> > > > The EFI boot loader allocates a single chunk of contiguous
> > > > memory to
> > > > hold the kernel, modules, and any other loaded data. This
> > > > memory block
> > > > is relocated to the kernel's expected location during the
> > > > transfer of
> > > > control from the loader to the kernel.
> > > > 
> > > > The GENERIC kernel on amd64 has recently grown such that a
> > > > kernel + zfs.ko
> > > > no longer fits in the default staging size. Bump the default
> > > > size from
> > > > 32MB to 48MB to provide more breathing room.
> > > > 
> > > > PR: 201679
> > > > Reviewed by: imp
> > > > MFC after: 1 week
> > > > Differential Revision: https://reviews.freebsd.org/D3666
> > > > 
> > > > 
> > > > Modified:
> > > > head/sys/boot/efi/loader/copy.c
> > > > 
> > > > Modified: head/sys/boot/efi/loader/copy.c
> > > > ===
> > > > ===
> > > > --- head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:34 2015
> > > > (r287933)
> > > > +++ head/sys/boot/efi/loader/copy.c Thu Sep 17 20:36:46 2015
> > > > (r287934)
> > > > @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
> > > > #include 
> > > > 
> > > > #ifndef EFI_STAGING_SIZE
> > > > -#define EFI_STAGING_SIZE 32
> > > > +#define EFI_STAGING_SIZE 48
> > > > #endif
> > > > 
> > > > #define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096)
> > > > 
> 

-- 
Rui Paulo

___
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"


svn commit: r288159 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 23:30:57 2015
New Revision: 288159
URL: https://svnweb.freebsd.org/changeset/base/288159

Log:
  RELDIR is useful without META_MODE.  Always define it.
  
  It is the CURDIR without the SRC base location in it.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.meta.sys.mk
  head/share/mk/src.sys.env.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Wed Sep 23 23:20:49 2015
(r288158)
+++ head/share/mk/local.meta.sys.mk Wed Sep 23 23:30:57 2015
(r288159)
@@ -112,12 +112,6 @@ OBJTOP:= ${OBJROOT}${TARGET_OBJ_SPEC}
 .endif
 .endif
 
-.if ${.CURDIR} == ${SRCTOP}
-RELDIR = .
-.elif ${.CURDIR:M${SRCTOP}/*}
-RELDIR := ${.CURDIR:S,${SRCTOP}/,,}
-.endif
-
 HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET}
 
 .if ${OBJTOP} == ${HOST_OBJTOP} || ${REQUESTED_MACHINE:U${MACHINE}} == "host"

Modified: head/share/mk/src.sys.env.mk
==
--- head/share/mk/src.sys.env.mkWed Sep 23 23:20:49 2015
(r288158)
+++ head/share/mk/src.sys.env.mkWed Sep 23 23:30:57 2015
(r288159)
@@ -5,6 +5,12 @@
 # make sure this is defined in a consistent manner
 SRCTOP:= ${.PARSEDIR:tA:H:H}
 
+.if ${.CURDIR} == ${SRCTOP}
+RELDIR = .
+.elif ${.CURDIR:M${SRCTOP}/*}
+RELDIR := ${.CURDIR:S,${SRCTOP}/,,}
+.endif
+
 # site customizations that do not depend on anything!
 SRC_ENV_CONF?= /etc/src-env.conf
 .if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
___
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"


svn commit: r288160 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 24 00:17:00 2015
New Revision: 288160
URL: https://svnweb.freebsd.org/changeset/base/288160

Log:
  Document bsd.progs.mk and add more variables overrides.
  
  BINGRP BINMODE BINOWN LINKS MLINKS PROGNAME.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.README
  head/share/mk/bsd.progs.mk

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEWed Sep 23 23:30:57 2015(r288159)
+++ head/share/mk/bsd.READMEThu Sep 24 00:17:00 2015(r288160)
@@ -292,6 +292,20 @@ PROG_CXX   If defined, the name of the pro
standard C++ library.  PROG_CXX overrides the value
of PROG if PROG is also set.
 
+PROGS  When used with , allow building multiple
+PROGS_CXX  PROG and PROGS_CXX in one Makefile.  To define
+   individual variables for each program the VAR.prog
+   syntax should be used.  For example:
+
+   PROGS=  foo bar
+   SRCS.foo=   foo_src.c
+   LIBADD.foo= util
+   SRCS.bar=   bar_src.c
+
+   The supported variables are BINDIR BINGRP BINMODE BINOWN
+   CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS DPSRCS LDADD
+   LDFLAGS LIBADD MAN MLINKS PROGNAME SRCS.
+
 PROGNAME   The name that the above program will be installed as, if
different from ${PROG}.
 

Modified: head/share/mk/bsd.progs.mk
==
--- head/share/mk/bsd.progs.mk  Wed Sep 23 23:30:57 2015(r288159)
+++ head/share/mk/bsd.progs.mk  Thu Sep 24 00:17:00 2015(r288160)
@@ -38,8 +38,10 @@ PROG ?= $t
 
 .if defined(PROG)
 # just one of many
-PROG_OVERRIDE_VARS += BINDIR DPSRCS MAN SRCS
-PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LDFLAGS 
${PROG_OVERRIDE_VARS}
+PROG_OVERRIDE_VARS +=  BINDIR BINGRP BINOWN BINMODE DPSRCS MAN PROGNAME \
+   SRCS
+PROG_VARS +=   CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LINKS \
+   LDFLAGS MLINKS ${PROG_OVERRIDE_VARS}
 .for v in ${PROG_VARS:O:u}
 .if empty(${PROG_OVERRIDE_VARS:M$v})
 .if defined(${v}.${PROG})
___
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"


svn commit: r288157 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 22:36:01 2015
New Revision: 288157
URL: https://svnweb.freebsd.org/changeset/base/288157

Log:
  META_MODE: Fix 2nd build causing everything to rebuild due to changed CC.
  
  In the first build the TOOLSDIR does not exit yet which causes CC to default
  to the sys.mk version.  Once a TOOLSDIR is created during the build though,
  this logic was changing CC to ${TOOLSDIR}/usr/bin/cc even though that file
  did not exist.  Thus CC went from 'cc' to '/usr/bin/cc' which forced a
  rebuild of everything while using the same compiler.  Check that TOOLSDIR is
  not empty to avoid this.  If there is actually a TOOLSDIR cc then it will be
  used and properly rebuild.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Wed Sep 23 22:23:59 2015
(r288156)
+++ head/share/mk/local.meta.sys.mk Wed Sep 23 22:36:01 2015
(r288157)
@@ -214,6 +214,7 @@ TOOLSDIR?= ${HOST_OBJTOP}/tools
 .elif defined(STAGE_HOST_OBJTOP) && exists(${STAGE_HOST_OBJTOP}/usr/bin)
 TOOLSDIR?= ${STAGE_HOST_OBJTOP}
 .endif
+.if !empty(TOOLSDIR)
 .if ${.MAKE.LEVEL} == 0 && exists(${TOOLSDIR}/usr/bin)
 PATH:= ${PATH:S,:, ,g:@d@${exists(${TOOLSDIR}$d):?${TOOLSDIR}$d:}@:ts:}:${PATH}
 .export PATH
@@ -224,6 +225,7 @@ CXX?= ${TOOLSDIR}/usr/bin/c++
 .export HOST_CC CC CXX
 .endif
 .endif
+.endif
 
 .if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE}
 # cross-building
___
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"


svn commit: r288158 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 23 23:20:49 2015
New Revision: 288158
URL: https://svnweb.freebsd.org/changeset/base/288158

Log:
  Fix most cases of bsd.progs.mk running duplicate or missing commands.
  
  This mostly fixes an interaction with bsd.test.mk with PROGS and SCRIPTS.
  This was most notable with 'make clean' and 'make install', which r281055
  and r272055 attempted to address but were inadequate.
  
  It also addresses similar issues in bsd.progs.mk when not using bsd.test.mk.
  
  This also fixes cases of NOT running commands in the parent when using
  bsd.progs.mk:
- 'make clean' was not run for the main process for Makefiles which had both
  FILES and SUBDIR but no PROGS or SCRIPTS.  This usually was just a
  leftover Kyuafile.auto.  One such example is 
usr.bin/bmake/tests/sysmk/t1/2.
- 'make obj' was not running in the current directory with bsd.test.mk due
  to early inclusion of bsd.subdir.mk.  This was not really a problem due to
  the SUBDIRS using 'mkdir -p' for their objdirs.
  
  There were subtle bugs causing this wrong behavior:
1. bsd.progs.mk needs to set SCRIPTS to empty when recursing to avoid
   the sub-makes from installing, cleaning or building the SCRIPTS;
   only the parent make should be doing this.  r281055 effectively did
   the same but wasn't enough.
2. CLEANFILES may contain (especially from *.test.mk) files which only
   the parent should clean, such as from FILES and SCRIPTS.  To resolve
   sub-makes also cleaning these, reset CLEANFILES and CLEANDIRS in the
   children before including bsd.prog.mk.  A tempting alternative would be
   to only handle CLEANFILES in the parent but then the child bsd.prog.mk
   CLEANFILES of per-PROGS wouldn't be setup.
3. bsd.subdir.mk was included too soon in bsd.test.mk.  It needs to be
   included after bsd.prog.mk as the SCRIPTS logic is short-circuitted if
   'install:' is already defined (which bsd.subdir.mk does).  There is
   actually no need to include bsd.subdir.mk from bsd.test.mk as bsd.prog.mk
   and bsd.obj.mk will do so in the proper order.  The description in 
r257095
   covers this for FILES and was fixed differently, though changing the
   handling of target(install) in bsd.prog.mk may make sense after more
   research.
4. bsd.progs.mk had extra logic to handle recursing SCRIPTS if PROGS was
   empty, which isn't its business to be doing.  SCRIPTS is handled fine
   by bsd.prog.mk.  This mostly reverts and reworks the fix in r259209 and
   partially reverts r272055.
5. bsd.progs.mk has no need to depend 'all:' on SCRIPTS and FILES.  These
   are handled by bsd.prog.mk/bsd.files.mk fine.  This also partially 
reverts
   r272055.
6. bsd.progs.mk was not drop-in safe for bsd.prog.mk.  Move the PROGS
   check from r273186 to allow it to be used safely.
  
  Specific tested cases:
SCRIPTS:no PROGS:no FILES:yes SUBDIR:yes
  usr.bin/bmake/tests/sysmk/t1/2
  
SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
  usr.bin/bmake/tests/sysmk/t1/2/1
  
SCRIPTS:yes PROGS:yes FILES:yes SUBDIR:yes
  lib/libthr/tests
  
SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
  usr.bin/yacc/tests
  libexec/atf/atf-sh/tests
  
  A full buildworld/installworld/clean comparison with mtree was also done.
  The only relevant difference was the new fixed behavior of removing
  Kyuafile.auto from the objdir in 'clean'.
  
  Converting SCRIPTS to be a special case FILES group will make this less
  fragile and is being explored.
  
  One known remaining issue is 'cleandepend' removing the tags files for
  every recursive call.
  
  Note that the 'make clean' command runs for the CURDIR last, which can make
  it appear to run multiple times when cleaning in tests/, but each command is
  for a SUBDIR returning up the chain.  This is purely bsd.subdir.mk behavior.
  
  PR:   191055
  PR:   191955
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.prog.mk
  head/share/mk/bsd.progs.mk
  head/share/mk/bsd.test.mk

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Wed Sep 23 22:36:01 2015(r288157)
+++ head/share/mk/bsd.prog.mk   Wed Sep 23 23:20:49 2015(r288158)
@@ -258,7 +258,7 @@ realinstall: _maninstall
 .ORDER: beforeinstall _maninstall
 .endif
 
-.endif
+.endif # !target(install)
 
 .if !target(lint)
 lint: ${SRCS:M*.c}

Modified: head/share/mk/bsd.progs.mk
==
--- head/share/mk/bsd.progs.mk  Wed Sep 23 22:36:01 2015(r288157)
+++ head/share/mk/bsd.progs.mk  Wed Sep 23 23:20:49 2015(r288158)
@@ -60,25 +60,27 @@ UPDATE_DEPENDFILE ?= NO
 
 # prog.mk will do the rest
 .else
-all: ${FILES} ${PROGS} ${SCRIPTS}
+all: ${PROGS}
 
 # We cannot 

svn commit: r288162 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 24 00:22:48 2015
New Revision: 288162
URL: https://svnweb.freebsd.org/changeset/base/288162

Log:
  Note that LIBADD is only valid in /usr/src.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEThu Sep 24 00:20:34 2015(r288161)
+++ head/share/mk/bsd.READMEThu Sep 24 00:22:48 2015(r288162)
@@ -270,7 +270,8 @@ LDADD   Additional loader objects.  Usual
 
LDADD=-lutil -lcompat
 
-LIBADD Additional libraries.  This is for base system libraries.
+LIBADD Additional libraries.  This is for base system libraries
+   and is only valid inside of the /usr/src tree.
Rather than use LDADD=-lname use LIBADD=name.
 
 LDFLAGSAdditional loader flags. Passed to the loader via CC,
@@ -302,7 +303,7 @@ PROGS_CXX   PROG and PROGS_CXX in one Make
 
PROGS=  foo bar
SRCS.foo=   foo_src.c
-   LIBADD.foo= util
+   LDADD.foo=  -lutil
SRCS.bar=   bar_src.c
 
The supported variables are BINDIR BINGRP BINMODE BINOWN
@@ -411,7 +412,8 @@ LIBMODE Library mode.
 
 LDADD  Additional loader objects.
 
-LIBADD Additional libraries.  This is for base system libraries.
+LIBADD Additional libraries.  This is for base system libraries
+   and is only valid inside of the /usr/src tree.
Rather than use LDADD=-lname use LIBADD=name.
 
 MANThe manual pages to be installed (use a .1 - .9 suffix).
___
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"


svn commit: r288161 - head/share/mk

2015-09-23 Thread Bryan Drewery
Author: bdrewery
Date: Thu Sep 24 00:20:34 2015
New Revision: 288161
URL: https://svnweb.freebsd.org/changeset/base/288161

Log:
  Add very basic LIBADD documentation.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEThu Sep 24 00:17:00 2015(r288160)
+++ head/share/mk/bsd.READMEThu Sep 24 00:20:34 2015(r288161)
@@ -270,6 +270,9 @@ LDADD   Additional loader objects.  Usual
 
LDADD=-lutil -lcompat
 
+LIBADD Additional libraries.  This is for base system libraries.
+   Rather than use LDADD=-lname use LIBADD=name.
+
 LDFLAGSAdditional loader flags. Passed to the loader via CC,
since that's used to link programs as well, so loader
specific flags need to be prefixed with -Wl, to work.
@@ -408,6 +411,9 @@ LIBMODE Library mode.
 
 LDADD  Additional loader objects.
 
+LIBADD Additional libraries.  This is for base system libraries.
+   Rather than use LDADD=-lname use LIBADD=name.
+
 MANThe manual pages to be installed (use a .1 - .9 suffix).
 
 SRCS   List of source files to build the library.  Suffix types
___
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"