Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4588455rdb; Fri, 29 Dec 2023 06:54:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQpye+t4/mbwaarwbKQz/y+BuLUfQzFSnbDTpXqWBpy94LGlznLkxdeiU45TUQPi8vEUM+ X-Received: by 2002:a17:902:dacf:b0:1d4:2ebf:66da with SMTP id q15-20020a170902dacf00b001d42ebf66damr13377139plx.13.1703861666493; Fri, 29 Dec 2023 06:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703861666; cv=none; d=google.com; s=arc-20160816; b=xd4rOkzYUQP65zNnGLRTYdd3ihS/lQ5KxQtmhtW6t8IjfBVglYKMUCDh6+dL3VP8XF bv62bTuFfJ8S3H0YH/UXQcvpbVdu361Dewh8WFrP0UuQVLxPqNP5nT7cbs/J5m0bKFCw 1TTYMw+cxVs6VjmcmSv/TSGw8f6WPrxAahicUT+iqJ2p/zxCkYWLdBlG7rwBMNy5BrOg 7hvF80NWd9bjcmTAd9P9mUOoJyBP5T3fRXtJGeKWYtkPLtIjiSg6z8j9BCYRkw3EheoH eWn+YMDz+j7pDIwr1TEmgG3y3nu+ZoE2tV+jNNaadl4cT9JcAwk4+KvF4czNUb8yODaK 5w4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Gro28Nl56FFyjLietpsJbcPJWPaVibydIB1vAeV8r98=; fh=n5JoPYa6TB1r81gvl+cLTCLYbT0lPx7tGyk7UN9SIyg=; b=0W1/jNIgSBP7XKUKCB483rAjqjIXvxT9UIpmAZiHL5ibURFuEfFaoALj7/yfpM/3/B YceHWKiFXEP0qEOMYjD+1KW0iMLSJMyuP/lNG0A+gbsGjmopDtLHy99CZYSBeL012R0u 74geWhyV6T8JpR1U8RDeB26UrIoOqJi47DFKLW+phhWnhB/EDH2E6yBK8Tb/fubQbCIJ r3vhj4YbWSnIpom5I73pFvEfsft3Y3m0BlfmgrzJ2q91RzrOWkRoi8iIvJ1Nu6110xSD Saphl20R1XgKg6fYr8AhMh6qjDIzZgqeH272gB74wgDaBI670DwW15Zz4M1HbNr9TwVR Yhrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LF1no2QX; spf=pass (google.com: domain of linux-kernel+bounces-13126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13126-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 l8-20020a170903244800b001d4043206aasi9432244pls.396.2023.12.29.06.54.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 06:54:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13126-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=LF1no2QX; spf=pass (google.com: domain of linux-kernel+bounces-13126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13126-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 CFCDE284736 for ; Fri, 29 Dec 2023 14:54:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD49111C9E; Fri, 29 Dec 2023 14:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LF1no2QX" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) (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 A948111C8B; Fri, 29 Dec 2023 14:54:16 +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=1703861658; x=1735397658; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LmCz43UOG0d1OrqtwkVYhlzS+7VmCSgdz5lsHb1OANY=; b=LF1no2QXFOzULbsBO6urV7VfERdVXga3DYmCRUjzAKwSf8sC/Q/qp6aS CnfWe+G4hErLsMMZV28wAUv1d5fFKz0eDrcnWIUusF/kNdlGcDW1hQqlo fgiLASbNzm72ZBkpIpy5vJQPhEZayouyV+wfjO8JVAAzduiLvSb9qq0/j m5f3FBX7VfA8vMKS8ldJS5snyJBmw2ghm7D+z1tXzQbg0sx/Jd4kPaEyF j/wnN/j2dQGVHoxv1qu77DgQjY41g+qcSiitiHhcFyi8/J23kz7T9qcTy 4OGN7wIl+PN9ixJlvi+QCWsOm+yY8krvMWHgYQAR0nydqNICAkLqh5toC Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10938"; a="376808414" X-IronPort-AV: E=Sophos;i="6.04,315,1695711600"; d="scan'208";a="376808414" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 06:54:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10938"; a="771978949" X-IronPort-AV: E=Sophos;i="6.04,315,1695711600"; d="scan'208";a="771978949" Received: from sgruszka-mobl.ger.corp.intel.com (HELO localhost) ([10.252.35.82]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 06:54:12 -0800 Date: Fri, 29 Dec 2023 04:08:24 +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=us-ascii Content-Disposition: inline In-Reply-To: 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? Regards Stanislaw