Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752523AbbH2Mv5 (ORCPT ); Sat, 29 Aug 2015 08:51:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39195 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbbH2Mv4 (ORCPT ); Sat, 29 Aug 2015 08:51:56 -0400 Date: Sat, 29 Aug 2015 14:49:21 +0200 From: Oleg Nesterov To: Eric Dumazet Cc: Al Viro , Linus Torvalds , "linux-kernel@vger.kernel.org" , Andrew Morton , Thomas Gleixner , Ingo Molnar , Maciej =?utf-8?Q?=C5=BBenczykowski?= Subject: Re: [PATCH] task_work: remove fifo ordering guarantee Message-ID: <20150829124921.GA14973@redhat.com> References: <1440816150.8932.123.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440816150.8932.123.camel@edumazet-glaptop2.roam.corp.google.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 39 On 08/28, Eric Dumazet wrote: > > From: Eric Dumazet > > In commit f341861fb0b ("task_work: add a scheduling point in > task_work_run()") I fixed a latency problem adding a cond_resched() > call. > > Later, commit ac3d0da8f329 added yet another loop to reverse a list, > bringing back the latency spike : > > I've seen in some cases this loop taking 275 ms, if for example a > process with 2,000,000 files is killed. > > We could add yet another cond_resched() in the reverse loop, Can't we do this? > or we > can simply remove the reversal, as I do not think anything > would depend on order of task_work_add() submitted works. Personally I'd prefer to keep the fifo ordering. It just makes more sense imho. Even if currently nobody depends on it (although I am not sure about out-of-tree modules, say, systemtap). Let's look keyctl_session_to_parent(). It does task_work_cancel() but only because we can not trust user-space. Otherwise we could remove it and just do task_work_add(), but this needs fifo. Fifo just looks more sane to me. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/