From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799AbdBDGir (ORCPT ); Sat, 4 Feb 2017 01:38:47 -0500 Received: from out0-137.mail.aliyun.com ([140.205.0.137]:52173 "EHLO out0-137.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753685AbdBDGiq (ORCPT ); Sat, 4 Feb 2017 01:38:46 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03290;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---.7YSvk1Y_1486190288; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Shaohua Li'" , , Cc: , , , , , , , , References: <3914c9f53c343357c39cb891210da31aa30ad3a9.1486163864.git.shli@fb.com> In-Reply-To: <3914c9f53c343357c39cb891210da31aa30ad3a9.1486163864.git.shli@fb.com> Subject: Re: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Date: Sat, 04 Feb 2017 14:38:07 +0800 Message-ID: <007e01d27eb1$3f98dee0$beca9ca0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHL8bUnrW28kOshlkGIqYQq7mO9XQMVr0wgoUzLzDA= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On February 04, 2017 7:33 AM Shaohua Li wrote: > @@ -1404,6 +1401,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, > set_pmd_at(mm, addr, pmd, orig_pmd); > tlb_remove_pmd_tlb_entry(tlb, pmd, addr); > } > + > + mark_page_lazyfree(page); > ret = true; > out: > spin_unlock(ptl); > -void deactivate_page(struct page *page) > -{ > - if (PageLRU(page) && PageActive(page) && !PageUnevictable(page)) { > - struct pagevec *pvec = &get_cpu_var(lru_deactivate_pvecs); > +void mark_page_lazyfree(struct page *page) > + { > + if (PageLRU(page) && PageAnon(page) && PageSwapBacked(page) && > + !PageUnevictable(page)) { > + struct pagevec *pvec = &get_cpu_var(lru_lazyfree_pvecs); > > get_page(page); > if (!pagevec_add(pvec, page) || PageCompound(page)) > - pagevec_lru_move_fn(pvec, lru_deactivate_fn, NULL); > - put_cpu_var(lru_deactivate_pvecs); > + pagevec_lru_move_fn(pvec, lru_lazyfree_fn, NULL); > + put_cpu_var(lru_lazyfree_pvecs); > } > } You are not adding it but would you please try to fix or avoid flipping preempt count with page table lock hold? thanks Hillf