Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 6 Jan 2002 18:20:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 6 Jan 2002 18:19:59 -0500 Received: from cmailg4.svr.pol.co.uk ([195.92.195.174]:13914 "EHLO cmailg4.svr.pol.co.uk") by vger.kernel.org with ESMTP id ; Sun, 6 Jan 2002 18:19:45 -0500 Posted-Date: Sun, 6 Jan 2002 23:19:35 GMT Date: Sun, 6 Jan 2002 23:19:32 +0000 (GMT) From: Riley Williams Reply-To: Riley Williams To: Steve Wright cc: Linux Kernel Subject: Re: /proc/kmsg memory usage ? In-Reply-To: <02010416152401.00607@box.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve. > I am hoping someone here can point me towards the right > documentation / web page. > > I want to find out what happens to kernel messages in /proc/kmsg if > they are not read. > > Specifically, > Are they cleared after a specified amount of time (eg every 24 hours) ? > Are they cleared when they occupy a maximum size ? > If they are not read will the memory they occupy grow indefinately ? Essentially, they are cleared by default, due to the way they are implemented. The implementation consists of a ring buffer X bytes in size (the exact size depends on whic h architecture you're talking about). When the kernel is booted, the READ and WRITE pointers both point to the very first byte of the buffer. As messages are written into the buffer, they are written to the byte the WRITE pointer points to and that pointer is incremented for each byte written. Likewise with the read pointer, as bytes are read, it is incremented for each byte. The way a ring buffer works is that when the last byte in the buffer is used, the next byte to be used is the first one in the buffer. When the write pointer catches up with the read pointer, a buffer full condition is declared, but in the case of the kmsg buffer, this is dealt with by incrementing the READ pointer to the next NEWLINE character and freeing up the space in between. Best wishes from Riley. - 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/