Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6389723rdb; Mon, 1 Jan 2024 23:10:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEewlBO7KzsxLB+S3SnfaYI6lVm7xeA81LDYlyxThu546IlBVDsGbLCI/NKRx5PJtG/P9e6 X-Received: by 2002:a17:903:244d:b0:1d4:bd0b:e38d with SMTP id l13-20020a170903244d00b001d4bd0be38dmr582113pls.79.1704179408113; Mon, 01 Jan 2024 23:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704179408; cv=none; d=google.com; s=arc-20160816; b=jpwGOaVACDxECB/rFQjahmYAnVdjCEtC1RFhrK+7cAncQ05QtgJRgNNKyxE2iC2gWI h5kx6hGiTdEuBS6OBOD+yj4IWkMUz4nm2vBnAd1ALv4AdO7JJYw+9nX9uBeypS8Bc6H/ Inpb5ujFSPCECyaYVPC/eEX/0a1Rf9rUAzhcgMLtN88Z8W+gpIU/DH6/fS4Idq7dVpCL IxcK8Lc2APxAUVEFONO5KkWpVhmqtj1cm/iQoC+0Q27iVKOkrCfoNOzZswUq55E70Osu a0PMnVzV1RcHG+wNMJkTCGAAkN88UQVM4Mg9eMGW6zaVIkll+FO/12h/VHHq3RBY7NuK XjIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QvZgXHcvfLGtG8FsJ/avrbOnUmz/fUEg8hJQVWD9i8E=; fh=n5JoPYa6TB1r81gvl+cLTCLYbT0lPx7tGyk7UN9SIyg=; b=Ls57en+XwNhmEWGgMqcGRHRDNOWjJcjt5JQxqzVnnvOC7gmFJ1Y2K+thMdmEtEoWu9 tJA5+L8Drf7uRv3YMl5R/jyUewAcIVA+tylqRez7lugeTxSwMIsUDaAUTor+V9OfxfO8 YiSGbv58VPkGy/L1n1k8pXmME9OBWHgG/z087d2QzWxbNYI8upG65r0RdC8LPyu/JgC6 Jtsg7ijCuXF+MN1owad0Ga7kLITfQOYZyUpYJcGrz121x8ZY1iSfoT9J2g06ZLSSdN9c NSWtqqYgL7J66qvgaAjTtv3IJDJdvzhWy1ZVzhxLox5bS9n/FCq2sbxjecAHXhYuWRHO tSGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BOVCy3nJ; spf=pass (google.com: domain of linux-kernel+bounces-14106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c23-20020a170902b69700b001d491907feasi7684669pls.487.2024.01.01.23.10.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 23:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BOVCy3nJ; spf=pass (google.com: domain of linux-kernel+bounces-14106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BF7A7282487 for ; Tue, 2 Jan 2024 07:10:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8A1520FA; Tue, 2 Jan 2024 07:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BOVCy3nJ" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D95920F9; Tue, 2 Jan 2024 07:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704179397; x=1735715397; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=dlIRxW0Xk4qGNOKcqqw/6GoKOIDxzXJKtBnvvXlwhBE=; b=BOVCy3nJHatSezuNIyqXnP+y9rA4AsA5DNxoUrbG43pF4gHHBLKFTx3B dyb/Q2RzFMAcZcZmM2L6nzarc6pnzzD6KjFU+qqfCuEhCydc/sOv3ulOc tlmaqdPQSiINAwzWt06vBiOU1qSo0LDMVUp6oeOCHcfrvTOeOrGx02Riz fLgzekmdNCkosZuTFzrbgVKVAUOxI0WD8alf/pgcfjWRddv22DLBZZD9M ivF+XGFhGdHOumknMZYU3SqbH6tBUbsCwoMM4Gxo5LsWNWzA+zcqV6d2n cpXhErlo/IgOlPAIkiZEbmtopoM3uEbYglUvJDVh4BlqChz8xLebDSqTO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="376337968" X-IronPort-AV: E=Sophos;i="6.04,324,1695711600"; d="scan'208";a="376337968" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2024 23:09:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10940"; a="729421414" X-IronPort-AV: E=Sophos;i="6.04,324,1695711600"; d="scan'208";a="729421414" Received: from oshragax-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.35.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2024 23:09:53 -0800 Date: Tue, 2 Jan 2024 08:09:51 +0100 From: Stanislaw Gruszka To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Greg KH , linux-pm@vger.kernel.org, Youngmin Nam , linux-kernel@vger.kernel.org, d7271.choe@samsung.com, janghyuck.kim@samsung.com, hyesoo.yu@samsung.com, Alan Stern , Ulf Hansson Subject: Re: [PATCH v1 2/3] async: Introduce async_schedule_dev_nocall() Message-ID: References: <5754861.DvuYhMxLoT@kreacher> <6019796.lOV4Wx5bFT@kreacher> <4874693.GXAFRqVoOG@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Dec 29, 2023 at 05:36:01PM +0100, Rafael J. Wysocki wrote: > On Fri, Dec 29, 2023 at 3:54 PM Stanislaw Gruszka > wrote: > > > > On Fri, Dec 29, 2023 at 02:37:36PM +0100, Rafael J. Wysocki wrote: > > > > > +bool async_schedule_dev_nocall(async_func_t func, struct device *dev) > > > > > +{ > > > > > + struct async_entry *entry; > > > > > + > > > > > + entry = kzalloc(sizeof(struct async_entry), GFP_KERNEL); > > > > > > > > Is GFP_KERNEL intended here ? > > > > > > Yes, it is. > > > > > > PM will be the only user of this, at least for now, and it all runs in > > > process context. > > > > > > > I think it's not safe since will > > > > be called from device_resume_noirq() . > > > > > > device_resume_noirq() runs in process context too. > > > > > > The name is somewhat confusing (sorry about that) and it means that > > > hardirq handlers (for the majority of IRQs) don't run in that resume > > > phase, but interrupts are enabled locally on all CPUs (this is > > > required for wakeup handling, among other things). > > > > Then my concern would be: if among devices with disabled IRQs are > > disk devices? Seems there are disk devices as well, and because > > GFP_KERNEL can start reclaiming memory by doing disk IO (write > > dirty pages for example), with disk driver interrupts disabled > > reclaiming process can not finish. > > > > I do not see how such possible infinite waiting for disk IO > > scenario is prevented here, did I miss something? > > Well, it is not a concern, because the suspend code already prevents > the mm subsystem from trying too hard to find free memory. See the > pm_restrict_gfp_mask() call in enter_state(). So that I missed :-) Thanks for explanations. Reviewed-by: Stanislaw Gruszka for the series.