From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 7/7] FS-Cache: CacheFiles: A cache that backs onto a mounted filesystem Date: Thu, 20 Apr 2006 17:57:48 -0700 Message-ID: <20060420175748.64f592c0.akpm@osdl.org> References: <20060420165927.9968.33912.stgit@warthog.cambridge.redhat.com> <20060420165941.9968.13602.stgit@warthog.cambridge.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: aviro@redhat.com, sct@redhat.com, nfsv4@linux-nfs.org, steved@redhat.com, linux-kernel@vger.kernel.org, torvalds@osdl.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org Return-path: To: David Howells In-Reply-To: <20060420165941.9968.13602.stgit@warthog.cambridge.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfsv4-bounces@linux-nfs.org Errors-To: nfsv4-bounces@linux-nfs.org List-Id: linux-fsdevel.vger.kernel.org David Howells wrote: > > + /* let keventd have some air occasionally */ > + max--; > + if (max < 0 || need_resched()) { > + if (!list_empty(&object->read_list)) > + schedule_work(&object->read_work); > + _leave(" [maxed out]"); > + return; > + } That's perhaps not a terribly effective way of multiplexing keventd cycles. If someone has done a schedule_work(), that will stick an entry onto keventd's worklist, but it won't necessarily set need_resched(). We'd need to extend the workqueue API to be able to determine whether there's other work pending.