From owner-freebsd-arch@freebsd.org Sun Oct 2 00:24:33 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7833A9D95F for ; Sun, 2 Oct 2016 00:24:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::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 7EAB21F9F; Sun, 2 Oct 2016 00:24:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x244.google.com with SMTP id 184so4314180ity.0; Sat, 01 Oct 2016 17:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=G0wBPBSeDGTNHH4HTbxRdd2QKTZqdR2MRRlQYjfJzd4=; b=TkEmZ5YlACmUjo96FjCRU0pL2bpNOW1aUHMqLyrkNnlENeC8B/2Hp6VEIutKcnHZcY T9pRYF4vhI1uJZ1dC3FtcmWYmoWiwbHKCwWn6GUQ2/sFexlSOnwbiVu35bsDjkveOVM/ NjvAn88VyAxAsQYgMZkXjRVYZ3crs8X7sRnRwgB0iHptQavevYfnrgTfz4Al1UITSt9Z WS5c/Yj6iO+nph9oH6J6HiMABUtVvORf732scYhj4t+xKRJVPObFwOvfsFouOqX8EGWb dQvflmVGugn+0skRT5AhiuzkXe+jyQisl3LNU8TkTMIV+Kfrw/9siHNOfdWdDT3PZL85 PZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=G0wBPBSeDGTNHH4HTbxRdd2QKTZqdR2MRRlQYjfJzd4=; b=NVv/z77QQDSo7/eM+6L0m0xM49XmGu7qo7kkCVdSnbCTCbWsQ58alkzJEka/oHwluQ OlE1GO5xmOajMQBfzUjH5+MILGuGhm7MSYhK0ZyCfOZpHvurGU6rFOaNbKXjXtJ68K1P 7rD/h0jWDULWY+iz094x+/ehRCvPAiQ6nT3d2AUeXyZf0u87hctOHAaRaghvHIape2z1 02ZGSFaqrHdn1X4Q14mAoooqg1vS8+kwGIRLsN6YglZO75MCNS3IUZHkNxVIjYJqgC35 wzyUcatKh293YDJNgMxtoGcicYy6E7QCWxc3V7GrJXZcbunwIOKpwpHF6U5BNclJYSnN UTeg== X-Gm-Message-State: AA6/9RmB5bHRf90+CXRmhWvKM7OaJasjlXxcSsHiFBRvarmBBOYZ08RcFNZQrnHuExFvHw== X-Received: by 10.36.9.67 with SMTP id 64mr11145103itm.96.1475367873049; Sat, 01 Oct 2016 17:24:33 -0700 (PDT) Received: from [22.66.114.211] ([172.56.13.206]) by smtp.gmail.com with ESMTPSA id e79sm10523398iod.4.2016.10.01.17.24.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 01 Oct 2016 17:24:32 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Ngie Cooper Mime-Version: 1.0 (1.0) Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Date: Sun, 2 Oct 2016 09:23:43 +0900 Message-Id: <675F9A5B-BC2D-4F02-A160-74924327CC7B@gmail.com> References: <8A6CD0D3-C4D5-40DF-B2AD-4C454CC88AD1@perftech.com> <20160930094544.GP38409@kib.kiev.ua> <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> Cc: Alexander Kabaev , Lewis Donzis , deischen@freebsd.org, freebsd-arch@freebsd.org In-Reply-To: <20161001092515.GW38409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: iPhone Mail (13G36) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 00:24:33 -0000 > On Oct 1, 2016, at 18:25, Konstantin Belousov wrote: > >> On Fri, Sep 30, 2016 at 06:44:18PM -0400, Alexander Kabaev wrote: >> No objection, but possible suggestion: if the primary use of this >> symbol is for tests and nothing else, maybe it does belong in >> FBSDprivate_1.0 FBSDprivate_1.0 section instead? > > Good question. The symbols are useful for real-world code, not only for > the tests. But I think that we should mark symbol as non-portable. Usual > approach of adding _np suffix seems to be the right thing to do there. > > What about the following ? The change proposed below looks good to me, at first glance :).. Thank you for proposing/doing this! -Ngie From owner-freebsd-arch@freebsd.org Sun Oct 2 03:41:07 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D22AC4ACC for ; Sun, 2 Oct 2016 03:41:07 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::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 DA994D9E; Sun, 2 Oct 2016 03:41:06 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id z190so139291249qkc.3; Sat, 01 Oct 2016 20:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=73xZOSUuSfeQKdOTDJtBI7w496JoS/Kq1cjPbmADqm8=; b=KfjQBkhlcryNebI1pOcQ70j5Ye+68tCEvhxOQZDBu2JlyWPG4t8yKglN3Qtxm0cZtu IcebD1GKc4aGdh79OCOaapAW6ZVddhqAAGIghMNKEhoyGi93QYLoTy32NX6ldDZ3mHxx ClK/WLoBVSY5U+mkO8uObu6tPRWZOyV6lJg6ZD9j8BsdZ79atkV9EL859e/xSjreo2An WfAl58NM7y0Y4dEebFo1yCMnC0WKJOqj83Fq48OhRzCRQw+9aFYSVAsCC7FB6iv0eun8 U5ImyBrDdYTGTDg+T313PJvKsbqEDWS0LwtTbonA2EksVbUyLRpyd8zVo3Y4hn2EO1bg 8ITg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=73xZOSUuSfeQKdOTDJtBI7w496JoS/Kq1cjPbmADqm8=; b=Hw0SIsE3E/BpKykq/8lwNKl919SOpuBMyyP5JezBOFxo+lfQl+2w+K5WBDWClg+0g0 e8o3ByMq12VwwPjgYiMfcjbWMOie9f7Gvg/yhD28kZvc/f1zjjhGEO/kpV1NsPXQTSrV Zsje7YcXz2xSqolkim0lhU+Cg48kZkmag6ewFpqyijXlPiI4otUzLMELLrETgspJTRbS Eo1LsgkPbefk2RJJMpLjt+jk/FYX+xKq3IMz7Fpuqloo2yKTBLiy9uM+rpoBitbSg7Ps OuizWTjXV0zoqMj2p9PgWVeGNeokMw3I8BGWzPwo2zXcmz65YMGAzusR5S2iybfUQLn0 8QLA== X-Gm-Message-State: AA6/9Rk6Occm8PcMWyrgQnrOxc73EVSwVqFQ40W89LCDgw5M+uj/s8iqFggypnQ6cojJrA== X-Received: by 10.55.19.36 with SMTP id d36mr14069268qkh.247.1475379665973; Sat, 01 Oct 2016 20:41:05 -0700 (PDT) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id i65sm14481262qtb.18.2016.10.01.20.41.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Oct 2016 20:41:04 -0700 (PDT) Date: Sat, 1 Oct 2016 23:40:59 -0400 From: Alexander Kabaev To: Konstantin Belousov Cc: Jilles Tjoelker , Lewis Donzis , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161001234059.6f51310b@kan> In-Reply-To: <20161001210722.GC38409@kib.kiev.ua> References: <8A6CD0D3-C4D5-40DF-B2AD-4C454CC88AD1@perftech.com> <20160930094544.GP38409@kib.kiev.ua> <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Dx6k8femPnHps78YWcQVe8b"; protocol="application/pgp-signature" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 03:41:07 -0000 --Sig_/Dx6k8femPnHps78YWcQVe8b Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 2 Oct 2016 00:07:22 +0300 Konstantin Belousov wrote: > On Sat, Oct 01, 2016 at 10:16:55PM +0200, Jilles Tjoelker wrote: > > The idea is good, but perhaps call the function mq_getfd_np() to > > clarify it returns a file descriptor. Also, the __ versions should > > not be exported since they are not used outside the library (they > > can be exported if and when needed). =20 >=20 >=20 > diff --git a/include/mqueue.h b/include/mqueue.h > index 788d0a1..e1c0f27 100644 > --- a/include/mqueue.h > +++ b/include/mqueue.h > @@ -50,7 +50,9 @@ ssize_t mq_timedreceive(mqd_t, char > *__restrict, size_t, int mq_timedsend(mqd_t, const char *, > size_t, unsigned, const struct timespec *); > int mq_unlink(const char *); > -int __mq_oshandle(mqd_t mqd); > +#if __BSD_VISIBLE > +int mq_getfd_np(mqd_t mqd); > +#endif /* __BSD_VISIBLE */ > =20 > __END_DECLS > #endif > diff --git a/include/time.h b/include/time.h > index 14d6044..c172538 100644 > --- a/include/time.h > +++ b/include/time.h > @@ -194,6 +194,7 @@ char *timezone(int, int); /* XXX XSI > conflict */ void tzsetwall(void); > time_t timelocal(struct tm * const); > time_t timegm(struct tm * const); > +int timer_oshandle_np(timer_t timerid); > #endif /* __BSD_VISIBLE */ > =20 > #if __POSIX_VISIBLE >=3D 200809 || defined(_XLOCALE_H_) > diff --git a/lib/librt/Symbol.map b/lib/librt/Symbol.map > index 161bb76..fef3c15 100644 > --- a/lib/librt/Symbol.map > +++ b/lib/librt/Symbol.map > @@ -25,6 +25,11 @@ FBSD_1.0 { > timer_getoverrun; > }; > =20 > +FBSD_1.5 { > + mq_getfd_np; > + timer_oshandle_np; > +}; > + > FBSDprivate_1.0 { > _aio_read; > _aio_write; > diff --git a/lib/librt/mq.c b/lib/librt/mq.c > index 750e969..513fa72 100644 > --- a/lib/librt/mq.c > +++ b/lib/librt/mq.c > @@ -272,8 +272,9 @@ __mq_unlink(const char *path) > return __sys_kmq_unlink(path); > } > =20 > +#pragma weak mq_getfd_np > int > -__mq_oshandle(mqd_t mqd) > +mq_getfd_np(mqd_t mqd) > { > =20 > return (mqd->oshandle); > diff --git a/lib/librt/timer.c b/lib/librt/timer.c > index 90269c2..b5f775c 100644 > --- a/lib/librt/timer.c > +++ b/lib/librt/timer.c > @@ -175,8 +175,9 @@ __timer_settime(timer_t timerid, int flags, > flags, value, ovalue); > } > =20 > +#pragma weak timer_oshandle_np > int > -__timer_oshandle(timer_t timerid) > +timer_oshandle_np(timer_t timerid) > { > =20 > return (timerid->oshandle); > diff --git a/tests/sys/mqueue/Makefile b/tests/sys/mqueue/Makefile > index ce5033c..251c497 100644 > --- a/tests/sys/mqueue/Makefile > +++ b/tests/sys/mqueue/Makefile > @@ -10,8 +10,8 @@ CFLAGS+=3D -I${SRCTOP}/tests > =20 > PROGS+=3D mqtest1 > PROGS+=3D mqtest2 > -#PROGS+=3D mqtest3 > -#PROGS+=3D mqtest4 > +PROGS+=3D mqtest3 > +PROGS+=3D mqtest4 > PROGS+=3D mqtest5 > =20 > LIBADD+=3D rt > diff --git a/tests/sys/mqueue/mqtest3.c b/tests/sys/mqueue/mqtest3.c > index c4b849e..3e20c4d 100644 > --- a/tests/sys/mqueue/mqtest3.c > +++ b/tests/sys/mqueue/mqtest3.c > @@ -62,9 +62,10 @@ main(void) > buf =3D malloc(attr.mq_msgsize); > for (j =3D 0; j < LOOPS; ++j) { > FD_ZERO(&set); > - FD_SET(__mq_oshandle(mq), &set); > + FD_SET(mq_getfd_np(mq), &set); > alarm(3); > - status =3D select(__mq_oshandle(mq)+1, &set, > NULL, NULL, NULL); > + status =3D select(mq_getfd_np(mq) + 1, &set, > NULL, > + NULL, NULL); > if (status !=3D 1) > err(1, "child process: select()"); > status =3D mq_receive(mq, buf, > attr.mq_msgsize, &prio); @@ -94,8 +95,9 @@ main(void) > } > alarm(3); > FD_ZERO(&set); > - FD_SET(__mq_oshandle(mq), &set); > - status =3D select(__mq_oshandle(mq)+1, NULL, > &set, NULL, NULL); > + FD_SET(mq_getfd_np(mq), &set); > + status =3D select(mq_getfd_np(mq) + 1, NULL, > &set, > + NULL, NULL); > if (status !=3D 1) > err(1, "select()"); > status =3D mq_send(mq, buf, attr.mq_msgsize, > PRIO); diff --git a/tests/sys/mqueue/mqtest4.c > b/tests/sys/mqueue/mqtest4.c index 474d212..b0b3952 100644 > --- a/tests/sys/mqueue/mqtest4.c > +++ b/tests/sys/mqueue/mqtest4.c > @@ -57,7 +57,7 @@ main(void) > mq =3D mq_open(MQNAME, O_RDWR); > if (mq =3D=3D (mqd_t)-1) > err(1, "child: mq_open"); > - EV_SET(&kev, __mq_oshandle(mq), EVFILT_READ, EV_ADD, > 0, 0, 0); > + EV_SET(&kev, mq_getfd_np(mq), EVFILT_READ, EV_ADD, > 0, 0, 0); status =3D kevent(kq, &kev, 1, NULL, 0, NULL); > if (status =3D=3D -1) > err(1, "child: kevent"); > @@ -89,7 +89,7 @@ main(void) > =20 > signal(SIGALRM, sighandler); > kq =3D kqueue(); > - EV_SET(&kev, __mq_oshandle(mq), EVFILT_WRITE, > EV_ADD, 0, 0, 0); > + EV_SET(&kev, mq_getfd_np(mq), EVFILT_WRITE, EV_ADD, > 0, 0, 0); status =3D kevent(kq, &kev, 1, NULL, 0, NULL); > if (status =3D=3D -1) > err(1, "kevent"); This looks good to me, thank you. If there is a desire to keep old names exported, we can provide them as compat symbols too, so that old binaries keep working. Software built from sources is better off adapting new names which I think are quite a bit better. --=20 Alexander Kabaev --Sig_/Dx6k8femPnHps78YWcQVe8b Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJX8IHLXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+53gQAJGhq4+dX6RCUdC60hKgzlbc iZbBwwUK9PgKu2k8U9XMyheynpulo3rx0pK49dv96b7TlldetAOOO3Yc5Lh/gjMT 2dl2Jw4eyDlQx+PwpJvsUayH20BSuDsrKWZPkZ3kdDrKKJ8IenYVcdBUgcm9SrjM PFPGaEJFPAwxC3C78hyiq38PA6T9G/ldlQkjTvD/GBMoKs09hozmUuXHfuWu3nbZ JNy/OJWbPzWdmZ0rbEy0LthELTj5lCKVDscUzdqy4WO3iGIkkpKCNyq8gEgdLzG/ 5As+CKun24rtGHBMyGMHp9VEF8GiBjDIlD03AnQK5OCpNy7zRtJ94C7EY/ukWmj1 3d9diX0Xlk31IlGoCi7/jKny+5reerhYMJiyxCGswwSKxm3dlrlSKKXpHI7sBOKR KH651xmH0gYKBhH7EozNP0UC8/RpesHNl9iuUd4jmNHtu4ij83aYXtgWcTj1EU0z UFs1jZQEgJpk2+y4OoKHEJVbQnCjxmOV3pc1cTSh7qFve8/r5Z2/CaYXVDRnNl4t MaCBSzjGfEzurO7W8c8cYEy/LYjW8t9TaDcuw/hW/n8UTO+ZX3HHahP0pKxIJmGp o6tJUnnpSsIBhDmLOvHoM4Pe8rmOjbOZ52FGqYhk1ztkPPyYUbYQal3VbDm2tDfY 5mIj2aG8AJCQMhrm7Zgd =usTQ -----END PGP SIGNATURE----- --Sig_/Dx6k8femPnHps78YWcQVe8b-- From owner-freebsd-arch@freebsd.org Sun Oct 2 11:46:24 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB101ADAC1F for ; Sun, 2 Oct 2016 11:46:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 5673DB9D; Sun, 2 Oct 2016 11:46:24 +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 ESMTPS id u92BkEfY042193 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 2 Oct 2016 14:46:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u92BkEfY042193 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u92BkDih042191; Sun, 2 Oct 2016 14:46:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Oct 2016 14:46:13 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: Lewis Donzis , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161002114613.GE38409@kib.kiev.ua> References: <8A6CD0D3-C4D5-40DF-B2AD-4C454CC88AD1@perftech.com> <20160930094544.GP38409@kib.kiev.ua> <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161001231524.GB91457@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) 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: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 11:46:25 -0000 On Sun, Oct 02, 2016 at 01:15:24AM +0200, Jilles Tjoelker wrote: > On Sun, Oct 02, 2016 at 12:07:22AM +0300, Konstantin Belousov wrote: > > On Sat, Oct 01, 2016 at 10:16:55PM +0200, Jilles Tjoelker wrote: > > > The idea is good, but perhaps call the function mq_getfd_np() to clarify > > > it returns a file descriptor. Also, the __ versions should not be > > > exported since they are not used outside the library (they can be > > > exported if and when needed). > > Please rename timer_oshandle_np() to timer_getfd_np() as well. The timer handle is not an fd, so I kept the old name. Using _getfd there is IMO more confusing than the neutral _handle for mq. > > Looks ready to commit otherwise. I do not think that we need to provide compat symbols. From owner-freebsd-arch@freebsd.org Sun Oct 2 13:22:46 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F18CADC172 for ; Sun, 2 Oct 2016 13:22:46 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [131.155.140.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 42CD4240; Sun, 2 Oct 2016 13:22:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id 336C76B68; Sun, 2 Oct 2016 15:22:43 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 2306028494; Sun, 2 Oct 2016 15:22:43 +0200 (CEST) Date: Sun, 2 Oct 2016 15:22:43 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: Lewis Donzis , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161002132242.GA2628@stack.nl> References: <8A6CD0D3-C4D5-40DF-B2AD-4C454CC88AD1@perftech.com> <20160930094544.GP38409@kib.kiev.ua> <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161002114613.GE38409@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 13:22:46 -0000 On Sun, Oct 02, 2016 at 02:46:13PM +0300, Konstantin Belousov wrote: > On Sun, Oct 02, 2016 at 01:15:24AM +0200, Jilles Tjoelker wrote: > > On Sun, Oct 02, 2016 at 12:07:22AM +0300, Konstantin Belousov wrote: > > > On Sat, Oct 01, 2016 at 10:16:55PM +0200, Jilles Tjoelker wrote: > > > > The idea is good, but perhaps call the function mq_getfd_np() to clarify > > > > it returns a file descriptor. Also, the __ versions should not be > > > > exported since they are not used outside the library (they can be > > > > exported if and when needed). > > Please rename timer_oshandle_np() to timer_getfd_np() as well. > The timer handle is not an fd, so I kept the old name. Using > _getfd there is IMO more confusing than the neutral _handle for > mq. Oh right, the timers are not file descriptors. -- Jilles Tjoelker From owner-freebsd-arch@freebsd.org Sun Oct 2 14:13:21 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83268ADCE2F for ; Sun, 2 Oct 2016 14:13:21 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5153CB3F for ; Sun, 2 Oct 2016 14:13:21 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1475417474-09411a12c01172650001-RYubVt Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id OztJWycFibDEeUrq (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 02 Oct 2016 09:11:14 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 2BF3D8425F3; Sun, 2 Oct 2016 09:11:14 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id s2eOkG-jyUhM; Sun, 2 Oct 2016 09:11:13 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id E00A68425FF; Sun, 2 Oct 2016 09:11:13 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id DL85Fs0hPaVX; Sun, 2 Oct 2016 09:11:13 -0500 (CDT) Received: from lewhome-dhcp-179.pt.net (lewhome-dhcp-179.pt.net [206.210.207.179]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 8FE5B8425F3; Sun, 2 Oct 2016 09:11:13 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 From: Lewis Donzis X-ASG-Orig-Subj: Re: mq on kqueue broken after upgrade to FreeBSD 11 In-Reply-To: <20161002132242.GA2628@stack.nl> Date: Sun, 2 Oct 2016 09:11:12 -0500 Cc: Konstantin Belousov , deischen@freebsd.org, freebsd-arch@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> References: <8A6CD0D3-C4D5-40DF-B2AD-4C454CC88AD1@perftech.com> <20160930094544.GP38409@kib.kiev.ua> <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.3124) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1475417474 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1111 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33405 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 14:13:21 -0000 > On Oct 2, 2016, at 8:22 AM, Jilles Tjoelker wrote: >=20 > On Sun, Oct 02, 2016 at 02:46:13PM +0300, Konstantin Belousov wrote: >> On Sun, Oct 02, 2016 at 01:15:24AM +0200, Jilles Tjoelker wrote: >>> On Sun, Oct 02, 2016 at 12:07:22AM +0300, Konstantin Belousov wrote: >>>> On Sat, Oct 01, 2016 at 10:16:55PM +0200, Jilles Tjoelker wrote: >>>>> The idea is good, but perhaps call the function mq_getfd_np() to = clarify >>>>> it returns a file descriptor. Also, the __ versions should not be >>>>> exported since they are not used outside the library (they can be >>>>> exported if and when needed). >=20 >>> Please rename timer_oshandle_np() to timer_getfd_np() as well. >> The timer handle is not an fd, so I kept the old name. Using >> _getfd there is IMO more confusing than the neutral _handle for >> mq. >=20 > Oh right, the timers are not file descriptors. Technically, neither are mqueues. The only thing "the int" can be used = for is select(), poll(), and kevent(). You can=E2=80=99t (or at least = shouldn=E2=80=99t) pass it to any of the other system calls that accept = fds. lew= From owner-freebsd-arch@freebsd.org Sun Oct 2 16:37:15 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDBE0AF0C41 for ; Sun, 2 Oct 2016 16:37:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 5227829F; Sun, 2 Oct 2016 16:37:15 +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 ESMTPS id u92GbAPv012652 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 2 Oct 2016 19:37:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u92GbAPv012652 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u92Gb8rP012651; Sun, 2 Oct 2016 19:37:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Oct 2016 19:37:08 +0300 From: Konstantin Belousov To: Lewis Donzis Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161002163708.GG38409@kib.kiev.ua> References: <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> User-Agent: Mutt/1.6.1 (2016-04-27) 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: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 16:37:15 -0000 On Sun, Oct 02, 2016 at 09:11:12AM -0500, Lewis Donzis wrote: > Technically, neither are mqueues. The only thing "the int" can be used for is select(), poll(), and kevent(). You can???t (or at least shouldn???t) pass it to any of the other system calls that accept fds. Technically, mqueues are file descriptors. FWIW, allowed operations (in the sense of doing something instead of returning errors) are, besides polling, also stat, chmod, chown. They are enumerable as normal elements of the process' file descriptor table, inherited on fork, and you can and should close(2) them. From owner-freebsd-arch@freebsd.org Mon Oct 3 12:29:57 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEB7AF36F8 for ; Mon, 3 Oct 2016 12:29:57 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28E102EA for ; Mon, 3 Oct 2016 12:29:56 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1475497675-09411a12bf11aec80001-RYubVt Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id bsSvpowZ76zdXsJo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 03 Oct 2016 07:27:55 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id AFD3C842601; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id E2UtlsqCnUjj; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 7ECC28425F8; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id p5kxVXxakSbk; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from lewhome-dhcp-179.pt.net (lewhome-dhcp-179.pt.net [206.210.207.179]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 2BB838425E3; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 From: Lewis Donzis X-ASG-Orig-Subj: Re: mq on kqueue broken after upgrade to FreeBSD 11 In-Reply-To: <20161002163708.GG38409@kib.kiev.ua> Date: Mon, 3 Oct 2016 07:27:54 -0500 Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> References: <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> <20161002163708.GG38409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1475497675 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1058 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33427 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 12:29:57 -0000 > On Oct 2, 2016, at 11:37 AM, Konstantin Belousov = wrote: >=20 > On Sun, Oct 02, 2016 at 09:11:12AM -0500, Lewis Donzis wrote: >> Technically, neither are mqueues. The only thing "the int" can be = used for is select(), poll(), and kevent(). You can???t (or at least = shouldn???t) pass it to any of the other system calls that accept fds. >=20 > Technically, mqueues are file descriptors. FWIW, allowed operations = (in > the sense of doing something instead of returning errors) are, besides > polling, also stat, chmod, chown. They are enumerable as normal = elements > of the process' file descriptor table, inherited on fork, and you can > and should close(2) them. That's a very good point, I hadn't considered those other functions, and = it=E2=80=99s clear that an fd is allocated and stored in the mqd_t. But = using close() instead of mq_close() wouldn't delete the sigevent or free = the memory that was allocated by mq_open(). In other words, I don't = understand why you'd ever want/need to use close() on the underlying fd. lew= From owner-freebsd-arch@freebsd.org Wed Oct 5 13:14:22 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B607AAF5288 for ; Wed, 5 Oct 2016 13:14:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 33213753; Wed, 5 Oct 2016 13:14:22 +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 ESMTPS id u95DEDcQ088059 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 5 Oct 2016 16:14:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u95DEDcQ088059 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u95DECEG088057; Wed, 5 Oct 2016 16:14:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 5 Oct 2016 16:14:12 +0300 From: Konstantin Belousov To: Lewis Donzis Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161005131412.GF38409@kib.kiev.ua> References: <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> <20161002163708.GG38409@kib.kiev.ua> <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> User-Agent: Mutt/1.6.1 (2016-04-27) 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: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 13:14:22 -0000 On Mon, Oct 03, 2016 at 07:27:54AM -0500, Lewis Donzis wrote: > That's a very good point, I hadn't considered those other functions, > and it???s clear that an fd is allocated and stored in the mqd_t. > But using close() instead of mq_close() wouldn't delete the sigevent > or free the memory that was allocated by mq_open(). In other words, > I don't understand why you'd ever want/need to use close() on the > underlying fd. I really have troubles giving any useful interpretation to your question. OS provides the kernel service which backs the posix message queue implementation in userspace, as a file descriptor. To release resources designated by the file descriptor, it must be closed, as in, close(2) must be called. Librt does this in mq_close(3). Why should I need to show a case of using close(2) on kernel mq descriptor (perhaps besides librt) ? And how this changes or augments the fact that kmq is file descriptor ? From owner-freebsd-arch@freebsd.org Wed Oct 5 18:15:09 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98587AF69E6 for ; Wed, 5 Oct 2016 18:15:09 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 804932A5 for ; Wed, 5 Oct 2016 18:15:09 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from [127.0.0.1] (helo=id.bluezbox.com) by id.bluezbox.com with esmtp (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1brqib-000AZs-7U for freebsd-arch@freebsd.org; Wed, 05 Oct 2016 11:15:01 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id u95IF0iq040663 for freebsd-arch@freebsd.org; Wed, 5 Oct 2016 11:15:00 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Wed, 5 Oct 2016 11:15:00 -0700 From: Oleksandr Tymoshenko To: freebsd-arch@freebsd.org Subject: Recycling xdev to be cross-toolchain? Message-ID: <20161005181500.GA40468@bluezbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD/10.3-RELEASE-p3 (amd64) User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Hello arch@, xdev was added to base a while ago by Warner Losh as a sysroot + cross-toolchains for cross-compiling ports. It grew less relevant with introduction of qemu-userland support and lately got bitrotten and at the moment is broken due to the reasons outlined by dim@ in this issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213217 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 18:15:09 -0000 Hello arch@, xdev was added to base a while ago by Warner Losh as a sysroot + cross-toolchains for cross-compiling ports. It grew less relevant with introduction of qemu-userland support and lately got bitrotten and at the moment is broken due to the reasons outlined by dim@ in this issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213217 Though sysroot part of xdev environment is probably of no use to anyone I find toolchain part of it extremely useful. I do routine cross-builds of Qt git repo and having all the tools in one place is very convenient. I use NFS root for my ARM devices as a sysroot in this case. So what I suggest is to cut off sysroot bits and keep clang+binutils part. Later when base is going to be package-based it may be shipped as a ready-to-use cross-compilation package. I created preliminary patch[1] for this, it still requires some work and I am not sure about mtree part of it but if consensus will be to go this way - I'll clean it up and submit for formal review On the other hadn if there are other cross-toolchain efforts going on I am not aware of, it might be easier to just kill xdev altogether. [1] https://people.freebsd.org/~gonzo/patches/xdev-as-toolchain.diff -- gonzo From owner-freebsd-arch@freebsd.org Thu Oct 6 00:11:12 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A99AF42F9 for ; Thu, 6 Oct 2016 00:11:12 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 660B66E6 for ; Thu, 6 Oct 2016 00:11:11 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1475712544-09411a12c012a7ef0001-RYubVt Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id sFv9fcYJRUFR7BEJ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 05 Oct 2016 19:09:04 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id DD089842630; Wed, 5 Oct 2016 19:09:04 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id lwSi51cxktPZ; Wed, 5 Oct 2016 19:09:04 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id A67BB842634; Wed, 5 Oct 2016 19:09:04 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id FkQ_uIrwcDHM; Wed, 5 Oct 2016 19:09:04 -0500 (CDT) Received: from [192.168.0.16] (cpe-173-173-96-61.satx.res.rr.com [173.173.96.61]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 5AAFD842630; Wed, 5 Oct 2016 19:09:04 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 From: Lewis Donzis X-ASG-Orig-Subj: Re: mq on kqueue broken after upgrade to FreeBSD 11 In-Reply-To: <20161005131412.GF38409@kib.kiev.ua> Date: Wed, 5 Oct 2016 19:09:03 -0500 Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> <20161002163708.GG38409@kib.kiev.ua> <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> <20161005131412.GF38409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1475712544 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1893 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33509 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 00:11:12 -0000 > On Oct 5, 2016, at 8:14 AM, Konstantin Belousov = wrote: >=20 > On Mon, Oct 03, 2016 at 07:27:54AM -0500, Lewis Donzis wrote: >> That's a very good point, I hadn't considered those other functions, >> and it???s clear that an fd is allocated and stored in the mqd_t. >> But using close() instead of mq_close() wouldn't delete the sigevent >> or free the memory that was allocated by mq_open(). In other words, >> I don't understand why you'd ever want/need to use close() on the >> underlying fd. >=20 > I really have troubles giving any useful interpretation to your = question. > OS provides the kernel service which backs the posix message queue > implementation in userspace, as a file descriptor. To release = resources > designated by the file descriptor, it must be closed, as in, close(2) > must be called. Librt does this in mq_close(3). >=20 > Why should I need to show a case of using close(2) on kernel mq > descriptor (perhaps besides librt) ? And how this changes or augments > the fact that kmq is file descriptor ? Sorry, perhaps I wasn=E2=80=99t clear. As I read it, you suggested that = you "can and should call close()" on the fd in an mqd_t, and my point = was simply that such practice would obviously be bad because it would = fail to release resources allocated by mq_open(). So yes, the correct = way to close an mqueue is via mq_close(), i.e., we=E2=80=99re not meant = to circumvent the librt functions. The problem is that it=E2=80=99s not exactly clean that we have mq_*() = functions for some operations, whereas for others, we=E2=80=99re = required to convert the mqd_t to an fd. Of course, this is no fault of = FreeBSD, and perhaps the POSIX folks should have come up with a better = way to address this. For example, they could have specified a portable = way to get the underlying fd from an mqd_t and specified what can and = cannot be done with the fd. lew= From owner-freebsd-arch@freebsd.org Thu Oct 6 19:17:49 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0457EBECB26 for ; Thu, 6 Oct 2016 19:17:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 76837A5A; Thu, 6 Oct 2016 19:17:48 +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 ESMTPS id u96JHhTO055519 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 6 Oct 2016 22:17:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u96JHhTO055519 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u96JHgkO055518; Thu, 6 Oct 2016 22:17:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 6 Oct 2016 22:17:42 +0300 From: Konstantin Belousov To: Lewis Donzis Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 Message-ID: <20161006191742.GV38409@kib.kiev.ua> References: <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> <20161002163708.GG38409@kib.kiev.ua> <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> <20161005131412.GF38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 19:17:49 -0000 On Wed, Oct 05, 2016 at 07:09:03PM -0500, Lewis Donzis wrote: > Sorry, perhaps I wasn???t clear. As I read it, you suggested that you > "can and should call close()" on the fd in an mqd_t, and my point was > simply that such practice would obviously be bad because it would > fail to release resources allocated by mq_open(). So yes, the correct > way to close an mqueue is via mq_close(), i.e., we???re not meant to > circumvent the librt functions. > > The problem is that it???s not exactly clean that we have mq_*() > functions for some operations, whereas for others, we???re required to > convert the mqd_t to an fd. Of course, this is no fault of FreeBSD, > and perhaps the POSIX folks should have come up with a better way to > address this. For example, they could have specified a portable way to > get the underlying fd from an mqd_t and specified what can and cannot > be done with the fd. POSIX does not and can not mandate the implementation. Existence of the backing fd is pure implementation detail. Access to the fd through mq_getfd_np() is some good will service from the implementation which is supposed to make additional things possible besides the guarantees of the POSIX spec. kqueue(2) is not part of the POSIX, same as the use of mq for the multiplexed wait (select/poll/kqueue). POSIX intent is that app code get notifications by events. From owner-freebsd-arch@freebsd.org Fri Oct 7 06:13:26 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16ABDBEC173 for ; Fri, 7 Oct 2016 06:13:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5235C7CE for ; Fri, 7 Oct 2016 06:13:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA09306 for ; Fri, 07 Oct 2016 09:13:19 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bsOPH-000ARY-P1 for freebsd-arch@FreeBSD.ORG; Fri, 07 Oct 2016 09:13:19 +0300 To: freebsd-arch@FreeBSD.org From: Andriy Gapon Subject: installing headers required for libzfs_core api Message-ID: Date: Fri, 7 Oct 2016 09:11:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2016 06:13:26 -0000 Anyone interested in the topic, could you please take a look at https://reviews.freebsd.org/D8005 before I commit it? Thanks! -- Andriy Gapon