Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5946654imd; Wed, 31 Oct 2018 04:41:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5dY2AsgZQHDQNN4eRBUSCRJMm2YdjXOzXdMkOgbkQn3unluQgUaRyXoNEplbc+zXMzGmjfn X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr2994102plk.16.1540986115087; Wed, 31 Oct 2018 04:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540986115; cv=none; d=google.com; s=arc-20160816; b=KPLiNEepztKtI4jVW4p/sT2uuqcwSAgvkvAeJ80fLVjU/M2XrBaLyK74XctFWAp+YB QtcHBdVmYSuNx7y5pDv1ktdn9eQEN7xYIb3keUmNIYI6oTTTkyQSMA8MVG8KKIftVCoS i/sZYuuBVMUENJituw1nVHwesjMmkf/MDOqfSJnRmf1Xeulrlq2m4/wZIvDh+lt3wdUP OMM1U1qJZ4mJOxOwIDlihTq0vXsXaWNOzbWdBXBDAXBuNtoj0a6bXVnZQfuEQ0E4mRc5 oApVCfWA1skM3IXS7uzliXEFWIKOBE53kH/bj+nuVqL/wt0o/agwZWyjs6HNhyEOQFzs vFBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MoThF4j3bazXRAL0wTjtTwjtJ17UW+87mvFfMr9vvnY=; b=h/LPYyI7XFHH0x/tGxaPN72nyL+o+9kX6LGdv9kMZinPeWbQdVTaL0AHPZ03XwyS2B UTLTpDxJrE8aB+XYGatoJ9NXJF3wnUn2CjDkKXVVyp8XSEHdeTClWzVjz0E6bcFQh1Io I+ru/sk00kpUvrmsqGKN40hkx8c+x8B3dxWTLlwlyqgjETW8MEeBjG8uj1Y54zfBPlRy JA7f8aWvn3JjIzjDq1E3WC50V8H1nk/h5DJdrMzxQcGAfFIQj5XUKxRLT9+1ROmboewV /CFNqTUY1JfBAJ9UokrqnWn2klUm3XguHbp2p5MRci6KpylhObKnvhzQmSWZnb+wG/HE I2dg== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59-v6si27218238plb.6.2018.10.31.04.41.39; Wed, 31 Oct 2018 04:41:55 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728705AbeJaUiv (ORCPT + 99 others); Wed, 31 Oct 2018 16:38:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:35064 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726025AbeJaUiv (ORCPT ); Wed, 31 Oct 2018 16:38:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DF316B080; Wed, 31 Oct 2018 11:41:08 +0000 (UTC) Date: Wed, 31 Oct 2018 12:41:07 +0100 From: Michal Hocko To: Miles Chen Cc: Andrew Morton , Joe Perches , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com Subject: Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc Message-ID: <20181031114107.GM32673@dhcp22.suse.cz> References: <1540790176-32339-1-git-send-email-miles.chen@mediatek.com> <20181029080708.GA32673@dhcp22.suse.cz> <20181029081706.GC32673@dhcp22.suse.cz> <1540862950.12374.40.camel@mtkswgap22> <20181030060601.GR32673@dhcp22.suse.cz> <1540882551.23278.12.camel@mtkswgap22> <20181030081537.GV32673@dhcp22.suse.cz> <1540975637.10275.10.camel@mtkswgap22> <20181031101501.GL32673@dhcp22.suse.cz> <1540981182.16084.1.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1540981182.16084.1.camel@mtkswgap22> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 31-10-18 18:19:42, Miles Chen wrote: > On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > > > [...] > > > > > It's a real problem when using page_owner. > > > > > I found this issue recently: I'm not able to read page_owner information > > > > > during a overnight test. (error: read failed: Out of memory). I replace > > > > > kmalloc() with vmalloc() and it worked well. > > > > > > > > Is this with trimming the allocation to a single page and doing shorter > > > > than requested reads? > > > > > > > > > I printed out the allocate count on my device the request count is <= > > > 4096. So I tested this scenario by trimming the count to from 4096 to > > > 1024 bytes and it works fine. > > > > > > count = count > 1024? 1024: count; > > > > > > It tested it on both 32bit and 64bit kernel. > > > > Are you saying that you see OOMs for 4k size? > > > yes, because kmalloc only use normal memor, not highmem + normal memory > I think that's why vmalloc() works. Can I see an OOM report please? I am especially interested that 1k doesn't cause the problem because there shouldn't be that much of a difference between the two. Larger allocations could be a result of memory fragmentation but 1k vs. 4k to make a difference really seems unexpected. -- Michal Hocko SUSE Labs