From nobody Wed Apr 27 23:27:49 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E34871AA9058; Wed, 27 Apr 2022 23:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpZfs52myz4YGn; Wed, 27 Apr 2022 23:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651102069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SKS5WeXhuX6+gb5MGJwdkCBV3RLqQnEb5j21ZIog5tU=; b=bfxlolQtdZlvm4aKGBHJnteQN0VIcdMhtuEJ9T2v/nuhdu+Fe9pHH16i/qLTvTHHguSjAE miTyHzfYy3ONVVNsIcezqk0av9jbHH6A8QOisOtjevCL846ZwYqN7HibIY5gfn4CYJ/imL idpMprF8ou6Wo+dNJfac0wDlGRytpc8FHEO8JbFf6JnAzKBDscfgipwFaaJJVqlDYnsziv 3aQWkzisvwIbvv7KDDNvPMvpn7zhHyv5/G5Lh+K30i6+jzZ+DgSEORUyBF+9MbQTGn1a+b xtFQpI3khUV8NX/ANFkVjbrFKjVj+iZ/zo5Ed8fuWsCFH66Z6Pf6GHtYP5R4VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77CCD5720; Wed, 27 Apr 2022 23:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23RNRnQx071839; Wed, 27 Apr 2022 23:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23RNRng1071838; Wed, 27 Apr 2022 23:27:49 GMT (envelope-from git) Date: Wed, 27 Apr 2022 23:27:49 GMT Message-Id: <202204272327.23RNRng1071838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e4ce431e2a02 - main - reap_kill(): de-inline LIST_FOREACH(), twice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4ce431e2a0255751fee0ad14b08bd006759ce4f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651102069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SKS5WeXhuX6+gb5MGJwdkCBV3RLqQnEb5j21ZIog5tU=; b=nGbRHZ915JItO4Ek34ad4lib655flA+DiusIzs6VB81pILk2djcWLcNgDmtvpFE/szLR/P xb9zAxgHDXJ9d1QEMgsvJRiYInYYprT7JiYrluQQBqycDvhnOo1seAjHOph62CPfAy7iH8 LLVbwoUwo62NApHDCL6fvw2EGxuLBDsJfAvmuDpAeMRgoLwFkjzUX0E/Ax9dmqENFmXZdb ffGawuHn0CBbT9ENGsW1Q/D3xv1Yf7scLjjuHQlFJVUKu5js8zrhVvueVvT8wJk4VzN8rF KF7cohlbpfpEMN6zOHX03hHN1GL+vKGsGuOu7OTJwv/IiPtuWbQ9PY92NOrs9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651102069; a=rsa-sha256; cv=none; b=OjjaYJXvdxh3AC4EIpCqZq5biptMMaIXqibfrDT66jyulDQFChGmgXeiVPEpGeInPV87o5 xbm+Eh3KMhUb02kTBqlIp6pwjw9wunZrjZd5V5fJ2HtsnJWN5opuxd63/q32hkNpaVs00W mIZ6ucyYIPbwwxaR/8O69lwOzVQ+MVqAPy1+DhGV2FI97+MY4/pP8cMGdgwYHuAMnFwjvT MD7f1LsVOreNBAbChY/z/8HddaHHos+km3dIJNp4bmj1lCXTA35Xqhl/dWec5uvCLmrxEp wjYROI7LTY/BYPH1twcy6hayoTbBRx11IoD/pDdqvJkssFSxXGKZghuWhhWHRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e4ce431e2a0255751fee0ad14b08bd006759ce4f commit e4ce431e2a0255751fee0ad14b08bd006759ce4f Author: Konstantin Belousov AuthorDate: 2022-04-25 21:57:13 +0000 Commit: Konstantin Belousov CommitDate: 2022-04-27 23:27:34 +0000 reap_kill(): de-inline LIST_FOREACH(), twice Suggested and reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D35014 --- sys/kern/kern_procctl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index f90c0e146e2b..96748e27f57c 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -309,8 +309,7 @@ reap_kill(struct thread *td, struct proc *p, void *data) rk->rk_killed = 0; rk->rk_fpid = -1; if ((rk->rk_flags & REAPER_KILL_CHILDREN) != 0) { - for (p2 = LIST_FIRST(&reap->p_children); p2 != NULL; - p2 = LIST_NEXT(p2, p_sibling)) { + LIST_FOREACH(p2, &reap->p_children, p_sibling) { reap_kill_proc(td, p2, &ksi, rk, &error); /* * Do not end the loop on error, signal @@ -323,8 +322,8 @@ reap_kill(struct thread *td, struct proc *p, void *data) while ((t = TAILQ_FIRST(&tracker)) != NULL) { MPASS((t->parent->p_treeflag & P_TREE_REAPER) != 0); TAILQ_REMOVE(&tracker, t, link); - for (p2 = LIST_FIRST(&t->parent->p_reaplist); p2 != NULL; - p2 = LIST_NEXT(p2, p_reapsibling)) { + LIST_FOREACH(p2, &t->parent->p_reaplist, + p_reapsibling) { if (t->parent == reap && (rk->rk_flags & REAPER_KILL_SUBTREE) != 0 && p2->p_reapsubtree != rk->rk_subtree)