Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965078AbVLHA4K (ORCPT ); Wed, 7 Dec 2005 19:56:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965079AbVLHA4J (ORCPT ); Wed, 7 Dec 2005 19:56:09 -0500 Received: from smtp.osdl.org ([65.172.181.4]:58025 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S965078AbVLHA4I (ORCPT ); Wed, 7 Dec 2005 19:56:08 -0500 Date: Wed, 7 Dec 2005 16:57:30 -0800 From: Andrew Morton To: Christoph Lameter Cc: linux-kernel@vger.kernel.org, lhms-devel@lists.sourceforge.net Subject: Re: [PATCH] swap migration: Fix lru drain Message-Id: <20051207165730.02dc591e.akpm@osdl.org> In-Reply-To: References: <20051207161319.6ada5c33.akpm@osdl.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; i386-vine-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 823 Lines: 29 Christoph Lameter wrote: > > +int schedule_on_each_cpu(void (*func) (void *info), void *info) > +{ > + int cpu; > + struct work_struct *work; > + > + work = kmalloc(NR_CPUS * sizeof(struct work_struct), GFP_KERNEL); > + > + if (!work) > + return 0; > + for_each_online_cpu(cpu) { > + INIT_WORK(work + cpu, func, info); > + __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu), > + work + cpu); > + } > + flush_workqueue(keventd_wq); > + kfree(work); > + return 1; > +} I'll change this to return 0 on success, or -ENOMEM. Bit more conventional, no? - 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/