From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933665AbcFTU3m (ORCPT ); Mon, 20 Jun 2016 16:29:42 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:32852 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbcFTU30 (ORCPT ); Mon, 20 Jun 2016 16:29:26 -0400 Date: Mon, 20 Jun 2016 16:29:03 -0400 From: Tejun Heo To: Petr Mladek Cc: Andrew Morton , Oleg Nesterov , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 11/12] kthread: Allow to modify delayed kthread work Message-ID: <20160620202903.GC3262@mtj.duckdns.org> References: <1466075851-24013-1-git-send-email-pmladek@suse.com> <1466075851-24013-12-git-send-email-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466075851-24013-12-git-send-email-pmladek@suse.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2016 at 01:17:30PM +0200, Petr Mladek wrote: > There are situations when we need to modify the delay of a delayed kthread > work. For example, when the work depends on an event and the initial delay > means a timeout. Then we want to queue the work immediately when the event > happens. > > This patch implements kthread_mod_delayed_work() as inspired workqueues. > It cancels the timer, removes the work from any worker list and queues it > again with the given timeout. > > A very special case is when the work is being canceled at the same time. > It might happen because of the regular kthread_cancel_delayed_work_sync() > or by another kthread_mod_delayed_work(). In this case, we do nothing and > let the other operation win. This should not normally happen as the caller > is supposed to synchronize these operations a reasonable way. > > Signed-off-by: Petr Mladek Acked-by: Tejun Heo Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH v9 11/12] kthread: Allow to modify delayed kthread work Date: Mon, 20 Jun 2016 16:29:03 -0400 Message-ID: <20160620202903.GC3262@mtj.duckdns.org> References: <1466075851-24013-1-git-send-email-pmladek@suse.com> <1466075851-24013-12-git-send-email-pmladek@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1466075851-24013-12-git-send-email-pmladek@suse.com> Sender: owner-linux-mm@kvack.org To: Petr Mladek Cc: Andrew Morton , Oleg Nesterov , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-api@vger.kernel.org On Thu, Jun 16, 2016 at 01:17:30PM +0200, Petr Mladek wrote: > There are situations when we need to modify the delay of a delayed kthread > work. For example, when the work depends on an event and the initial delay > means a timeout. Then we want to queue the work immediately when the event > happens. > > This patch implements kthread_mod_delayed_work() as inspired workqueues. > It cancels the timer, removes the work from any worker list and queues it > again with the given timeout. > > A very special case is when the work is being canceled at the same time. > It might happen because of the regular kthread_cancel_delayed_work_sync() > or by another kthread_mod_delayed_work(). In this case, we do nothing and > let the other operation win. This should not normally happen as the caller > is supposed to synchronize these operations a reasonable way. > > Signed-off-by: Petr Mladek Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org