Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932563AbZJOPEN (ORCPT ); Thu, 15 Oct 2009 11:04:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762779AbZJOPEK (ORCPT ); Thu, 15 Oct 2009 11:04:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762778AbZJOPEH (ORCPT ); Thu, 15 Oct 2009 11:04:07 -0400 Message-ID: <4AD739A0.6010707@redhat.com> Date: Thu, 15 Oct 2009 11:02:56 -0400 From: Rik van Riel Organization: Red Hat, Inc User-Agent: Thunderbird 2.0.0.17 (X11/20080915) MIME-Version: 1.0 To: Hugh Dickins CC: Andrew Morton , Nigel Cunningham , KAMEZAWA Hiroyuki , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/9] swap_info: change to array of pointers References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 972 Lines: 23 Hugh Dickins wrote: > The swap_info_struct is only 76 or 104 bytes, but it does seem wrong > to reserve an array of about 30 of them in bss, when most people will > want only one. Change swap_info[] to an array of pointers. > > That does need a "type" field in the structure: pack it as a char with > next type and short prio (aha, char is unsigned by default on PowerPC). > Use the (admittedly peculiar) name "type" throughout for this index. > > /proc/swaps does not take swap_lock: I wouldn't want it to, but do take > care with barriers when adding a new item to the array (never removed). > > Signed-off-by: Hugh Dickins Acked-by: Rik van Riel -- All rights reversed. -- 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/