Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1067005imd; Thu, 1 Nov 2018 09:43:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5fbzDI34awyiSiYN2ukizGlQsWIPC7HsZM951mUR5qviTEL7Xt0eNCBqwYM4C7HkTs9GrJU X-Received: by 2002:a17:902:788b:: with SMTP id q11-v6mr8508685pll.54.1541090582776; Thu, 01 Nov 2018 09:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541090582; cv=none; d=google.com; s=arc-20160816; b=zpCjT9W1pa483bTZK0kFdWy3WiLfCHgPk4fVrnOj+He2Yr8ae/e0bmxjPM3EhpwjNR ZSfeWVq9sAizX8bB5WYPhyIAtXv/oQVIyKWYUHZSQpuK3xcB1YEVniAO1TNdozSLwl4L w/RSZJFEbTX34UrUrPcuTTb981F1xKA0sLH6Caok3UvdG1KZkQX09LuHUt0FZx26m+AA EL0ZmrMDQ7Ablbh4Gn19UUnWUBg+gsDroPkQdt6MkM7dTENJ3K6K2dEzeB6PqetLOgE1 JWzxOVKblIe+DjPCF2IElhEbdqK0CLxz0/HqkcWOAlXDc/cvOxZjtQOOvp5WBjkGPJ4i /hcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=kr5D+aPdEvQI32yCtVtmmIrOvdrB62NucPjeadLwEqg=; b=ON43jRnEopVl9caUnV4CJEou5jc41ifzCYASbO+RlKL2zvFbhtP/acvsH1C2c1rMIq JLPsogUfdg7LrZbs/2MveU3bCZF/9DJn8ulstdYiUMzZ+EB/oidjo2RoxVb1Zhl8Cms1 0WWS5I6mGtL75AI3xqXUhek2+QLGbauWOADhSaBHM/KHWHbN+0UkFsZWb/ETkgKqu9XE 7UhKWAVa+nMa144xIBK/8TDM7+XeVutGtY+wSrS3uQ2Ek9Eu0qZ4lCf7hj1VRAkOLLon kFSFX9eiSDzUE0HIQGF4DVEhJl0uYNwzqBMc8XxeXCxSrr9WcDTLjZFTefxVN41fSlu5 ESCA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e92-v6si30782400pld.45.2018.11.01.09.42.46; Thu, 01 Nov 2018 09:43:02 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726032AbeKBBqI (ORCPT + 99 others); Thu, 1 Nov 2018 21:46:08 -0400 Received: from mga17.intel.com ([192.55.52.151]:22788 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbeKBBqI (ORCPT ); Thu, 1 Nov 2018 21:46:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 09:42:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="87868864" Received: from kohsamui.iil.intel.com (HELO [10.236.193.12]) ([10.236.193.12]) by orsmga006.jf.intel.com with ESMTP; 01 Nov 2018 09:42:21 -0700 To: sbates@raithlin.com, danielmentz@google.com, mathieu.desnoyers@efficios.co Cc: Linux Kernel Mailing List , Laura Abbott From: Alexey Skidanov Subject: lib/genalloc Message-ID: Date: Thu, 1 Nov 2018 18:43:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I use gen_pool_first_fit_align() as pool allocation algorithm allocating buffers with requested alignment. But if a chunk base address is not aligned to the requested alignment(from some reason), the returned address is not aligned too. The reason is the allocation algorithm works on bitmap, omitting the base address. Is this behavior by design? Thanks, Alexey