Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2199848pxb; Fri, 8 Oct 2021 03:03:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCPB/h8d5unE8JUbPued6sL0pBsEnQ38+01CvKrF6rSsMS+7KyyrrTQMjdGdPeShymoKe7 X-Received: by 2002:a17:907:3e8e:: with SMTP id hs14mr3063763ejc.35.1633687429158; Fri, 08 Oct 2021 03:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633687429; cv=none; d=google.com; s=arc-20160816; b=jsLKdoAomXD6HswvsM6oAheH2xCpoYjrL+hxeldj5GN2588wWlACGM5YChT/GVhKE4 VGbRhEi3voH3AUeZs2xLF3k02yg1Mc9XhopGSLtAYhEvzYGQb7gBqt0xvToB4nJI5DR+ vZw0KR0GwJbYtJXlxteBuk0kDKojKjB7tA4xUgMDZPAkKxTpOoj+VpBJcCR/niaObSuC /mzFN//81j5d1Nf5HP8JoH+9AR6KP2Lzu1fM/YuMU/7g0OhY9tZpvvE7ddl+M4HL1zez K4rgItIPo4sB+TpOlZttvtKHQ8UAEkBZ+D22EhNhR7Dna9vbitex99seJy+D4jUVXGi4 Bfzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hxT5G+zMvxcsW/4xhOGkDNxGrDzltTadHK8lfNclBnE=; b=ou5yOpclLchtAg9HbazEmOkadLgqE/s8WwGQq//i14jZOp0Djv57bZ7U3Xvq0eJOyO VWdKxo/C80X1ZNGkTR/bPkw3TOslXjAlVFyRIDvxBu+mxwrxXyMEvjZnYMpxXcNON6zy w18L8RFL0Uzq1RQui6PnNHDUiPTv8VlfgvFn+mWgTcSfvjsnZxpse9wGdhLZxTBIA8vQ A+wKIvrH0+IPUfPD8Ti8TEye9U6ZuRGVl61FV/QY8XH03lDfA79aPH4YSML9f5pwg6tg /97M64kHrjMy2cUOBF7msIx5klOvJJwhovN9e3PyaSPaUp9yNXMK4eD4+EwDD73aBgUu Qk0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HRZwV7Yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw1si4541097ejc.693.2021.10.08.03.03.19; Fri, 08 Oct 2021 03:03:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HRZwV7Yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S239578AbhJHKDV (ORCPT + 99 others); Fri, 8 Oct 2021 06:03:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:54344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239562AbhJHKDP (ORCPT ); Fri, 8 Oct 2021 06:03:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C98261027; Fri, 8 Oct 2021 10:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633687280; bh=Ytq4PQkSijuKbkv6j8ipOla0HKtwwWeiLQ9TknDWZ3w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HRZwV7YrVjH6N+Rki5pemLt1o0zDjj7Ot0u8Pm2Uo8bodpCE+kTJzutj1bb3CORyv tRQ/B5jO65vkY0r5IxZS3IMjYCgIEY0GfjlgUoOiUIcPn4ZQDsDpz7sxTO+wPzbank CtAgT9XJNKIm82a1Cs+Ig70Q1fIah3Ajx6ca/2r5ckrJqnLyFuarvXJnls8ZjF6/XM tzUv1P80DwVFYY77ShgR2Mt6CW9LN/ZGG8PKVau6xSpllT2k6kbZE7hKgmiQCJZsNq 9wTj9MvPIOT1X5NjtFKLO+epP2hx0UlBjIQn5eCvKux7fc+c6xmFOEiPHLn1ZbgbFG rJUidhfiH7UPA== Date: Fri, 8 Oct 2021 12:01:16 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Ian Pilcher Cc: pavel@ucw.cz, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, hch@infradead.org Subject: Re: [RESEND PATCH v5 2/2] leds: trigger: Add block device LED trigger Message-ID: <20211008120116.65aec469@thinkpad> In-Reply-To: <749c46a3-5d02-08ef-2a45-e785d65999c7@gmail.com> References: <20211004155546.1120869-1-arequipeno@gmail.com> <20211004155546.1120869-3-arequipeno@gmail.com> <20211005232738.371df6b8@thinkpad> <749c46a3-5d02-08ef-2a45-e785d65999c7@gmail.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Oct 2021 11:07:06 -0500 Ian Pilcher wrote: > I have feeling that per-LED work items are likely to cause contention > for the mutex, since they will probably all have the same (default) > interval and they will usually be set up at about the same time (i.e. > at system boot). Instead, I would propose to have a single work item > that is simply scheduled for the next time work is "needed" and then > checks all LEDs that are due at that time. What about creating one work struct for all different interval values? That way if the user never changes the interval, there will be only one work struct. I wonder if this can be done in a sensible (i.e. not overcomplicated code) way. Marek