From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934005AbbGUWIo (ORCPT ); Tue, 21 Jul 2015 18:08:44 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35159 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148AbbGUWIk convert rfc822-to-8bit (ORCPT ); Tue, 21 Jul 2015 18:08:40 -0400 Date: Wed, 22 Jul 2015 08:08:27 +1000 From: NeilBrown To: "Rafael J. Wysocki" Cc: Pali =?UTF-8?B?Um9ow6Fy?= , Alasdair Kergon , Mike Snitzer , Neil Brown , Len Brown , Pavel Machek , dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 1/3] PM suspend/hibernate: Call notifier after freezing processes Message-ID: <20150722080827.5adcf5f1@noble> In-Reply-To: <1715416.hWBvT0iLvO@vostro.rjw.lan> References: <1428254419-7334-1-git-send-email-pali.rohar@gmail.com> <3179448.TScsKEAuyR@vostro.rjw.lan> <20150720073226.GB25910@pali> <1715416.hWBvT0iLvO@vostro.rjw.lan> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Jul 2015 23:46:32 +0200 "Rafael J. Wysocki" wrote: > On Monday, July 20, 2015 09:32:26 AM Pali Rohár wrote: > > On Saturday 18 July 2015 01:27:15 Rafael J. Wysocki wrote: > > > On Thursday, July 16, 2015 09:33:02 AM Pali Rohár wrote: > > > > On Thursday 16 July 2015 03:02:03 Rafael J. Wysocki wrote: > > > > > Also, if you're adding AFTER_FREEZE, it would be good to add BEFORE_THAW too > > > > > for symmetry. > > > > > > > > > > > > > But there is no use case for BEFORE_THAW. At least it is not needed for now. > > > > > > For your use case, a single function pointer would be sufficient too. > > > > > > > What do you mean by single function pointer? kernel/power is part of > > kernel image and dm-crypt is external kernel module. > > Well, if there is a function pointer in the core suspend code initially set to > NULL and exported to modules such that the dm-crypt code can set it to > something else, that should be sufficient, shouldn't it? As long as the dm-crypt module is never unloaded. And as long as no other module could very possible want functionality like this. Ever. If a module wants to be notified - the providing a notifier chain really seems like the right thing to do... NeilBrown > > So if you're adding new PM notifier events, that's already more than *you* need. > > Anyway, I guess the "post freeze" new one should be enough for now, but please > change the name to POST_FREEZE. > > Also I think we don't need separate "post freeze" events for suspend and > hibernation. > > Thanks, > Rafael