Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1386592imm; Sun, 27 May 2018 05:48:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJlNRyVD1kPj1mr5CESR2zNgGx/k9Vz4lyqFQfz//QJ1gFZY/jeL+rGltCwc53PQqv7sHXt X-Received: by 2002:a62:ecdb:: with SMTP id e88-v6mr2064584pfm.16.1527425290806; Sun, 27 May 2018 05:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527425290; cv=none; d=google.com; s=arc-20160816; b=kOndXPxtcieILoYrqKPmwAoI5fbi8hg/kh0IeZ+muGWM2KjQROfRAJxh0t8rW8d/jx DIxx690bxphJZa7k44lSw5AhnTUVZYQin8m1pwrEUR7F4Rj0pLZCqwJXjidaKpdwJU3G 8DbQ4ag4xN+JPmnQwYCSxG8XHzVqFZvbUYckB4yp96N/CaGDBklZ7dGDezy9cxspCuR7 oG6PBEJcBLWHtlh7e90W/m74FF5fTWWcpKTBYn1LViRyB1YIBavFm7q92ASWC5a7sdBS XXDchGVMbK0XZYHdmeDIHwgH0aYH/R7LtCkPTK74QbvmLZ5b1SB2XiJUfWG3Rb6YzNQS c6yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=4PlF2G8IHgiRr+y5TlAFgRcHVBRkfT0dBsQRoUEcOss=; b=mzhgQDNsEXaMnaKfQoyvxmnizTfo7xvVM2MDgMPJ/7QMrDTLZkfCyxIvlck3vUZfcs SVAUTRkLgYs3EEgSoIg4D0ZSypuG2p/FbOhs3pm413emGjsQvQOPR4kHj+UmC4xdGklF Bg87NWEwSRKF1ugjNyrqIVVcZ5ivhBwqBfwZfLd2/6yRthn0S/NeFzx/ECXlunRSDZbo v2DnlNTrsWwBgpi0Db7rwAixiz9cO1xa7bezCGPVQZ132uz6vFcAmgG1ax9Tmv+AQFCN wjejFd8bDvvwIrcgBZOS6wSu8DF6yHLv3Rmt9oMhNAn35N8YThe9uuV539xMsfdZwh1i fF1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9-v6si27024516plr.477.2018.05.27.05.47.44; Sun, 27 May 2018 05:48:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032629AbeE0Mre (ORCPT + 99 others); Sun, 27 May 2018 08:47:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54466 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936343AbeE0Mrb (ORCPT ); Sun, 27 May 2018 08:47:31 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4RChj7a026292 for ; Sun, 27 May 2018 08:47:31 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2j7mybv62b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 27 May 2018 08:47:30 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 27 May 2018 13:47:29 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 27 May 2018 13:47:24 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4RClOoM17039476; Sun, 27 May 2018 12:47:24 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 54C47AE045; Sun, 27 May 2018 13:36:33 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFB72AE051; Sun, 27 May 2018 13:36:32 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.106]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 27 May 2018 13:36:32 +0100 (BST) Date: Sun, 27 May 2018 15:47:22 +0300 From: Mike Rapoport To: Michal Hocko Cc: Dave Chinner , Jonathan Corbet , LKML , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, "Darrick J. Wong" , David Sterba Subject: Re: [PATCH] doc: document scope NOFS, NOIO APIs References: <20180424183536.GF30619@thunk.org> <20180524114341.1101-1-mhocko@kernel.org> <20180524221715.GY10363@dastard> <20180525081624.GH11881@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180525081624.GH11881@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18052712-0040-0000-0000-0000043E481E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052712-0041-0000-0000-000026438EC2 Message-Id: <20180527124721.GA4522@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-27_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805270160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 10:16:24AM +0200, Michal Hocko wrote: > On Fri 25-05-18 08:17:15, Dave Chinner wrote: > > On Thu, May 24, 2018 at 01:43:41PM +0200, Michal Hocko wrote: > [...] > > > +FS/IO code then simply calls the appropriate save function right at the > > > +layer where a lock taken from the reclaim context (e.g. shrinker) and > > > +the corresponding restore function when the lock is released. All that > > > +ideally along with an explanation what is the reclaim context for easier > > > +maintenance. > > > > This paragraph doesn't make much sense to me. I think you're trying > > to say that we should call the appropriate save function "before > > locks are taken that a reclaim context (e.g a shrinker) might > > require access to." > > > > I think it's also worth making a note about recursive/nested > > save/restore stacking, because it's not clear from this description > > that this is allowed and will work as long as inner save/restore > > calls are fully nested inside outer save/restore contexts. > > Any better? > > -FS/IO code then simply calls the appropriate save function right at the > -layer where a lock taken from the reclaim context (e.g. shrinker) and > -the corresponding restore function when the lock is released. All that > -ideally along with an explanation what is the reclaim context for easier > -maintenance. > +FS/IO code then simply calls the appropriate save function before any > +lock shared with the reclaim context is taken. The corresponding > +restore function when the lock is released. All that ideally along with Maybe: "The corresponding restore function is called when the lock is released" > +an explanation what is the reclaim context for easier maintenance. > + > +Please note that the proper pairing of save/restore function allows nesting > +so memalloc_noio_save is safe to be called from an existing NOIO or NOFS scope. so it is safe to call memalloc_noio_save from an existing NOIO or NOFS scope > What about __vmalloc(GFP_NOFS) > ============================== > -- > Michal Hocko > SUSE Labs > -- Sincerely yours, Mike.