Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2463166imm; Thu, 16 Aug 2018 09:58:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyusMX4urnFhkUXaFMzlYcKwZYH5eCCgXmqL91JZ+UMzzapJXj3d2NSYnQba2H6RNJS0XzR X-Received: by 2002:a63:e001:: with SMTP id e1-v6mr27164082pgh.380.1534438717258; Thu, 16 Aug 2018 09:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534438717; cv=none; d=google.com; s=arc-20160816; b=uwmHMMXRBEk0//XYX+fzhHaFPAANQeVOc7YZ8H5ZfLhJKavN62xwQ8OlnGv7PcpvuX wrKk2n57YSvLu/8lc7dowEaHPl8NECZD06SJE7pSwVNN951t6JQy8HieKpu8XaTmf28M XCaNa2mC9mZy1mjwfxCpg123g5M4uRwfXm1WcD06RVwpyrUgscGYgVt3fwg6DnXnGhoU YEiJ+A0enBXIsy6TU5rUjEoIvlwE7ttQyN393ST1KEZwlsaWU1LnlLJUUds95eJor+c6 inEuVEqueQgpnInyA+B3f62GEAWMb5wH7YzBEgzfwebAvahvzxGcZ2wze6+Y1j/GFEEj zdpQ== 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:arc-authentication-results; bh=V3U7ExNFQLFSp5bzM6hK1IrHrw+W6qMsNo+n2h1BaA8=; b=NAziduC7ODpDoxwwG0HCuCjZRWWNBqIye3s4w+xQ+DqTSo9x5sloFw5J738fvDiS9O CMBOi1yr05jysspZNc2yhCv6ex74IF9VTqD1DkgNqLm4xU1s2fpNyuCD6mIrcElIGREE 5+3S3wETXKrIclxHEtRV8Jg7FlM7BVoQMTmpSyNpOdxjXddjZ+6R9Lb+WYut6j9aYPDw tVvr1Nf97FmnSlcDZCc5UdOYjaGiFjqItoKohFJn5iBL9LW1qqzW3QzlKCjN/hzjU3Ke o6Jyo+9tgLZPL3JtdbVAFuZg5XRQpFpwfq6BqRNjame9/99xoEnjcL8FQXimL/r4yxTg UmcQ== 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 n24-v6si26753714pgb.665.2018.08.16.09.58.22; Thu, 16 Aug 2018 09:58:37 -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 S2390412AbeHPMSc (ORCPT + 99 others); Thu, 16 Aug 2018 08:18:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:41326 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727243AbeHPMSc (ORCPT ); Thu, 16 Aug 2018 08:18:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5B856AEEE; Thu, 16 Aug 2018 09:21:18 +0000 (UTC) Date: Thu, 16 Aug 2018 11:21:16 +0200 From: Michal Hocko To: Li RongQing Cc: Andrew Morton , Dan Williams , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Matthew Wilcox , Souptick Joarder Subject: Re: [PATCH] mm: introduce kvvirt_to_page() helper Message-ID: <20180816092116.GT32645@dhcp22.suse.cz> References: <1534411057-26276-1-git-send-email-lirongqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1534411057-26276-1-git-send-email-lirongqing@baidu.com> 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 Thu 16-08-18 17:17:37, Li RongQing wrote: > The new helper returns address mapping page, which has several users > in individual subsystem, like mem_to_page in xfs_buf.c and pgv_to_page > in af_packet.c, after this, they can be unified Please add users along with the new helper. > > Signed-off-by: Zhang Yu > Signed-off-by: Li RongQing > --- > include/linux/mm.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 68a5121694ef..bb34a3c71df5 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -599,6 +599,14 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) > return kvmalloc_array(n, size, flags | __GFP_ZERO); > } > > +static inline struct page *kvvirt_to_page(const void *addr) > +{ > + if (!is_vmalloc_addr(addr)) > + return virt_to_page(addr); > + else > + return vmalloc_to_page(addr); > +} > + > extern void kvfree(const void *addr); > > static inline atomic_t *compound_mapcount_ptr(struct page *page) > -- > 2.16.2 > -- Michal Hocko SUSE Labs