From owner-svn-src-all@freebsd.org Fri Nov 23 23:10:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF58C1133B0B; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8429B78E21; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65520252DE; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNA4bq032946; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNA4ct032945; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232310.wANNA4ct032945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 23:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340861 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8429B78E21 X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:10:05 -0000 Author: markj Date: Fri Nov 23 23:10:03 2018 New Revision: 340861 URL: https://svnweb.freebsd.org/changeset/base/340861 Log: Honour the waitok parameter in kevent_expand(). Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Nov 23 23:07:57 2018 (r340860) +++ head/sys/kern/kern_event.c Fri Nov 23 23:10:03 2018 (r340861) @@ -1686,10 +1686,6 @@ kqueue_schedtask(struct kqueue *kq) * Expand the kq to make sure we have storage for fops/ident pair. * * Return 0 on success (or no work necessary), return errno on failure. - * - * Not calling hashinit w/ waitok (proper malloc flag) should be safe. - * If kqueue_register is called from a non-fd context, there usually/should - * be no locks held. */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, @@ -1734,8 +1730,9 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } } else { if (kq->kq_knhashmask == 0) { - tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask); + tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, + &tmp_knhashmask, + waitok ? HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return ENOMEM; KQ_LOCK(kq);