Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4360pxt; Wed, 4 Aug 2021 14:05:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRtzSZiHcfZsM48jRsk0rgc+GZgZw1FOV2QpCaAUiSf1aDacyFbDSw1b1v5Is44tz1Gj1E X-Received: by 2002:a5d:9599:: with SMTP id a25mr1103801ioo.86.1628111129821; Wed, 04 Aug 2021 14:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628111129; cv=none; d=google.com; s=arc-20160816; b=XclKkUjf66bUQgKKxI7+cuv1VfAyrn729Rb1jG94/gT5sYI7lmBkP8RTMjMzWRVJoF REIdYQ7gsKwpPc0hOP1TYUsnJDmbHr3FT+o0pmYWlviQc8ToJzVyx5Nsxxg7aTvJzK5n N51czE7ZXr5kKhvbexmnbihfecXcssC2kTtRfxEHO/KHhhIAHYZEYZ4fwxByJgP+Pf3s 6IqBizOXZBxJTMDSXXVnZ3j7UTQ5LPZQxTD+9k4LhP34JgYptm8qtkiMHATBJgDWZHzG ka/pwHhlV+j1U1S97dxPLSSEScl61iplZu8gbInU7GhOxasvoI61IVWvH9W/9MbNBRfA rxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Z6gttnkwOkWN9R1QFHO6uJWzSvbdetTjNrDss3Az1J4=; b=ZoC1LDWcNZ/L3ziwE4odzb7hNq1WMPljHLD2G5xl7BkZpjSyTqoqWJf/hQS/AND+Xy Tis+CCta0gqzCKIVYOV7TYZmkLoOGh0tLsfhJMV2AMiWRF6LxHns42FVtKxTFGb/bP5f L1GZtS254rGpHSG25mH62rbH/zzOwS0eB7snOsrztnolvH4jWYfsoJQrIaHMxrfyMvdv zGrq/N19K0eFrvvrbpl24wEWZNuH9ut3809ScnTYR7pw+B9m3gdP3egfxeX6CheC/aTB Wr1pSnyr3e+P6NwrqgGJsK5pRtJlk/3K6ER2Dv8e+oBDeORnyie0FcBb+EiwayYL356x 9Oog== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3769713jan.72.2021.08.04.14.05.18; Wed, 04 Aug 2021 14:05:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237361AbhHDSsH (ORCPT + 99 others); Wed, 4 Aug 2021 14:48:07 -0400 Received: from mga03.intel.com ([134.134.136.65]:61823 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240691AbhHDSrf (ORCPT ); Wed, 4 Aug 2021 14:47:35 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10066"; a="214017524" X-IronPort-AV: E=Sophos;i="5.84,295,1620716400"; d="scan'208";a="214017524" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 11:47:20 -0700 X-IronPort-AV: E=Sophos;i="5.84,295,1620716400"; d="scan'208";a="419538604" Received: from ssyedfar-mobl1.amr.corp.intel.com (HELO ldmartin-desk2) ([10.212.201.224]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 11:47:20 -0700 Date: Wed, 4 Aug 2021 11:47:20 -0700 From: Lucas De Marchi To: Luis Chamberlain Cc: linux-modules@vger.kernel.org, live-patching@vger.kernel.org, fstests@vger.kernel.org, linux-block@vger.kernel.org, hare@suse.de, dgilbert@interlog.com, jeyu@kernel.org, osandov@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libkmod-module: add support for a patient module removal option Message-ID: <20210804184720.z27u5aymcl5hzqgh@ldmartin-desk2> References: <20210803202417.462197-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 04, 2021 at 10:58:59AM -0700, Luis Chamberlain wrote: >On Tue, Aug 03, 2021 at 01:24:17PM -0700, Luis Chamberlain wrote: >> + diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c ><-- snip --> >> + ERR(mod->ctx, "%s refcnt is %ld waiting for it to become 0\n", mod->name, refcnt); > >OK after running many tests with this I think we need to just expand >this so that the error message only applies when -v is passed to >modprobe, otherwise we get the print message every time, and using >INFO() doesn't cut it, given the next priority level available to >the library is LOG_INFO (6) and when modprobe -v is passed we set the >log level to LOG_NOTICE (5), so we need a new NOTICE(). I'll send a v2 >with that included as a separate patch. Or maybe move the sleep to modprobe instead of doing it in the library? The sleep(1) seems like an arbitrary number to be introduced in the lib. Since kernfs is pollable, maybe we could rather introduce an API to return the pid in which the application has to wait for and then the application can use whatever it wants to poll, including controlling a timeout. I'm saying this because sleep(1) may be all fine for modprobe, but for other applications using libkmod it may not play well with their mainloops (and they may want to control both granularity of the sleep and a max timeout). thanks Lucas De Marchi > > Luis