Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6531067rdb; Tue, 2 Jan 2024 05:15:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNJn7aryg4Ju2KQPpA5XBAVgzpqxZQ+ULJkHqJ51ptbHIrwblYWvgyUC/UW9cX+ocb+OcF X-Received: by 2002:a50:d717:0:b0:552:fccb:c3b0 with SMTP id t23-20020a50d717000000b00552fccbc3b0mr17707724edi.25.1704201339136; Tue, 02 Jan 2024 05:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704201339; cv=none; d=google.com; s=arc-20160816; b=yoTMlYrm5X0FzGu28Z+lCXqpoJs12hGfNxpYnLUqHU/k85lVXswSbGxfC23OcqK91c HUinG/m5R8qrLs/mLw7gDi6/roZfQEzMi1p1XiuvF93aIemhBc7z3x8cSClsOv3O0e5g h9rXkrNG9VvhoI43Okk+6dcqUNdLwhGhcR5zz1QbDbm/uUvAG6hN6DQSlyDS3xvPxkXa FM2Arp0BnZVNoUfXeOzArOa0DGU1YLa+ikzA0zxRq1mw1QCTL4cCgQU6BtaIv9XvIiCe ATIcWNWE4Lg07hVaZwafetjG9o5e/e/RoqHn0T1tauhjuuD8BxrNawX5EQRnDGkHWPtd yMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=QReZnhHYlJFz2JmIbMJwCkkpVHlXNgx6xGbWBriQsbE=; fh=a9joolQSUO//2HtTji6PElbTysgVtDmQJESWkVR7nU4=; b=F/9PJQ/4m5NlyFlx6v1syu/W+mPLmr7YVPuAo0zO2fscz5FoeBhIfTEUUMn5PzAbx1 z1tJEZui3KVdqDCGOXA73ZU4rqMZHbPZchp1MX63OKCnPd1mdKuhJhNgixr/iU9vyK79 pjTXmZ+0MM9z1oYQs8vF6GP8UA4an5UuKNzH86pX/QGH0qvDDbfeOfK97ky/ZI7mAuno 5iZqcVj6LlMUljIJD6n1mGwzdrzD4Rad6wbWq75Gp55SaqhTj3y0b6GnRrNfcAKwppLb SJyJ9ffRtzvQnn4kMfmpcAqA4m5urzt2yMgBZ1w89U7Y6P0P23uNfnG97pLoV6OlGhIU Egqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u8-20020a50a408000000b00555a4c36976si4429398edb.500.2024.01.02.05.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 05:15:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id DF0CA1F22AE5 for ; Tue, 2 Jan 2024 13:15:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A47BCF9FC; Tue, 2 Jan 2024 13:15:31 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C77D1F9C4; Tue, 2 Jan 2024 13:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6dbb09061c0so928061a34.0; Tue, 02 Jan 2024 05:15:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704201329; x=1704806129; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QReZnhHYlJFz2JmIbMJwCkkpVHlXNgx6xGbWBriQsbE=; b=vp3oazsQ12Q24Re5BqLmzGKQ94XtT7A67zL+XqUdAEALHLfV9cYNrmmD7xIM+ODXC8 00tb2ggbZRTnwka16kavDzeU19FP/0nPUu5KzyePUhtFpLn4uc7keYA+w2/kBkG6MbdR vO6ExwPuTVSPEx9Mjh/f86hTTB0Gl4AEVcqcRAuMcXV3/RVNQBnlPUA1W1OHf92UUBc6 JykeBRKwUgvp3V2QUTePuZG28FrvU5Q67trBMmrAIJMpgCKhXQrIPiZiqgPItP0B515G x9zO3BfmA0KhHb8OnSyDoK0jY7eJi6UMRYsrxZfuGF9Eap7bY4tlw9MVwCPdDGlrjXnz Q7VA== X-Gm-Message-State: AOJu0YyfzjJWwFyrh+U3rlVBZ8HTCy+6cf4BO8VKJWt6w/cYPXRXz8BC 9cJjaYa3S4T4om4uzSGdpSDH+TjHEo/iXQpNdFE= X-Received: by 2002:a05:6820:1f90:b0:594:8f66:bca8 with SMTP id eq16-20020a0568201f9000b005948f66bca8mr18415342oob.0.1704201328730; Tue, 02 Jan 2024 05:15:28 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <5754861.DvuYhMxLoT@kreacher> <6019796.lOV4Wx5bFT@kreacher> <4874693.GXAFRqVoOG@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 2 Jan 2024 14:15:17 +0100 Message-ID: Subject: Re: [PATCH v1 2/3] async: Introduce async_schedule_dev_nocall() To: Stanislaw Gruszka Cc: "Rafael J. Wysocki" , "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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 2, 2024 at 8:10=E2=80=AFAM Stanislaw Gruszka wrote: > > On Fri, Dec 29, 2023 at 05:36:01PM +0100, Rafael J. Wysocki wrote: > > On Fri, Dec 29, 2023 at 3:54=E2=80=AFPM 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 devic= e *dev) > > > > > > +{ > > > > > > + struct async_entry *entry; > > > > > > + > > > > > > + entry =3D 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 resum= e > > > > 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 th= e series. Thank you!