From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by kanga.kvack.org (Postfix) with ESMTP id AB1BF6B0032 for ; Fri, 17 Apr 2015 13:14:24 -0400 (EDT) Received: by obbeb7 with SMTP id eb7so75802278obb.3 for ; Fri, 17 Apr 2015 10:14:24 -0700 (PDT) Received: from aserp1040.oracle.com (aserp1040.oracle.com. [141.146.126.69]) by mx.google.com with ESMTPS id e7si8381716obf.19.2015.04.17.10.14.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 10:14:24 -0700 (PDT) Message-ID: <55313F6A.4010506@oracle.com> Date: Fri, 17 Apr 2015 10:14:18 -0700 From: Mike Kravetz MIME-Version: 1.0 Subject: Re: [RFC PATCH 3/4] hugetlbfs: add hugetlbfs_fallocate() References: <00fc01d078e3$63428ec0$29c7ac40$@alibaba-inc.com> <010201d078e4$97cf82a0$c76e87e0$@alibaba-inc.com> In-Reply-To: <010201d078e4$97cf82a0$c76e87e0$@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Hillf Danton , Dave Hansen Cc: linux-kernel , linux-mm@kvack.org On 04/17/2015 01:00 AM, Hillf Danton wrote: >> + clear_huge_page(page, addr, pages_per_huge_page(h)); >> + __SetPageUptodate(page); >> + error = huge_add_to_page_cache(page, mapping, index); >> + if (error) { >> + put_page(page); >> + /* Keep going if we see an -EEXIST */ >> + if (error != -EEXIST) >> + goto out; /* FIXME, need to free? */ >> + } >> + >> + /* >> + * page_put due to reference from alloc_huge_page() >> + * unlock_page because locked by add_to_page_cache() >> + */ >> + put_page(page); > > Still needed if EEXIST? Nope. Good catch. I'll fix this in the next version. -- Mike Kravetz -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933897AbbDQRO0 (ORCPT ); Fri, 17 Apr 2015 13:14:26 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:41326 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933450AbbDQROZ (ORCPT ); Fri, 17 Apr 2015 13:14:25 -0400 Message-ID: <55313F6A.4010506@oracle.com> Date: Fri, 17 Apr 2015 10:14:18 -0700 From: Mike Kravetz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Hillf Danton , Dave Hansen CC: linux-kernel , linux-mm@kvack.org Subject: Re: [RFC PATCH 3/4] hugetlbfs: add hugetlbfs_fallocate() References: <00fc01d078e3$63428ec0$29c7ac40$@alibaba-inc.com> <010201d078e4$97cf82a0$c76e87e0$@alibaba-inc.com> In-Reply-To: <010201d078e4$97cf82a0$c76e87e0$@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/17/2015 01:00 AM, Hillf Danton wrote: >> + clear_huge_page(page, addr, pages_per_huge_page(h)); >> + __SetPageUptodate(page); >> + error = huge_add_to_page_cache(page, mapping, index); >> + if (error) { >> + put_page(page); >> + /* Keep going if we see an -EEXIST */ >> + if (error != -EEXIST) >> + goto out; /* FIXME, need to free? */ >> + } >> + >> + /* >> + * page_put due to reference from alloc_huge_page() >> + * unlock_page because locked by add_to_page_cache() >> + */ >> + put_page(page); > > Still needed if EEXIST? Nope. Good catch. I'll fix this in the next version. -- Mike Kravetz