Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp525970qtg; Wed, 5 Apr 2023 13:41:48 -0700 (PDT) X-Google-Smtp-Source: AKy350aFVKf1mz3hn2OK244tyPavyYUx7IftrJ4zTV/9IlKTQa7zMX+kZSuWsfeyWDArVWEBPLH/ X-Received: by 2002:a17:906:9398:b0:925:5eb8:92fd with SMTP id l24-20020a170906939800b009255eb892fdmr3852615ejx.14.1680727308539; Wed, 05 Apr 2023 13:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680727308; cv=none; d=google.com; s=arc-20160816; b=0rktjwQjDD5m0cp4AW3Bgc2Lk/k2ByN4inxyJ+OTdJOSlcv2QHgS0iu9kFCSsYQwNO KteHEvswpZAdWTqPGVMOELTPZDC4zdVzgTjaG6wb55SDI8XgFZIGMyrL+yV4xHkReDcT drgUTJLQWzKymCdhptFZNGHMcFGB07BTecEAyNvF0acQNd+TsL/MTyulCr61WVpVIlnb /oT5bdzwMrJ22eSeWBumV496AM78xvZ73ZyyqWeIbQbi4w6eD16pBQuvleAYKB+UQGMn 0H2LmoLdDLgAnpzFRECo5JwIz6f19eCZDVzwaRMKFXi6LErTskwFlTBvm7ECIdJBNw4+ AiPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CGo2H4hJTPWzaMtaGj7Lktm7eVtZzNMbcJEtAOG6yWg=; b=uKGJnBnA3JEFeEXWg1nn3FwBvZdFQW6TTZD+5+nZmA/blDyAAyG80wlUlrDJnuhZc7 Fz9gypjwBJJtXShnn+ssUJFcZe3XanMhCigW1EZ08g0PulfF7RkAVEx2ywL5baHuaE4t VdQv2VocGIINeyUz2WYVOn3gY5y05p/LR/I+S/xgcryicpdguFdS8sznLKxi1olDmSCR 7sFFjy3n4s63pWS3pVHTzWjSM0sRIns81jkPejQgEuGL8fP35P56TId2D2wIz4Iq4hN1 KR/BP+QdcT0b/yK2Lk+N/KtXit46h0011so9mRJwjaf4MWDnw5VFoMsv1bBIH1h9Hv77 neaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=UKqf4X5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a1709063b0e00b0093346a7c3c4si9196357ejf.641.2023.04.05.13.41.06; Wed, 05 Apr 2023 13:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=UKqf4X5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233076AbjDEUfW (ORCPT + 99 others); Wed, 5 Apr 2023 16:35:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233356AbjDEUfP (ORCPT ); Wed, 5 Apr 2023 16:35:15 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB6C6E8C; Wed, 5 Apr 2023 13:35:09 -0700 (PDT) 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=CGo2H4hJTPWzaMtaGj7Lktm7eVtZzNMbcJEtAOG6yWg=; b=UKqf4X5JbNA9vkONPxrzgBYW92 y09XAlnqRA7OvwgxflCIdnp0Um5FQLBJESmL9GajFwNqWNyPMsr3IH7WOA01XyOMbP4CP1z8jS3gz AoIFfDcZsDikZEyuzzGAs5QUAnyQnHqoorkaoXlh7AByLTwd+Tl1z/5xmLxuSwe1tdotRtxaIDwTm S5WOlqzZjRDkZPBG7HK9G4F/DbwDDRXcusDUt3P4eYN87AjkvhbHYj4R0LtL81zjvauwnezN+HlhK 4cwNNLBjtpvOE5WSXvIrFookL368xlZp4zhHqffGNtMeaRt5iCteXQXi8mm98bIUr3hlamASpWN8S aqZYwOfA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pk9qT-005dWW-2P; Wed, 05 Apr 2023 20:35:05 +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 v2 0/2] kmod: simplify with a semaphore Date: Wed, 5 Apr 2023 13:35:03 -0700 Message-Id: <20230405203505.1343562-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I split the semaphore simplification work out from my first patch series [0] because as although the changes came out of that effort, in the end this set of patches are slightly orthogonal to the goal behind that series and this ended up being mostly a cleanup with mild bike shedding exercise. As revealed from the first series, there is some tribal knowledge around why some binary semaphores are not just mutexes, so we cannot just convert them all to mutex. So I've extended Peter's patch with some of that tribal knowledge. Changes on this v2: o split this 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 This goes boot tested. [0] https://lkml.kernel.org/r/20230329053149.3976378-1-mcgrof@kernel.orgsemaphore Luis Chamberlain (1): modules/kmod: replace implementation with a sempahore 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 | 11 ++++++-- kernel/module/kmod.c | 26 +++++-------------- kernel/printk/printk.c | 2 +- net/rxrpc/call_object.c | 6 ++--- 13 files changed, 28 insertions(+), 35 deletions(-) -- 2.39.2