From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018AbYJ3Iof (ORCPT ); Thu, 30 Oct 2008 04:44:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752308AbYJ3Io1 (ORCPT ); Thu, 30 Oct 2008 04:44:27 -0400 Received: from casper.infradead.org ([85.118.1.10]:59983 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbYJ3Io0 (ORCPT ); Thu, 30 Oct 2008 04:44:26 -0400 Subject: Re: [patch 6/7] cpusets: per cpuset dirty ratios From: Peter Zijlstra To: David Rientjes Cc: Andrew Morton , Christoph Lameter , Nick Piggin , Paul Menage , Derek Fults , linux-kernel@vger.kernel.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 30 Oct 2008 09:44:45 +0100 Message-Id: <1225356285.7803.7.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2008-10-28 at 09:08 -0700, David Rientjes wrote: > +/* > + * Determine the dirty ratios for the currently active cpuset > + */ > +void cpuset_get_current_dirty_ratios(int *background, int *throttle) > +{ > + mutex_lock(&callback_mutex); > + task_lock(current); > + *background = task_cs(current)->dirty_background_ratio; > + *throttle = task_cs(current)->cpuset_dirty_ratio; > + task_unlock(current); > + mutex_unlock(&callback_mutex); > + > + if (*background == -1) > + *background = dirty_background_ratio; > + if (*throttle == -1) > + *throttle = vm_dirty_ratio; > +} That's rather an awful lot of locking to read just two integers.