From patchwork Fri Apr 14 17:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13211854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C11F2C77B72 for ; Fri, 14 Apr 2023 17:17:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 327DC6B0072; Fri, 14 Apr 2023 13:17:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D7FB6B0075; Fri, 14 Apr 2023 13:17:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A276900002; Fri, 14 Apr 2023 13:17:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0B0616B0072 for ; Fri, 14 Apr 2023 13:17:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B90F71A01F8 for ; Fri, 14 Apr 2023 17:17:09 +0000 (UTC) X-FDA: 80680652178.21.CFCE12F Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id 2BF87180029 for ; Fri, 14 Apr 2023 17:17:07 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=YTXbS1xl; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf16.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681492628; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=3HOFuNsuGVoqF4T3OjWzrAAkX2klavHlrB4YyoEVapI=; b=cfhygXp8Jx0A+FT+KYhYgRYH+/QSmR4RE0CkC/B6vCKbnf1nUdd40a5sjtVHI9H8cNPVxS pC9B8VSw6hNadZpMyi/1YwQDpBW207Amxt+wPRugfgbagmp2j6wXL3/QBwhFvs7JSpjtFo o1kcAOBk4+i7fQdBz/by49rN5+TnpX0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=YTXbS1xl; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf16.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681492628; a=rsa-sha256; cv=none; b=TdzRMc/plXwfTVtWv2emtcjETWWCgnDS6Q+YcXRqPb6thzBFoXEiCc82RgBYfdi6+KrrFv BD1JG5BPudJrw7usr1CiEhgoF16LT8Wb6o8BdAyfJvLOamEtbIHmTqh9+X8vrcioGsOdwa WeT7fJR7+rY1cvSIa3mJ6DBp9/n/kcA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=3HOFuNsuGVoqF4T3OjWzrAAkX2klavHlrB4YyoEVapI=; b=YTXbS1xlcj8FcBaWMo0FtPuL+/ Q/iTd1fMbg7k9DDh5hPJ+m7zGYI8JAFV3exc3f/znHwwzGjYtWUUWdRzZm6DSFelzBY7qlCx3luVX UkQbo2PuD2NleGtLLnBzwIOm1O8AYvSSzHPro4dXnALi3bTLpJ0lInAUNGCGOei8wSPGelph/sd3G DzPQmw49lM54pq9Q0grd/npKBiI+6N3l+KWP5kb5HY+CU+dPpALIQTlap2Nh+/xZ/zeneFCpFt1rQ +leqaRyoOioslLFZZxxzf+Lk08HGydap6kSzWK85unYJRdX9vvJXN8r1x9fCdlK0zzP4ktwi+4szt mwhmklzw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pnN2k-00ADLX-2W; Fri, 14 Apr 2023 17:17:02 +0000 From: Luis Chamberlain To: david@redhat.com, patches@lists.linux.dev, linux-modules@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pmladek@suse.com, petr.pavlu@suse.com, prarit@redhat.com, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, rafael@kernel.org Cc: christophe.leroy@csgroup.eu, tglx@linutronix.de, peterz@infradead.org, song@kernel.org, rppt@kernel.org, dave@stgolabs.net, willy@infradead.org, vbabka@suse.cz, mhocko@suse.com, dave.hansen@linux.intel.com, colin.i.king@gmail.com, jim.cromie@gmail.com, catalin.marinas@arm.com, jbaron@akamai.com, rick.p.edgecombe@intel.com, mcgrof@kernel.org Subject: [PATCH v4 0/2] modules/kmod: replace implementation with a sempahore Date: Fri, 14 Apr 2023 10:16:42 -0700 Message-Id: <20230414171644.2434448-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 2BF87180029 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 6a8zuo6sos37hrzi8pm8urwwn8xypr76 X-HE-Tag: 1681492627-318287 X-HE-Meta: U2FsdGVkX1+6/yqjfYfT7cxu1ZflRPQG5yb0YT6u4A2PfFft7xNiuediD0Jv6bHjC8BurPRbtkjXi3eHwV4wFx4Cvs7BaRGDU4jdiMY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mkBhD+ZKuPNSWglFrn//3XVzy7CuJvUro24sHZYUjx/6axzc4rNMj8Lvuda/KLg26UJPJ9P6ijaziytTnJSRkC+7P2vWh3xlxpjArWQ2torfAdmy9pxKfv12CYli9fjgqLJ/kOZAIn3M95V1qcm3SnXmjt8ssvW13bnbPfYrvDeP5AdH1HQyEcDKcIfWwfYq3JCPC86a4xeTU5+CYlwj5yR71FcYlEXOxcmfE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Changes on this v4: o Really add Matthew Wilcox' preferred tribal knowledge docs o Add all the pending tags Changes on v3: o Tons of spell checks thanks to Miroslav Benes o Fixed a stupid bug where I was using the timeout without HZ as reported by Miroslav Benes o Enanced the tribal knowledge docs for the semaphore Vs mutex considerations folks might make as suggested by Matthew Wilcox o Added tags for patches Changes on v2: o split the series up into its own o adopt Peter's patch and extend it with some documentation as to why some folks stick to binary semaphores over mutexes o modify kmod.c to use the preferred declaration Luis Chamberlain (1): modules/kmod: replace implementation with a semaphore Peter Zijlstra (1): Change DEFINE_SEMAPHORE() to take a number argument arch/mips/cavium-octeon/setup.c | 2 +- arch/x86/kernel/cpu/intel.c | 2 +- drivers/firmware/efi/runtime-wrappers.c | 2 +- drivers/firmware/efi/vars.c | 2 +- drivers/macintosh/adb.c | 2 +- .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/platform/x86/intel/ifs/sysfs.c | 2 +- drivers/scsi/esas2r/esas2r_ioctl.c | 2 +- .../interface/vchiq_arm/vchiq_arm.c | 2 +- include/linux/semaphore.h | 10 +++++-- kernel/module/kmod.c | 26 +++++-------------- kernel/printk/printk.c | 2 +- net/rxrpc/call_object.c | 6 ++--- 13 files changed, 27 insertions(+), 35 deletions(-)