From owner-dev-commits-src-all@freebsd.org Mon Jun 21 23:01:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD059651450; Mon, 21 Jun 2021 23:01:09 +0000 (UTC) (envelope-from tmunro@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G84l95Rjfz3Bs7; Mon, 21 Jun 2021 23:01:09 +0000 (UTC) (envelope-from tmunro@freebsd.org) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: tmunro/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A3269404A; Mon, 21 Jun 2021 23:01:09 +0000 (UTC) (envelope-from tmunro@freebsd.org) Received: by mail-il1-f172.google.com with SMTP id v5so150506ilo.5; Mon, 21 Jun 2021 16:01:09 -0700 (PDT) X-Gm-Message-State: AOAM530PCgbE2e3lpWWzzvJFQdlZW21LJBJ0PmR7uZ/663TNlKsYlbHQ 1DJQ6YF83+ocDGkQ9mWsLPlURXf69u912YqY7hQ= X-Google-Smtp-Source: ABdhPJwzQZt1j5J603PejzkulBjzlByRRQnjGxQL/PQFWL5piyUnytxOD+3tZ+ngvymIUiFc3eLPhTd2V4++15zudq4= X-Received: by 2002:a05:6e02:c74:: with SMTP id f20mr440024ilj.85.1624316468683; Mon, 21 Jun 2021 16:01:08 -0700 (PDT) MIME-Version: 1.0 References: <202106211630.15LGU59S021852@gitrepo.freebsd.org> In-Reply-To: <202106211630.15LGU59S021852@gitrepo.freebsd.org> From: Thomas Munro Date: Tue, 22 Jun 2021 11:00:32 +1200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 26795a0378b5 - main - linux(4): Rework Linux ppoll system call. To: Dmitry Chagin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 23:01:09 -0000 Hi Dmitry, On Tue, Jun 22, 2021 at 4:30 AM Dmitry Chagin wrote: > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=26795a0378b58c3e26b68577a4cc446ab527e8b5 > > commit 26795a0378b58c3e26b68577a4cc446ab527e8b5 > Author: Dmitry Chagin > AuthorDate: 2021-06-22 05:06:05 +0000 > Commit: Dmitry Chagin > CommitDate: 2021-06-22 05:06:05 +0000 > > linux(4): Rework Linux ppoll system call. > > For now the Linux emulation layer uses in kernel ppoll(2) without > conversion of user supplied fd 'events', and does not convert the > kernel supplied fd 'revents'. > > At least POLLRDHUP is handled by FreeBSD differently than by > Linux. Seems that Linux silencly ignores POLLRDHUP on non socket fd's > unlike FreeBSD, which does more strictly check and fails. For the record, I wondered about adding POLLRDHUP to POLLSTANDARD, but that didn't seem right as it's not "standard", and I wondered if the POLLSTANDARD check mechanism should event exist at all ((1) POSIX doesn't tell us to reject flags, its POLLNVAL is for rejecting bogus fds, (2) it was added at the same time as POLLWRITE and other extensions that were later reverted), but I wasn't sure enough about that to propose those changes when adding POLLRDHUP, or at least it seemed like an independent matter for discussion. > Rework the Linux ppoll, using kern_poll and converting 'events' > and 'revents' values. > While here, move poll events defines to the MI part of code as they > mostly identical on all arches except arm. > > Differential Revision: https://reviews.freebsd.org/D30716 > MFC after: 2 weeks Note that the POLLRDHUP support is new (commit 18f21f03) and not yet MFC'd. I was planning to MFC to 13 in the next few days if there are no objections.