From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbbGMJeO (ORCPT ); Mon, 13 Jul 2015 05:34:14 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35403 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbbGMJeK (ORCPT ); Mon, 13 Jul 2015 05:34:10 -0400 Date: Mon, 13 Jul 2015 18:34:42 +0900 From: Sergey Senozhatsky To: Christoph Hellwig Cc: Sergey Senozhatsky , Sergey Senozhatsky , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] mm/shrinker: make unregister_shrinker() less fragile Message-ID: <20150713092531.GA578@swordfish> References: <1436583115-6323-1-git-send-email-sergey.senozhatsky@gmail.com> <20150711100232.GA4607@infradead.org> <20150712024732.GA787@swordfish> <20150713063341.GA24167@infradead.org> <20150713065253.GA811@swordfish> <20150713090358.GA28901@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150713090358.GA28901@infradead.org> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (07/13/15 02:03), Christoph Hellwig wrote: > On Mon, Jul 13, 2015 at 03:52:53PM +0900, Sergey Senozhatsky wrote: > > Why? In some sense, shrinker callbacks are just a way to be nice. > > No one writes a driver just to be able to handle shrinker calls. An > > ability to react to those calls is just additional option; it does > > not directly affect or limit driver's functionality (at least, it > > really should not). > > No, they are not just nice. They are a fundamental part of memory > management and required to reclaim (often large) amounts of memory. Yes. 'Nice' used in a sense that drivers have logic to release the memory anyway; mm asks volunteers (the drivers that have registered shrinker callbacks) to release some spare/wasted/etc. when things are getting tough (the drivers are not aware of that in general). This is surely important to mm, not to the driver though -- it just agrees to be 'nice', but even not expected to release any memory at all (IOW, this is not a contract). -ss