From mboxrd@z Thu Jan 1 00:00:00 1970 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 29CF3C28D13 for ; Fri, 19 Aug 2022 23:05:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A42B8D0001; Fri, 19 Aug 2022 19:05:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82BB86B0075; Fri, 19 Aug 2022 19:05:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CCE68D0001; Fri, 19 Aug 2022 19:05:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 56B106B0074 for ; Fri, 19 Aug 2022 19:05:06 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1B4CE8031C for ; Fri, 19 Aug 2022 23:05:06 +0000 (UTC) X-FDA: 79817874612.07.6A7FD18 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id AB26CC0019 for ; Fri, 19 Aug 2022 23:05:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B7FCD61840; Fri, 19 Aug 2022 23:05:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A2A3C433B5; Fri, 19 Aug 2022 23:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660950304; bh=AZL0aSK7Iwf8Lk3JbnO6+H4YnWrrROAZWLMPh5Hm/5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZEKPV7mXRXYXHkT9CiejWuOCLLKp1h4nrKuXEyG9QfdzXQt68jqr2caGZI6WJkxYe gweaJaYGJxoiXNQ/zrX2WoI6U/KcRK9bU+n+c+FdQ4N7q8ZT6XDaK3aTCC13thOEMd qEuLyoVfoMM/6ghLjJlAtzmjZsmiH6Sg8by3zhFwGPnf/q/S50i5qDAHn5RPrYs9rS uwy8ylu3fm6KGo4LvMOLItxclMgd1WZK5VYUVUoToWPjzRve8+/WhFwaWAfZ2iS6Re hIgFMFZzjaa01DTi4ploFElFllt+QnNoPtJjTRDMH3nmrZZTYEgwor0R5msDqt+53d kR10UUa28lbqA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , gregkh@linuxfoundation.org, badari.pulavarty@intel.com, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mm/damon/dbgfs: avoid duplicate context directory creation Date: Fri, 19 Aug 2022 23:05:01 +0000 Message-Id: <20220819230501.16830-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819154451.9f424d9d563969d9cc6437f7@linux-foundation.org> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660950305; h=from:from: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:in-reply-to:references:references:dkim-signature; bh=KsDqJVEEPO6kthWG51T2xhCpGOZ4WMHMZsbXXsfGnA0=; b=yi7foMMEd9SrnV2mcc0YbNntbkUR7HDJ/P2jmqqVBQD8cCxxgtrQv4M2LE7YzYg+L5Nloc +NzFRWqzCkF/Jz9dVoZh9Sg7jBPNwr4lJ2l9CeQreL9Ys8r1YGLkRwcB95wMLxd1iDLTVL BTIorlcvs680vkt7oVAPdDN02/+YJgA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZEKPV7mX; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660950305; a=rsa-sha256; cv=none; b=cfueJ93ZIYit3US3B712BDkFAjFLKLPBAXqNec9gHira9fK04PiVeLX49VCr0J5b0DxIE0 BMlMb0dZOoqhZLZ662erdURup5kPw8dshdByxGGEgpSWct30FYfHlMOPa8qX/0Yz4r91kP OGxwSOB26qSIcXcaRcqQOH28/Jxg5hE= X-Stat-Signature: ft54htjjrwy8kdgny7ruy6hf1c7shmuz X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: AB26CC0019 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZEKPV7mX; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspam-User: X-HE-Tag: 1660950305-747773 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: On Fri, 19 Aug 2022 15:44:51 -0700 Andrew Morton wrote: > On Fri, 19 Aug 2022 21:16:31 +0000 SeongJae Park wrote: > > > > It would be simpler (and less racy) to check the debugfs_create_dir() > > > return value for IS_ERR()? > > > > I was merely following Greg's previous advice for ignoring the return value[1] > > of the function, but I might misunderstanding his intention, so CC-ing Greg. > > Greg, may I ask your opinion? > > > > [1] https://lore.kernel.org/linux-mm/YB1kZaD%2F7omxXztF@kroah.com/ > > Thing is, the correct functioning of the debugfs interfaces is utterly > critical to damon. And that's apart from these memory leak and > oops-we-killed-damon issues. > > So damon simply cannot ignore the state of its debugfs interfaces and > keep going along - because if something goes wrong at the debugfs > layer, damon is dead and useless and the machine needs a reboot. > > Perhaps this means that damon should not be using debugfs for its > interfaces at all. Or it means that the debugfs interfaces are > misdesigned. I go with the latter, which, alas, also affirms the > former. I'd save my word about the latter, but agreed on the former. Fortunately we already have an alternative (DAMON sysfs interface), and the debugfs interface deprecation plan was announced for a while ago. Not sure if the deprecation will be well as hoped, though. > > From a quick scan it appears that a significant minority (20%?) of > drivers are checking the debugfs_create_dir() return value. Maybe partly owing to Greg's previous efforts for removing the checks[1,2]? Anyway, based on the previous discussions, I'd expect Greg might prefer not checking the return code. Anyway, waiting for his opinion. [1] https://lore.kernel.org/all/20190122152151.16139-14-gregkh@linuxfoundation.org/ [2] https://lore.kernel.org/lkml/20190122152151.16139-7-gregkh@linuxfoundation.org/ Thanks, SJ