From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by kanga.kvack.org (Postfix) with ESMTP id 5D82C6B0031 for ; Mon, 23 Jun 2014 21:12:55 -0400 (EDT) Received: by mail-pd0-f182.google.com with SMTP id y13so6310122pdi.13 for ; Mon, 23 Jun 2014 18:12:54 -0700 (PDT) Received: from lgemrelse7q.lge.com (LGEMRELSE7Q.lge.com. [156.147.1.151]) by mx.google.com with ESMTP id to10si24021905pbc.228.2014.06.23.18.12.53 for ; Mon, 23 Jun 2014 18:12:54 -0700 (PDT) Message-ID: <53A8D092.4040801@lge.com> Date: Tue, 24 Jun 2014 10:12:50 +0900 From: Gioh Kim MIME-Version: 1.0 Subject: [RFC] CMA page migration failure due to buffers on bh_lru Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?EUC-KR?B?wMywx8ij?= Hello, I am trying to apply CMA feature for my platform. My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). Now my platform can use CMA area effectively. But I have many failures to allocate memory from CMA area. I found the same situation to Laura Abbott's patch descrbing, https://lkml.org/lkml/2012/8/31/313, that releases buffer-heads attached at CPU's LRU list. If Joonsoo's patch is applied and/or CMA feature is applied more and more, buffer-heads problem is going to be serious definitely. Please look into the Laura's patch again. I think it must be applied with Joonsoo's patch. -- 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: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by kanga.kvack.org (Postfix) with ESMTP id A841F6B008C for ; Thu, 26 Jun 2014 11:58:04 -0400 (EDT) Received: by mail-we0-f181.google.com with SMTP id q59so3996979wes.40 for ; Thu, 26 Jun 2014 08:58:02 -0700 (PDT) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [2a00:1450:400c:c00::22f]) by mx.google.com with ESMTPS id hh4si13135219wib.9.2014.06.26.08.57.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 08:57:52 -0700 (PDT) Received: by mail-wg0-f47.google.com with SMTP id k14so3899607wgh.18 for ; Thu, 26 Jun 2014 08:57:50 -0700 (PDT) From: Michal Nazarewicz Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru In-Reply-To: <53A8D092.4040801@lge.com> References: <53A8D092.4040801@lge.com> Date: Thu, 26 Jun 2014 17:57:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Gioh Kim , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?utf-8?B?7J206rG07Zi4?= On Tue, Jun 24 2014, Gioh Kim wrote: > Hello, > > I am trying to apply CMA feature for my platform. > My kernel version, 3.10.x, is not allocating memory from CMA area so that= I applied > a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). > Now my platform can use CMA area effectively. > > But I have many failures to allocate memory from CMA area. > I found the same situation to Laura Abbott's patch descrbing, > https://lkml.org/lkml/2012/8/31/313, > that releases buffer-heads attached at CPU's LRU list. > > If Joonsoo's patch is applied and/or CMA feature is applied more and more, > buffer-heads problem is going to be serious definitely. > > Please look into the Laura's patch again. > I think it must be applied with Joonsoo's patch. Just to make sure I understood you correctly, you're saying Laura's patch at fixes your issue? --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo-- -- 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: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by kanga.kvack.org (Postfix) with ESMTP id 4CAA26B00B4 for ; Thu, 26 Jun 2014 19:23:59 -0400 (EDT) Received: by mail-pa0-f48.google.com with SMTP id et14so3783828pad.21 for ; Thu, 26 Jun 2014 16:23:58 -0700 (PDT) Received: from lgeamrelo04.lge.com (lgeamrelo04.lge.com. [156.147.1.127]) by mx.google.com with ESMTP id ra4si11811831pbb.78.2014.06.26.16.23.57 for ; Thu, 26 Jun 2014 16:23:58 -0700 (PDT) Message-ID: <53ACAB82.6020201@lge.com> Date: Fri, 27 Jun 2014 08:23:46 +0900 From: Gioh Kim MIME-Version: 1.0 Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= 2014-06-27 i??i ? 12:57, Michal Nazarewicz i?' e,?: > On Tue, Jun 24 2014, Gioh Kim wrote: >> Hello, >> >> I am trying to apply CMA feature for my platform. >> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >> Now my platform can use CMA area effectively. >> >> But I have many failures to allocate memory from CMA area. >> I found the same situation to Laura Abbott's patch descrbing, >> https://lkml.org/lkml/2012/8/31/313, >> that releases buffer-heads attached at CPU's LRU list. >> >> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >> buffer-heads problem is going to be serious definitely. >> >> Please look into the Laura's patch again. >> I think it must be applied with Joonsoo's patch. > > Just to make sure I understood you correctly, you're saying Laura's > patch at fixes your issue? > Yes, it is. -- 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: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by kanga.kvack.org (Postfix) with ESMTP id DD49B6B0039 for ; Sun, 29 Jun 2014 15:49:39 -0400 (EDT) Received: by mail-pd0-f181.google.com with SMTP id v10so7051594pde.12 for ; Sun, 29 Jun 2014 12:49:39 -0700 (PDT) Received: from smtp.codeaurora.org (smtp.codeaurora.org. [198.145.11.231]) by mx.google.com with ESMTPS id rw8si20664321pab.167.2014.06.29.12.49.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jun 2014 12:49:38 -0700 (PDT) Message-ID: <53B06DD0.8030106@codeaurora.org> Date: Sun, 29 Jun 2014 12:49:36 -0700 From: Laura Abbott MIME-Version: 1.0 Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> In-Reply-To: <53ACAB82.6020201@lge.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins (cc-ing Hugh since he had comments on the patch before) On 6/26/2014 4:23 PM, Gioh Kim wrote: > > > 2014-06-27 i??i ? 12:57, Michal Nazarewicz i?' e,?: >> On Tue, Jun 24 2014, Gioh Kim wrote: >>> Hello, >>> >>> I am trying to apply CMA feature for my platform. >>> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >>> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >>> Now my platform can use CMA area effectively. >>> >>> But I have many failures to allocate memory from CMA area. >>> I found the same situation to Laura Abbott's patch descrbing, >>> https://lkml.org/lkml/2012/8/31/313, >>> that releases buffer-heads attached at CPU's LRU list. >>> >>> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >>> buffer-heads problem is going to be serious definitely. >>> >>> Please look into the Laura's patch again. >>> I think it must be applied with Joonsoo's patch. >> >> Just to make sure I understood you correctly, you're saying Laura's >> patch at fixes your issue? >> > > Yes, it is. I submitted this before and it was suggested that this was more related to filesystems http://marc.info/?l=linaro-mm-sig&m=137645770708817&w=2 I never saw more discussion and pushed this into the 'CMA hacks' pile. So far we've been keeping the patch out of tree and it's useful to know that others have found the same problem. I'm willing to resubmit the patch for further discussion. Thanks, Laura -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- 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: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by kanga.kvack.org (Postfix) with ESMTP id 2E1336B0035 for ; Mon, 30 Jun 2014 21:07:10 -0400 (EDT) Received: by mail-pa0-f54.google.com with SMTP id et14so9650818pad.27 for ; Mon, 30 Jun 2014 18:07:09 -0700 (PDT) Received: from lgeamrelo02.lge.com (lgeamrelo02.lge.com. [156.147.1.126]) by mx.google.com with ESMTP id go6si25017679pac.116.2014.06.30.18.07.08 for ; Mon, 30 Jun 2014 18:07:09 -0700 (PDT) Message-ID: <53B209BA.8010106@lge.com> Date: Tue, 01 Jul 2014 10:07:06 +0900 From: Gioh Kim MIME-Version: 1.0 Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> In-Reply-To: <53B06DD0.8030106@codeaurora.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Laura Abbott , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Hi,Laura. I have a question. Does the __evict_bh_lru() not need bh_lru_lock()? The get_cpu_var() has already preenpt_disable() and can prevent other thread. But get_cpu_var cannot prevent IRQ context such like page-fault. I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. Is my concern correct? 2014-06-30 i??i ? 4:49, Laura Abbott i?' e,?: > (cc-ing Hugh since he had comments on the patch before) > > On 6/26/2014 4:23 PM, Gioh Kim wrote: >> >> >> 2014-06-27 i??i ? 12:57, Michal Nazarewicz i?' e,?: >>> On Tue, Jun 24 2014, Gioh Kim wrote: >>>> Hello, >>>> >>>> I am trying to apply CMA feature for my platform. >>>> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >>>> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >>>> Now my platform can use CMA area effectively. >>>> >>>> But I have many failures to allocate memory from CMA area. >>>> I found the same situation to Laura Abbott's patch descrbing, >>>> https://lkml.org/lkml/2012/8/31/313, >>>> that releases buffer-heads attached at CPU's LRU list. >>>> >>>> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >>>> buffer-heads problem is going to be serious definitely. >>>> >>>> Please look into the Laura's patch again. >>>> I think it must be applied with Joonsoo's patch. >>> >>> Just to make sure I understood you correctly, you're saying Laura's >>> patch at fixes your issue? >>> >> >> Yes, it is. > > I submitted this before and it was suggested that this was more > related to filesystems > > http://marc.info/?l=linaro-mm-sig&m=137645770708817&w=2 > > I never saw more discussion and pushed this into the 'CMA hacks' pile. > So far we've been keeping the patch out of tree and it's useful to know > that others have found the same problem. I'm willing to resubmit the > patch for further discussion. > > Thanks, > Laura > -- 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: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) by kanga.kvack.org (Postfix) with ESMTP id AA92C6B0035 for ; Mon, 30 Jun 2014 22:02:47 -0400 (EDT) Received: by mail-ie0-f181.google.com with SMTP id rl12so81868iec.40 for ; Mon, 30 Jun 2014 19:02:47 -0700 (PDT) Received: from smtp.codeaurora.org (smtp.codeaurora.org. [198.145.11.231]) by mx.google.com with ESMTPS id r10si32036975ico.103.2014.06.30.19.02.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jun 2014 19:02:46 -0700 (PDT) Message-ID: <53B216C5.8020503@codeaurora.org> Date: Mon, 30 Jun 2014 19:02:45 -0700 From: Laura Abbott MIME-Version: 1.0 Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> In-Reply-To: <53B209BA.8010106@lge.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins On 6/30/2014 6:07 PM, Gioh Kim wrote: > Hi,Laura. > > I have a question. > > Does the __evict_bh_lru() not need bh_lru_lock()? > The get_cpu_var() has already preenpt_disable() and can prevent other thread. > But get_cpu_var cannot prevent IRQ context such like page-fault. > I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. > > Is my concern correct? > > __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock either. It's possible I missed something though. Thanks, Laura -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- 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: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by kanga.kvack.org (Postfix) with ESMTP id 9B0C86B0031 for ; Wed, 2 Jul 2014 01:46:46 -0400 (EDT) Received: by mail-pa0-f54.google.com with SMTP id et14so11827991pad.41 for ; Tue, 01 Jul 2014 22:46:46 -0700 (PDT) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTP id yu2si29173787pac.156.2014.07.01.22.46.45 for ; Tue, 01 Jul 2014 22:46:45 -0700 (PDT) Date: Tue, 1 Jul 2014 22:46:21 -0700 From: Andrew Morton Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru Message-Id: <20140701224621.bb6a5157.akpm@linux-foundation.org> In-Reply-To: <53B216C5.8020503@codeaurora.org> References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> <53B216C5.8020503@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Laura Abbott Cc: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Mel Gorman , =?UTF-8?Q?=EC=9D=B4=EA=B1=B4=ED=98=B8?= , Hugh Dickins On Mon, 30 Jun 2014 19:02:45 -0700 Laura Abbott wrote: > On 6/30/2014 6:07 PM, Gioh Kim wrote: > > Hi,Laura. > > > > I have a question. > > > > Does the __evict_bh_lru() not need bh_lru_lock()? > > The get_cpu_var() has already preenpt_disable() and can prevent other thread. > > But get_cpu_var cannot prevent IRQ context such like page-fault. > > I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. > > > > Is my concern correct? > > > > > > __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. > I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock > either. It's possible I missed something though. I fear that running on_each_cpu() within try_to_free_buffers() is going to be horridly expensive in some cases. Maybe CMA can use invalidate_bh_lrus() to shoot down everything before trying the allocation attempt. That should increase the success rate greatly and doesn't burden page reclaim. The bh LRU isn't terribly important from a performance point of view, so emptying it occasionally won't hurt. -- 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: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by kanga.kvack.org (Postfix) with ESMTP id B24FF6B0035 for ; Thu, 3 Jul 2014 03:34:47 -0400 (EDT) Received: by mail-la0-f44.google.com with SMTP id ty20so7891613lab.3 for ; Thu, 03 Jul 2014 00:34:46 -0700 (PDT) Received: from lgemrelse6q.lge.com (LGEMRELSE6Q.lge.com. [156.147.1.121]) by mx.google.com with ESMTP id i6si15416302lbd.45.2014.07.03.00.34.44 for ; Thu, 03 Jul 2014 00:34:46 -0700 (PDT) Message-ID: <53B50791.50208@lge.com> Date: Thu, 03 Jul 2014 16:34:41 +0900 From: Gioh Kim MIME-Version: 1.0 Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> <53B216C5.8020503@codeaurora.org> <20140701224621.bb6a5157.akpm@linux-foundation.org> In-Reply-To: <20140701224621.bb6a5157.akpm@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Laura Abbott Cc: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Hi, Laura, I has replaced the evict_bh_lrus(bh) with invalidate_bh_lrus() and it is working fine. How about submit new patch with invalidate_bh_lrus()? I would appreciate it. 2014-07-02 i??i?? 2:46, Andrew Morton i?' e,?: > On Mon, 30 Jun 2014 19:02:45 -0700 Laura Abbott wrote: > >> On 6/30/2014 6:07 PM, Gioh Kim wrote: >>> Hi,Laura. >>> >>> I have a question. >>> >>> Does the __evict_bh_lru() not need bh_lru_lock()? >>> The get_cpu_var() has already preenpt_disable() and can prevent other thread. >>> But get_cpu_var cannot prevent IRQ context such like page-fault. >>> I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. >>> >>> Is my concern correct? >>> >>> >> >> __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. >> I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock >> either. It's possible I missed something though. > > I fear that running on_each_cpu() within try_to_free_buffers() is going > to be horridly expensive in some cases. > > Maybe CMA can use invalidate_bh_lrus() to shoot down everything before > trying the allocation attempt. That should increase the success rate > greatly and doesn't burden page reclaim. The bh LRU isn't terribly > important from a performance point of view, so emptying it occasionally > won't hurt. > > -- 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 S1752962AbaFXBMz (ORCPT ); Mon, 23 Jun 2014 21:12:55 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:33624 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbaFXBMy (ORCPT ); Mon, 23 Jun 2014 21:12:54 -0400 X-Original-SENDERIP: 10.178.33.69 X-Original-MAILFROM: gioh.kim@lge.com Message-ID: <53A8D092.4040801@lge.com> Date: Tue, 24 Jun 2014 10:12:50 +0900 From: Gioh Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org CC: Joonsoo Kim , Mel Gorman , =?EUC-KR?B?wMywx8ij?= Subject: [RFC] CMA page migration failure due to buffers on bh_lru Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I am trying to apply CMA feature for my platform. My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). Now my platform can use CMA area effectively. But I have many failures to allocate memory from CMA area. I found the same situation to Laura Abbott's patch descrbing, https://lkml.org/lkml/2012/8/31/313, that releases buffer-heads attached at CPU's LRU list. If Joonsoo's patch is applied and/or CMA feature is applied more and more, buffer-heads problem is going to be serious definitely. Please look into the Laura's patch again. I think it must be applied with Joonsoo's patch. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757889AbaFZP55 (ORCPT ); Thu, 26 Jun 2014 11:57:57 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:45665 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756110AbaFZP5z convert rfc822-to-8bit (ORCPT ); Thu, 26 Jun 2014 11:57:55 -0400 From: Michal Nazarewicz To: Gioh Kim , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Joonsoo Kim , Mel Gorman , =?utf-8?B?7J206rG07Zi4?= Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru In-Reply-To: <53A8D092.4040801@lge.com> Organization: http://mina86.com/ References: <53A8D092.4040801@lge.com> User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.4.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd;KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:140626:iamjoonsoo.kim@lge.com::vdXQvVFosioAoY/d:0000000000000000000000000000000000000000mso X-Hashcash: 1:20:140626:gioh.kim@lge.com::0v2DiW5Fc1sPRJHA:01srl X-Hashcash: 1:20:140626:linux-kernel@vger.kernel.org::FRbPAVkhN2mETh+x:00000000000000000000000000000000024bD X-Hashcash: 1:20:140626:gunho.lee@lge.com::aLV237VTwS16dH4m:000000000000000000000000000000000000000000002YMk X-Hashcash: 1:20:140626:linux-mm@kvack.org::k0hsDOUG8jhxAICB:00000000000000000000000000000000000000000002zDg X-Hashcash: 1:20:140626:m.szyprowski@samsung.com::SzVHLG8v1HMqRwPH:00000000000000000000000000000000000004BcD X-Hashcash: 1:20:140626:mgorman@suse.de::0Q3wutb8+5fEcTAF:005Ry/ Date: Thu, 26 Jun 2014 17:57:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 24 2014, Gioh Kim wrote: > Hello, > > I am trying to apply CMA feature for my platform. > My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied > a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). > Now my platform can use CMA area effectively. > > But I have many failures to allocate memory from CMA area. > I found the same situation to Laura Abbott's patch descrbing, > https://lkml.org/lkml/2012/8/31/313, > that releases buffer-heads attached at CPU's LRU list. > > If Joonsoo's patch is applied and/or CMA feature is applied more and more, > buffer-heads problem is going to be serious definitely. > > Please look into the Laura's patch again. > I think it must be applied with Joonsoo's patch. Just to make sure I understood you correctly, you're saying Laura's patch at fixes your issue? -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz (o o) ooo +------ooO--(_)--Ooo-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbaFZXXy (ORCPT ); Thu, 26 Jun 2014 19:23:54 -0400 Received: from lgeamrelo04.lge.com ([156.147.1.127]:42286 "EHLO lgeamrelo04.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329AbaFZXXx (ORCPT ); Thu, 26 Jun 2014 19:23:53 -0400 X-Original-SENDERIP: 10.178.33.69 X-Original-MAILFROM: gioh.kim@lge.com Message-ID: <53ACAB82.6020201@lge.com> Date: Fri, 27 Jun 2014 08:23:46 +0900 From: Gioh Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org CC: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2014-06-27 오전 12:57, Michal Nazarewicz 쓴 글: > On Tue, Jun 24 2014, Gioh Kim wrote: >> Hello, >> >> I am trying to apply CMA feature for my platform. >> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >> Now my platform can use CMA area effectively. >> >> But I have many failures to allocate memory from CMA area. >> I found the same situation to Laura Abbott's patch descrbing, >> https://lkml.org/lkml/2012/8/31/313, >> that releases buffer-heads attached at CPU's LRU list. >> >> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >> buffer-heads problem is going to be serious definitely. >> >> Please look into the Laura's patch again. >> I think it must be applied with Joonsoo's patch. > > Just to make sure I understood you correctly, you're saying Laura's > patch at fixes your issue? > Yes, it is. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbaF2Ttk (ORCPT ); Sun, 29 Jun 2014 15:49:40 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:33012 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbaF2Tti (ORCPT ); Sun, 29 Jun 2014 15:49:38 -0400 Message-ID: <53B06DD0.8030106@codeaurora.org> Date: Sun, 29 Jun 2014 12:49:36 -0700 From: Laura Abbott User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org CC: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> In-Reply-To: <53ACAB82.6020201@lge.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (cc-ing Hugh since he had comments on the patch before) On 6/26/2014 4:23 PM, Gioh Kim wrote: > > > 2014-06-27 오전 12:57, Michal Nazarewicz 쓴 글: >> On Tue, Jun 24 2014, Gioh Kim wrote: >>> Hello, >>> >>> I am trying to apply CMA feature for my platform. >>> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >>> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >>> Now my platform can use CMA area effectively. >>> >>> But I have many failures to allocate memory from CMA area. >>> I found the same situation to Laura Abbott's patch descrbing, >>> https://lkml.org/lkml/2012/8/31/313, >>> that releases buffer-heads attached at CPU's LRU list. >>> >>> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >>> buffer-heads problem is going to be serious definitely. >>> >>> Please look into the Laura's patch again. >>> I think it must be applied with Joonsoo's patch. >> >> Just to make sure I understood you correctly, you're saying Laura's >> patch at fixes your issue? >> > > Yes, it is. I submitted this before and it was suggested that this was more related to filesystems http://marc.info/?l=linaro-mm-sig&m=137645770708817&w=2 I never saw more discussion and pushed this into the 'CMA hacks' pile. So far we've been keeping the patch out of tree and it's useful to know that others have found the same problem. I'm willing to resubmit the patch for further discussion. Thanks, Laura -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756757AbaGABHL (ORCPT ); Mon, 30 Jun 2014 21:07:11 -0400 Received: from lgeamrelo02.lge.com ([156.147.1.126]:33607 "EHLO lgeamrelo02.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbaGABHJ (ORCPT ); Mon, 30 Jun 2014 21:07:09 -0400 X-Original-SENDERIP: 10.178.33.69 X-Original-MAILFROM: gioh.kim@lge.com Message-ID: <53B209BA.8010106@lge.com> Date: Tue, 01 Jul 2014 10:07:06 +0900 From: Gioh Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Laura Abbott , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org CC: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> In-Reply-To: <53B06DD0.8030106@codeaurora.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi,Laura. I have a question. Does the __evict_bh_lru() not need bh_lru_lock()? The get_cpu_var() has already preenpt_disable() and can prevent other thread. But get_cpu_var cannot prevent IRQ context such like page-fault. I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. Is my concern correct? 2014-06-30 오전 4:49, Laura Abbott 쓴 글: > (cc-ing Hugh since he had comments on the patch before) > > On 6/26/2014 4:23 PM, Gioh Kim wrote: >> >> >> 2014-06-27 오전 12:57, Michal Nazarewicz 쓴 글: >>> On Tue, Jun 24 2014, Gioh Kim wrote: >>>> Hello, >>>> >>>> I am trying to apply CMA feature for my platform. >>>> My kernel version, 3.10.x, is not allocating memory from CMA area so that I applied >>>> a Joonsoo Kim's patch (https://lkml.org/lkml/2014/5/28/64). >>>> Now my platform can use CMA area effectively. >>>> >>>> But I have many failures to allocate memory from CMA area. >>>> I found the same situation to Laura Abbott's patch descrbing, >>>> https://lkml.org/lkml/2012/8/31/313, >>>> that releases buffer-heads attached at CPU's LRU list. >>>> >>>> If Joonsoo's patch is applied and/or CMA feature is applied more and more, >>>> buffer-heads problem is going to be serious definitely. >>>> >>>> Please look into the Laura's patch again. >>>> I think it must be applied with Joonsoo's patch. >>> >>> Just to make sure I understood you correctly, you're saying Laura's >>> patch at fixes your issue? >>> >> >> Yes, it is. > > I submitted this before and it was suggested that this was more > related to filesystems > > http://marc.info/?l=linaro-mm-sig&m=137645770708817&w=2 > > I never saw more discussion and pushed this into the 'CMA hacks' pile. > So far we've been keeping the patch out of tree and it's useful to know > that others have found the same problem. I'm willing to resubmit the > patch for further discussion. > > Thanks, > Laura > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250AbaGACCs (ORCPT ); Mon, 30 Jun 2014 22:02:48 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:47300 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbaGACCq (ORCPT ); Mon, 30 Jun 2014 22:02:46 -0400 Message-ID: <53B216C5.8020503@codeaurora.org> Date: Mon, 30 Jun 2014 19:02:45 -0700 From: Laura Abbott User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org CC: Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> In-Reply-To: <53B209BA.8010106@lge.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/30/2014 6:07 PM, Gioh Kim wrote: > Hi,Laura. > > I have a question. > > Does the __evict_bh_lru() not need bh_lru_lock()? > The get_cpu_var() has already preenpt_disable() and can prevent other thread. > But get_cpu_var cannot prevent IRQ context such like page-fault. > I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. > > Is my concern correct? > > __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock either. It's possible I missed something though. Thanks, Laura -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbaGBFqq (ORCPT ); Wed, 2 Jul 2014 01:46:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57324 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbaGBFqp (ORCPT ); Wed, 2 Jul 2014 01:46:45 -0400 Date: Tue, 1 Jul 2014 22:46:21 -0700 From: Andrew Morton To: Laura Abbott Cc: Gioh Kim , Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Mel Gorman , =?UTF-8?Q?=EC=9D=B4=EA=B1=B4=ED=98=B8?= , Hugh Dickins Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru Message-Id: <20140701224621.bb6a5157.akpm@linux-foundation.org> In-Reply-To: <53B216C5.8020503@codeaurora.org> References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> <53B216C5.8020503@codeaurora.org> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jun 2014 19:02:45 -0700 Laura Abbott wrote: > On 6/30/2014 6:07 PM, Gioh Kim wrote: > > Hi,Laura. > > > > I have a question. > > > > Does the __evict_bh_lru() not need bh_lru_lock()? > > The get_cpu_var() has already preenpt_disable() and can prevent other thread. > > But get_cpu_var cannot prevent IRQ context such like page-fault. > > I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. > > > > Is my concern correct? > > > > > > __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. > I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock > either. It's possible I missed something though. I fear that running on_each_cpu() within try_to_free_buffers() is going to be horridly expensive in some cases. Maybe CMA can use invalidate_bh_lrus() to shoot down everything before trying the allocation attempt. That should increase the success rate greatly and doesn't burden page reclaim. The bh LRU isn't terribly important from a performance point of view, so emptying it occasionally won't hurt. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932362AbaGCHeq (ORCPT ); Thu, 3 Jul 2014 03:34:46 -0400 Received: from LGEMRELSE6Q.lge.com ([156.147.1.121]:36342 "EHLO lgemrelse6q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932091AbaGCHeo (ORCPT ); Thu, 3 Jul 2014 03:34:44 -0400 X-Original-SENDERIP: 10.178.33.69 X-Original-MAILFROM: gioh.kim@lge.com Message-ID: <53B50791.50208@lge.com> Date: Thu, 03 Jul 2014 16:34:41 +0900 From: Gioh Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrew Morton , Laura Abbott CC: Michal Nazarewicz , Marek Szyprowski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Mel Gorman , =?UTF-8?B?7J206rG07Zi4?= , Hugh Dickins Subject: Re: [RFC] CMA page migration failure due to buffers on bh_lru References: <53A8D092.4040801@lge.com> <53ACAB82.6020201@lge.com> <53B06DD0.8030106@codeaurora.org> <53B209BA.8010106@lge.com> <53B216C5.8020503@codeaurora.org> <20140701224621.bb6a5157.akpm@linux-foundation.org> In-Reply-To: <20140701224621.bb6a5157.akpm@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Laura, I has replaced the evict_bh_lrus(bh) with invalidate_bh_lrus() and it is working fine. How about submit new patch with invalidate_bh_lrus()? I would appreciate it. 2014-07-02 오후 2:46, Andrew Morton 쓴 글: > On Mon, 30 Jun 2014 19:02:45 -0700 Laura Abbott wrote: > >> On 6/30/2014 6:07 PM, Gioh Kim wrote: >>> Hi,Laura. >>> >>> I have a question. >>> >>> Does the __evict_bh_lru() not need bh_lru_lock()? >>> The get_cpu_var() has already preenpt_disable() and can prevent other thread. >>> But get_cpu_var cannot prevent IRQ context such like page-fault. >>> I think if a page-fault occured and a file is read in IRQ context it can change cpu-lru. >>> >>> Is my concern correct? >>> >>> >> >> __evict_bh_lru is called via on_each_cpu_cond which I believe will disable irqs. >> I based the code on the existing invalidate_bh_lru which did not take the bh_lru_lock >> either. It's possible I missed something though. > > I fear that running on_each_cpu() within try_to_free_buffers() is going > to be horridly expensive in some cases. > > Maybe CMA can use invalidate_bh_lrus() to shoot down everything before > trying the allocation attempt. That should increase the success rate > greatly and doesn't burden page reclaim. The bh LRU isn't terribly > important from a performance point of view, so emptying it occasionally > won't hurt. > >