From nobody Thu Feb 16 11:56:35 2023 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 4PHYM753B2z3q5k4; Thu, 16 Feb 2023 11:56:35 +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 4PHYM72n3mz4Bpf; Thu, 16 Feb 2023 11:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548595; 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=9gEQQ5jr70Dxbu8j+j4SoiVEeDRnolunI3RQ2rXEkw4=; b=CoZU7EJpu7LOZ7uNM+IRL+1/i9ZaZ76rC3jQ0QqZMlwclABPjPfCYI+PUeSOnBI+yiRNuU XaBN9gI80RtmXKdFmaVkZuUXDYqs6Mp0u5HCBy/5NrNjKCIvvgYXTcW8ncbn60wbqtlnHs gv9cWmPDPxpfc0StXar0nSUCpul/hSKsxLiEhLpjcRj6EUVuK5fPZnT8pWuJ+bVIXIY85G qNGsweUEImHrkqZ97Vn48V0vhS7dww5CQKIH3EDQdK9of/B0aOs1e1UJBiN767ODcLkg/z Vz7SNBXHy3Xtv/+wTimwR2ws7Z7rp+PDK+3yZb35gMH6rizM218F9SJFyIOFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548595; 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=9gEQQ5jr70Dxbu8j+j4SoiVEeDRnolunI3RQ2rXEkw4=; b=c3ffW4qepqdM/iNOFFCBks+qgQSBAxSVrXbIQY6X0rZkot11vKYZcJ0YW3vEYnqchqoICW V7xe8s015aHAVMprQGXsLpZZarX1KXqgVOk8Ky2cPJdY7ykaNUn7Al14XUcOMs4pd161aP 4PyW1sm4Yakgdwnp8vw+8ND+DsUNZzdqP29/PO99GYxeY93uQRbZzRuHYEtKFgV1alBgeb Zl8znBFvS1SJPMR0uC/c/JBVc3j+0QEOug9EMt6dBWp/OnvPNJ1I2LnOa3m6TkgcmSGIt0 /fp6Upt9HNnqNYN2QtlHF7fJU/6p/Y5KAZ8fxk2k5PkK5Apx54cKk4R9Vy8wcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548595; a=rsa-sha256; cv=none; b=LODacB+Hmg2VBvG03cyiNQXKDE58HldvlY6Obyuw+9JJg04vVpfehvNttGm0j0PpyUxryv yNZ3tB6Mav0bOj7KTh1T+xMFtVIWz/qi1pgQxW8YmmciGhT36mBpMaAD2OmEjCipzf9We6 0L9ihooK7IMu63v86CSRCk02oHKKgz6NmOJ1EvE7IqB0G5Jt+6cVrGXfyVrl+xFc39cNZ3 EzbP4yh4kl/oPN9nSjFjZ5eKbqETvWVuS5kxJAtonCPkkxZNWv7WE/uYO6l1e0IskaTJG5 EYLMwdLuuUbHRNNhMZiVGc+K0szQgukVhYEKI4RUKzMrjkd6UmrrHOV2KfCjhg== 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 4PHYM71bn4z12j3; Thu, 16 Feb 2023 11:56:35 +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 31GBuZMF056396; Thu, 16 Feb 2023 11:56:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBuZWX056395; Thu, 16 Feb 2023 11:56:35 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:56:35 GMT Message-Id: <202302161156.31GBuZWX056395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 01b3fc89ddd8 - stable/13 - linuxkpi: Add `synchronize_shrinkers()` 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 01b3fc89ddd8e48c6dfe584d44b6018edc4f3a5f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=01b3fc89ddd8e48c6dfe584d44b6018edc4f3a5f commit 01b3fc89ddd8e48c6dfe584d44b6018edc4f3a5f Author: Jean-Sébastien Pédron AuthorDate: 2023-02-13 20:49:28 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:20 +0000 linuxkpi: Add `synchronize_shrinkers()` It takes the lock and release it immediately to make sure no shrinkers are running in parallel. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38565 (cherry picked from commit 83636727291714c235726da987a02c5b1d51bb54) --- sys/compat/linuxkpi/common/include/linux/shrinker.h | 2 ++ sys/compat/linuxkpi/common/src/linux_shrinker.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/shrinker.h b/sys/compat/linuxkpi/common/include/linux/shrinker.h index 39ea35f0a862..04e96a12c4bd 100644 --- a/sys/compat/linuxkpi/common/include/linux/shrinker.h +++ b/sys/compat/linuxkpi/common/include/linux/shrinker.h @@ -51,8 +51,10 @@ struct shrinker { int linuxkpi_register_shrinker(struct shrinker *s); void linuxkpi_unregister_shrinker(struct shrinker *s); +void linuxkpi_synchronize_shrinkers(void); #define register_shrinker(s) linuxkpi_register_shrinker(s) #define unregister_shrinker(s) linuxkpi_unregister_shrinker(s) +#define synchronize_shrinkers() linuxkpi_synchronize_shrinkers() #endif /* _LINUXKPI_LINUX_SHRINKER_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index b48e491a4e2f..227ef3261cb3 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -64,6 +64,14 @@ linuxkpi_unregister_shrinker(struct shrinker *s) sx_xunlock(&sx_shrinker); } +void +linuxkpi_synchronize_shrinkers(void) +{ + + sx_xlock(&sx_shrinker); + sx_xunlock(&sx_shrinker); +} + #define SHRINKER_BATCH 512 static void